diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index 22e6706..721c6d2 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -1,65 +1,63 @@ -import { Button, Modal,message,Row,Col, Spin} from 'antd'; +import { Button, Modal, message, Row, Col, Spin } from 'antd'; import isEmpty from 'lodash/isEmpty' import cloneDeep from 'lodash/cloneDeep' import forEach from 'lodash/forEach' -import { WeaAlertPage, WeaTools,WeaTableEdit,WeaSearchGroup,WeaRightMenu, WeaFormItem, WeaTab} from 'ecCom' -import {WeaSwitch} from 'comsMobx'; -import { inject, observer} from 'mobx-react'; +import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom' +import { WeaSwitch } from 'comsMobx'; +import { inject, observer } from 'mobx-react'; import * as mobx from 'mobx'; -import {i18n} from '../../public/i18n'; +import { i18n } from '../../public/i18n'; const toJS = mobx.toJS; +import '../../style/common.less'; + @inject('companyExtend') @inject('company') @observer export default class CompanyExtend extends React.Component { - - componentDidMount(){ - const {companyExtend} = this.props; - companyExtend.setTopButtons(this.getTopButtons.bind(this)); - companyExtend.setTopRightMenus(this.getRightMenu.bind(this)); - companyExtend.setTopShowDropIcon(true); + + componentDidMount() { this.init(); } init = () => { - // const {companyExtend, companyExtend, setParentRightMenu} = this.props; - companyExtend.init(); + const { companyExtend } = this.props; + companyExtend.init(); // companyExtend.hrmId=hrmId; - companyExtend.getData(); + companyExtend.getData(); } getTabChildren = () => { - const {companyExtend} = this.props; - let {tableInfo, isEditor, tabkey,onRowSelect,selectedRowKeys} = companyExtend; + const { companyExtend } = this.props; + let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys } = companyExtend; let tabChildren = []; tableInfo = toJS(tableInfo); - tableInfo && tableInfo.map((t,i)=>{ - if(tabkey==i){ - tabChildren.push( - companyExtend.setPersonalEditTables(ref)} - showTitle={isEditor} - // title={'列表信息'} - // addFirstRow={isEditor} - columns={t.tabinfo.columns} - datas={t.tabinfo.datas} - onChange={this.tableEditChange} - selectedRowKeys={toJS(selectedRowKeys)} - onRowSelect={keys => onRowSelect(keys)} - onBtnsSelect={key=>this.onBtnsSelect(key,i)} - viewAttr={isEditor?2: 1} - getRowSelection={isEditor? (rowSelection)=>{ - Object.assign(rowSelection,{ - getCheckboxProps: record => ({ - disabled: record.viewAttr === 1, // 配置无法勾选的列 - }) - }) - return rowSelection; - }: ()=>null} - /> - ); - } + tableInfo && tableInfo.map((t, i) => { + if (tabkey == i) { + tabChildren.push( + companyExtend.setPersonalEditTables(ref)} + showTitle={isEditor} + // title={'列表信息'} + // addFirstRow={isEditor} + columns={t.tabinfo.columns} + datas={t.tabinfo.datas} + onChange={this.tableEditChange} + selectedRowKeys={toJS(selectedRowKeys)} + onRowSelect={keys => onRowSelect(keys)} + onBtnsSelect={key => this.onBtnsSelect(key, i)} + viewAttr={isEditor ? 2 : 1} + getRowSelection={isEditor ? (rowSelection) => { + Object.assign(rowSelection, { + getCheckboxProps: record => ({ + disabled: record.viewAttr === 1, // 配置无法勾选的列 + }) + }) + return rowSelection; + } : () => null} + /> + ); + } }) return tabChildren; } @@ -76,60 +74,60 @@ export default class CompanyExtend extends React.Component { const datas = tableInfo[index].tabinfo.datas; if (key === 'copy') { - tableInfo[index].tabinfo.datas = datas.map( (data,i) => { + tableInfo[index].tabinfo.datas = datas.map((data, i) => { if (!selectedRows[index].includes(i)) { data.viewAttr = 2; } return data - }) + }) } if (key === 'delete') { - tableInfo[index].tabinfo.datas = datas.map( (data,i) => { - if (selectedRows[index].includes(i)) { - data.viewAttr = 1; - } - return data - }); - setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row))) + tableInfo[index].tabinfo.datas = datas.map((data, i) => { + if (selectedRows[index].includes(i)) { + data.viewAttr = 1; + } + return data + }); + setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row))) } } getSearchs = () => { - const {companyExtend} = this.props; - let {form, conditions, isEditor} = companyExtend; - const {isFormInit} = form; + const { companyExtend } = this.props; + let { form, conditions, isEditor } = companyExtend; + const { isFormInit } = form; let group = []; let tipPosition = 'bottom'; window.e9HideFormFieldKeys = []; - isFormInit && conditions.forEach((c, i) =>{ - let items = []; - c.items.forEach( (field, j) => { - if(c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)){ - window.e9HideFormFieldKeys.push(field.domkey[0]); - }else{ - items.push({ - com:( - - ), - colSpan: 1 - }); - } - }); - group.push() + isFormInit && conditions.forEach((c, i) => { + let items = []; + c.items.forEach((field, j) => { + if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) { + window.e9HideFormFieldKeys.push(field.domkey[0]); + } else { + items.push({ + com: ( + + ), + colSpan: 1 + }); + } + }); + group.push() }); return group; } tableEditChange = (data) => { - const {companyExtend} = this.props; - let {tabkey = '0', tableInfo} = companyExtend; + const { companyExtend } = this.props; + let { tabkey = '0', tableInfo } = companyExtend; tableInfo = toJS(tableInfo); let d = cloneDeep(tableInfo); d[Number(tabkey)].tabinfo.datas = data; @@ -137,51 +135,51 @@ export default class CompanyExtend extends React.Component { } getRightMenu = () => { - const {companyExtend} = this.props; - const {isEditor, buttons} = companyExtend; + const { companyExtend } = this.props; + const { isEditor, buttons } = companyExtend; let arr = []; - try{ - if(buttons.hasEdit){ - if (isEditor){ - arr = [{ - icon: , - content: i18n.button.save(), - key: 'save', - onClick: key =>{ - this.saveEditCard(); - } - }, { - icon: , - content: i18n.button.back(), - key: 'back', - onClick: key =>{ - this.backCard(); - } - }] - } else { - arr = [{ - icon: , - content:i18n.button.modify(), - key: 'editCard', - onClick: key =>{ - this.editCard(); - } - } - ] + try { + if (buttons.hasEdit) { + if (isEditor) { + arr = [{ + icon: , + content: i18n.button.save(), + key: 'save', + onClick: key => { + this.saveEditCard(); + } + }, { + icon: , + content: i18n.button.back(), + key: 'back', + onClick: key => { + this.backCard(); + } + }] + } else { + arr = [{ + icon: , + content: i18n.button.modify(), + key: 'editCard', + onClick: key => { + this.editCard(); + } } + ] + } } - }catch(e){} + } catch (e) { } return arr; } - + getTopButtons = () => { - const {companyExtend} = this.props; - const {isEditor, buttons} = companyExtend; + const { companyExtend } = this.props; + const { isEditor, buttons } = companyExtend; const save = ; const back = ; const edit = ; const btns = []; - try{ + try { if (isEditor) { if (buttons.hasSave) { btns.push(save); @@ -192,17 +190,17 @@ export default class CompanyExtend extends React.Component { btns.push(edit); } } - }catch(e){} + } catch (e) { } return btns; } editCard = () => { - const {companyExtend} = this.props; + const { companyExtend } = this.props; companyExtend.edit(); } saveEditCard = () => { - const {companyExtend} = this.props; + const { companyExtend } = this.props; companyExtend.save(); } @@ -210,10 +208,17 @@ export default class CompanyExtend extends React.Component { this.init(); } + changeData(key) { + const { + companyExtend + } = this.props; + companyExtend.changeData(key); +} + render() { - const {companyExtend} = this.props; - const {loading, detailSelectedKey, tabInfo} = companyExtend; - + const { companyExtend } = this.props; + const { loading, detailSelectedKey, tabInfo,topTab,selectedKey } = companyExtend; + // if(!hasRight && !loading){ // return ( // @@ -222,33 +227,51 @@ export default class CompanyExtend extends React.Component { // ) // } - try{ - return ( -
+ // try { + return ( +
+ + + - {this.getSearchs()} - { - !isEmpty(tabInfo) &&
- { - companyExtend.updateDetailSelectedKey(v); - }} - /> - {this.getTabChildren()} -
- } + {this.getSearchs()} + { + !isEmpty(tabInfo) &&
+ { + companyExtend.updateDetailSelectedKey(v); + }} + /> + {this.getTabChildren()} +
+ }
-
+ + + +
) - }catch(e){ - return -
{i18n.message.authFailed()}
-
- } + // } catch (e) { + // return + //
{i18n.message.authFailed()}
+ //
+ // } } } diff --git a/pc4mobx/organization/public/i18n.js b/pc4mobx/organization/public/i18n.js index aae8001..44a3246 100644 --- a/pc4mobx/organization/public/i18n.js +++ b/pc4mobx/organization/public/i18n.js @@ -822,6 +822,8 @@ export const i18n = { '531692': () => getLabel('531692', '说明:总部节点的人员编号设置主要用于新建分部时将总部的编号设置自动复制给新分部,不用于全局的开关控制,实际根据各分部的开关独立控制。'), }, button: { + back: () => getLabel(1290, '返回'), + batchOpen: () => getLabel(534249, '批量解锁'), collect: () => getLabel(28111, '收藏'), helper: () => getLabel(275, '帮助'), diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 7c66a74..4a179b0 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -18,62 +18,15 @@ export class CompanyStore { @observable form2 = new WeaForm(); @observable form = new WeaForm(); @observable form1 = new WeaForm(); - @observable schemeName = ""; @observable conditionNum = 2; @observable ids = ""; //选择行id @observable searchConditionLoading = true; - @observable nEdialogTitle = ""; @observable visible = false; - @observable dialogLoading = true; - @observable schemeId = ""; @observable date = ""; @action getHasRight() { - this.topMenu = [ - { - isBatch: "1", - isTop: "1", - menuFun: "new", - menuIcon: "icon-coms-New-Flow", - menuName: "新建", - type: "BTN_Addnew", - }, - { - isBatch: "1", - isTop: "1", - menuFun: "batchDelete", - menuIcon: "icon-coms-Batch-delete", - menuName: "批量删除", - type: "BTN_BatchDelete", - }, - ]; - this.rightMenu = [ - { - isBatch: "0", - isTop: "1", - menuFun: "new", - menuIcon: "icon-coms-New-Flow", - menuName: "新建", - type: "BTN_Addnew", - }, - { - isBatch: "0", - isTop: "0", - menuFun: "log", - menuIcon: "icon-coms-Print-log", - menuName: "日志", - type: "BTN_log", - }, - { - isBatch: "0", - isTop: "0", - menuFun: "custom", - menuIcon: "icon-coms-task-list", - menuName: "显示列定制", - type: "BTN_COLUMN", - }, - ]; + } updateFields(val) { diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index 72ff6ba..7bf098a 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -1,175 +1,1156 @@ import { observable, action, toJS } from "mobx"; import { WeaForm } from "comsMobx"; +import isEmpty from 'lodash/isEmpty' import { WeaTableNew } from "comsMobx"; import { Modal, message } from "antd"; import { i18n } from "../public/i18n"; export class CompanyExtendStore { - @observable form = new WeaForm(); - @observable tableInfo = [] - @observable conditions = []; - @observable isEditor = false; - @observable isNew = true; - @observable loading = true; - @observable tabInfo = []; - @observable selectedKey = 0; - @observable detailSelectedKey = 0; - @observable buttons = {} - @observable date; - @observable personalEditTables; + @observable form = new WeaForm(); + @observable tableInfo = [] + @observable conditions = []; + @observable isEditor = false; + @observable isNew = true; + @observable loading = true; + @observable tabInfo = []; + @observable selectedKey = 0; + @observable detailSelectedKey = 0; + @observable topTab = []; + @observable buttons = {} + @observable date; + @observable personalEditTables; - @observable selectedRowKeys = []; - @observable selectedRows = []; + @observable selectedRowKeys = []; + @observable selectedRows = []; - @action onRowSelect = (keys) => { - this.setSelectedRowKeys(keys); - } - - @action setSelectedRowKeys =(keys)=>{ - this.selectedRowKeys = keys; - } + @action onRowSelect = (keys) => { + this.setSelectedRowKeys(keys); + } + + @action setSelectedRowKeys = (keys) => { + this.selectedRowKeys = keys; + } - @action - edit = () => { - this.isEditor = true; - this.getData(); - this.getTabInfo(); - //this.tabkey = '0'; - } + @action + edit = () => { + this.isEditor = true; + this.getData(); + this.getTabInfo(); + //this.tabkey = '0'; + } - init = () => { - //this.tabkey = '0'; - this.isEditor = false; - } + init = () => { + //this.tabkey = '0'; + this.isEditor = false; + } - save = () => { - if(this.loading) - return; - this.loading = true; - this.form.validateForm().then(f => { - if (f.isValid) { - if(this.personalEditTables){ - // const targetDatas = this.tableInfo[this.tabkey].tabinfo.datas, - // isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true - let isPass = true; - if(isPass){ - this.editResource() - }else{ - this.loading = false; - } - }else{ - this.editResource(); + save = () => { + if (this.loading) + return; + this.loading = true; + this.form.validateForm().then(f => { + if (f.isValid) { + if (this.personalEditTables) { + // const targetDatas = this.tableInfo[this.tabkey].tabinfo.datas, + // isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true + let isPass = true; + if (isPass) { + this.editResource() + } else { + this.loading = false; } } else { - f.showErrors(); - this.setDate(new Date()); - this.loading = false; + this.editResource(); } - }) - } - - editResource = () => { - let pDatas = this.form.getFormParams(); - - // API.editResource({ ...{ - // operation: 'editpersonalinfo', - // id: this.hrmId - // }, - // ...pDatas, - // ...this.getTableEditParams() - // }). - // then(data => { - // if (data.status == '1') { - // message.success(i18n.message.saveSuccess()); - // this.init(); - // this.getData(); - // this.selectedRowKeys = []; - // } else { - // message.warning(data.message); - // } - // this.loading = false; - // }, error => { - // message.warning(error.message); - // this.loading = false; - // }) - } - - getTableEditParams = () => { - const params = {}; - this.tableInfo && this.tableInfo.forEach(t => { - t.tabinfo.datas = t.tabinfo.datas || []; - params[t.tabinfo.rownum] = t.tabinfo.datas.length; - t.tabinfo && t.tabinfo.datas && t.tabinfo.datas.forEach((item, index) => { - !isEmpty(item) && forEach(item, (value, key) => { - Object.assign(params,{ - [`${key}_${index}`]: value - }); - }) + } else { + f.showErrors(); + this.setDate(new Date()); + this.loading = false; + } + }) + } + + editResource = () => { + let pDatas = this.form.getFormParams(); + + // API.editResource({ ...{ + // operation: 'editpersonalinfo', + // id: this.hrmId + // }, + // ...pDatas, + // ...this.getTableEditParams() + // }). + // then(data => { + // if (data.status == '1') { + // message.success(i18n.message.saveSuccess()); + // this.init(); + // this.getData(); + // this.selectedRowKeys = []; + // } else { + // message.warning(data.message); + // } + // this.loading = false; + // }, error => { + // message.warning(error.message); + // this.loading = false; + // }) + } + + getTableEditParams = () => { + const params = {}; + this.tableInfo && this.tableInfo.forEach(t => { + t.tabinfo.datas = t.tabinfo.datas || []; + params[t.tabinfo.rownum] = t.tabinfo.datas.length; + t.tabinfo && t.tabinfo.datas && t.tabinfo.datas.forEach((item, index) => { + !isEmpty(item) && forEach(item, (value, key) => { + Object.assign(params, { + [`${key}_${index}`]: value + }); }) }) - return params + }) + return params + } + + + + getData = (params) => { + this.loading = true; + params = { + ...params, + viewAttr:this.isEditor ? 2 : 1 } - - - - getData = (params={}) => { - // this.loading = true; - // params.id=this.hrmId; - // params.viewAttr=this.isEditor?2:1; - // params.is_multilang_set=this.isEditor; - // params.operation = 'getResourcePesonalView'; - // API.getResourceCard(params).then((data) => { - // this.hasRight = has(data, 'hasRight') ? data.hasRight : true; - - // this.loading = false; - // this.form.initFormFields(data.result.conditions); - // this.conditions = data.result.conditions; - // this.tableInfo = this.handleTable(data.result.tables); - // this.getTabInfo(); - // this.buttons = data.result.buttons; - // this.hrmId = data.result.id; - - // this.isEditor && this.getSelectedRows(); - // }) - } - - handleTable = (datas) => { - // return datas && datas.map(data => { - // const {tabinfo:{columns}} = data; - // const length = columns.length; - // columns.map(c => { - // c.width = `${95/length}%` - // }) - // return data - // }) - } - - getTabInfo = () => { - this.tabInfo = []; - this.tableInfo && this.tableInfo.forEach((c, idx)=>{ - if(!c.hide){ - this.tabInfo.push({ - key: `${idx}`, - title: c.tabname, - }) + let data = { + "result": { + "tables": [ + { + "tabinfo": { + "rownum": "rownum", + "columns": [ + { + "com": [ + { + "key": "member", + "label": "", + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "quickSearch": false, + "type": "INPUT", + "viewAttr": 1, + "width": "80%" + } + ], + "dataIndex": "member", + "width": "80%%", + "title": "成员", + "key": "member" + }, + { + "com": [ + { + "key": "title", + "label": "", + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "quickSearch": false, + "type": "INPUT", + "viewAttr": 1, + "width": "80%" + } + ], + "dataIndex": "title", + "width": "80%%", + "title": "称谓", + "key": "title" + }, + { + "com": [ + { + "key": "company", + "label": "", + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "quickSearch": false, + "type": "INPUT", + "viewAttr": 1, + "width": "80%" + } + ], + "dataIndex": "company", + "width": "80%%", + "title": "工作单位", + "key": "company" + }, + { + "com": [ + { + "key": "jobtitle", + "label": "", + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "quickSearch": false, + "type": "INPUT", + "viewAttr": 1, + "width": "80%" + } + ], + "dataIndex": "jobtitle", + "width": "80%%", + "title": "职务", + "key": "jobtitle" + }, + { + "com": [ + { + "key": "address", + "label": "", + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "quickSearch": false, + "type": "INPUT", + "viewAttr": 1, + "width": "80%" + } + ], + "dataIndex": "address", + "width": "80%%", + "title": "地址", + "key": "address" + } + ], + "datas": [ + { + "address": "", + "jobtitle": "1", + "member": "1", + "company": "1", + "title": "1" + } + ] + }, + "hide": false, + "tabname": "家庭情况" } - }) - if(!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; + ], + "buttons": { + "hasSave": true, + "hasEdit": true + }, + "id": "22", + "conditions": [ + { + "hide": false, + "title": "个人信息", + "defaultshow": true, + "items": [ + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "DATEPICKER", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "birthday" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "出生日期", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "folk" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "民族", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "nativeplace" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "籍贯", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "regresidentplace" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "户口", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "certificatenum" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "身份证号码", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "SELECT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "maritalstatus" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "key": "0", + "label": "婚姻状况", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "options": [ + { + "disabled": false, + "key": "0", + "selected": true, + "showname": "未婚", + "visible": true + }, + { + "disabled": false, + "key": "1", + "selected": false, + "showname": "已婚", + "visible": true + }, + { + "disabled": false, + "key": "2", + "selected": false, + "showname": "离异", + "visible": true + } + ], + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "0", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "policy" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "政治面貌", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "DATEPICKER", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "bememberdate" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "入团日期", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "DATEPICKER", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "bepartydate" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "入党日期", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "SELECT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "islabouunion" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "key": "1", + "label": "工会会员", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "options": [ + { + "disabled": false, + "key": "1", + "selected": true, + "showname": "是", + "visible": true + }, + { + "disabled": false, + "key": "0", + "selected": false, + "showname": "否", + "visible": true + } + ], + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "1", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "browserConditionParam": { + "asynLoadAll": false, + "checkStrictly": true, + "completeParams": {}, + "conditionDataParams": {}, + "dataParams": {}, + "defaultCheckStrictly": true, + "defaultExpandedLevel": 0, + "destDataParams": {}, + "expandfirstnode": false, + "handleTypes": "", + "hasAddBtn": false, + "hasAdvanceSerach": true, + "hasBorder": false, + "hasTabConditions": false, + "hideAdvanceSearch": false, + "hideVirtualOrg": false, + "icon": "icon-coms-hrm", + "iconBgcolor": "#217346", + "idSeparator": ",", + "isAutoComplete": 1, + "isDetail": 0, + "isMultCheckbox": false, + "isSingle": true, + "linkUrl": "/spa/hrm/engine.html#/hrmengine/edu?id=", + "mobileLinkUrl": "", + "noOperate": true, + "otherParams": {}, + "pageSize": 10, + "quickSearchName": "", + "replaceDatas": [], + "replaceNotCtrl": false, + "scrollx": false, + "searchParams": {}, + "searchPlaceholder": "", + "showCheckStrictly": true, + "title": "学历", + "type": "30", + "viewAttr": 1 + }, + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "BROWSER", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "educationlevel" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "学历", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "degree" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "学位", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "SELECT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "healthinfo" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "key": "0", + "label": "健康状况", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "options": [ + { + "disabled": false, + "key": "0", + "selected": true, + "showname": "优秀", + "visible": true + }, + { + "disabled": false, + "key": "1", + "selected": false, + "showname": "良好", + "visible": true + }, + { + "disabled": false, + "key": "2", + "selected": false, + "showname": "一般", + "visible": true + }, + { + "disabled": false, + "key": "3", + "selected": false, + "showname": "较差", + "visible": true + } + ], + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "0", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUTNUMBER", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "height" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "身高(cm)", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "0", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUTNUMBER", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "weight" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "体重(kg)", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "0", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "residentplace" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "现居住地", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "homeaddress" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "家庭联系方式", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + }, + { + "belong": "PC", + "checkbox": false, + "checkboxValue": false, + "colSpan": 2, + "conditionType": "INPUT", + "dateGroup": false, + "defaultDisplayInBar": false, + "detailtype": 1, + "domkey": [ + "tempresidentnumber" + ], + "entSearch": false, + "fieldcol": 12, + "hasBorder": false, + "helpfulTipProps": {}, + "hide": false, + "isBase64": false, + "isQuickSearch": false, + "label": "暂住证号码", + "labelcol": 6, + "length": 0, + "maxFilesNumber": 0, + "maxUploadSize": 0, + "multiSelection": false, + "multiple": false, + "otherParams": { + "inputType": "multilang", + "isBase64": true + }, + "precision": 0, + "secretLimit": false, + "showOrder": 0, + "showTime": false, + "stringLength": 0, + "supportCancel": false, + "tipPosition": "bottom", + "value": "", + "valueList": [], + "viewAttr": 1 + } + ] + } + ], + "topTab": [ + { + "title": "总部信息", + "viewCondition": "1" + } + ] } - - setLoading(val) { - this.loading(false); } + // API.getResourceCard(params).then((data) => { + // this.loading = false; + // this.form.initFormFields(data.result.conditions); + // this.conditions = data.result.conditions; + // this.tableInfo = this.handleTable(data.result.tables); + // this.getTabInfo(); + // this.buttons = data.result.buttons; + // this.hrmId = data.result.id; + + // this.isEditor && this.getSelectedRows(); + // }) + this.loading = false; + this.form.initFormFields(data.result.conditions); + this.conditions = data.result.conditions; + this.tableInfo = this.handleTable(data.result.tables); + this.getTabInfo(); + this.buttons = data.result.buttons; + this.setTopTab(data.result.topTab); + + + } + + handleTable = (datas) => { + return datas && datas.map(data => { + const {tabinfo:{columns}} = data; + const length = columns.length; + columns.map(c => { + c.width = `${95/length}%` + }) + return data + }) + } + + getTabInfo = () => { + this.tabInfo = []; + this.tableInfo && this.tableInfo.forEach((c, idx) => { + if (!c.hide) { + this.tabInfo.push({ + key: `${idx}`, + title: c.tabname, + }) + } + }) + if (!isEmpty(this.tabInfo)) this.tabkey = this.tabInfo[0].key; + } + + setLoading(val) { + this.loading(false); + } + - updateDetailSelectedKey = (key) => { this.detailSelectedKey = key; } - updateSelectedKey = (key) => { + setSelectedKey = (key) => { this.selectedKey = key; } @@ -188,5 +1169,13 @@ export class CompanyExtendStore { } - + setTopTab (topTab) { + this.topTab = topTab; + } + + changeData(key) { + this.setSelectedKey(key); +} + + } diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js index f80c126..ed60974 100644 --- a/pc4mobx/organization/stores/index.js +++ b/pc4mobx/organization/stores/index.js @@ -6,6 +6,8 @@ import { JobGradeStore } from "./jobgrade"; import { OfficeManageStore } from "./officeManage"; import { SequenceStore } from "./sequence"; import { GroupStore } from "./group"; +import {CompanyExtendStore} from "./companyextend"; +import {CompanyStore} from "./company" module.exports = { simpleOrgStore: new SimpleOrgStore(), @@ -16,4 +18,6 @@ module.exports = { officeManageStore: new OfficeManageStore(), sequence: new SequenceStore(), group: new GroupStore(), + companyExtend: new CompanyExtendStore(), + company: new CompanyStore() }; diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index 15e7919..5c3fad6 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -29,4 +29,22 @@ padding-top: 28px; height: calc(100% - 47px); overflow: auto; +} + +//公司、分部管理 +.hrm-my-cardInfo { + padding-bottom: 20px; + background: #fff; + a { + color: #123885; + &:hover { + color: red; + } + } + + .hrm-center { + .ant-col-24 .wea-form-cell { + padding-left: 25%; + } + } } \ No newline at end of file