需求优化
This commit is contained in:
parent
4102c1e135
commit
ebf1cb58d9
|
|
@ -64,4 +64,8 @@ export const getTabInfo = (params) => {
|
||||||
|
|
||||||
export const getHasRight = (params) => {
|
export const getHasRight = (params) => {
|
||||||
return WeaTools.callApi('/api/bs/hrmorganization/grade/getHasRight', 'GET', params);
|
return WeaTools.callApi('/api/bs/hrmorganization/grade/getHasRight', 'GET', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getTree = (params) => {
|
||||||
|
return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTreeData', 'GET', params);
|
||||||
}
|
}
|
||||||
|
|
@ -65,4 +65,8 @@ export const getTabInfo = (params) => {
|
||||||
|
|
||||||
export const getHasRight = (params) => {
|
export const getHasRight = (params) => {
|
||||||
return WeaTools.callApi('/api/bs/hrmorganization/level/getTableBtn', 'GET', params);
|
return WeaTools.callApi('/api/bs/hrmorganization/level/getTableBtn', 'GET', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getTree = (params) => {
|
||||||
|
return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTreeData', 'GET', params);
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @Author: 程亮
|
* @Author: 程亮
|
||||||
* @Date: 2022-05-18 14:52:39
|
* @Date: 2022-05-18 14:52:39
|
||||||
* @LastEditTime: 2022-05-26 17:11:02
|
* @LastEditTime: 2022-06-22 16:37:43
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
|
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
|
||||||
*/
|
*/
|
||||||
|
|
@ -228,15 +228,7 @@ export default class CompanyExtend extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { companyExtend } = this.props;
|
const { companyExtend } = this.props;
|
||||||
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = companyExtend;
|
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey,isEditor } = companyExtend;
|
||||||
|
|
||||||
// if(!hasRight && !loading){
|
|
||||||
// return (
|
|
||||||
// <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@387kx5`}>
|
|
||||||
// <div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
|
||||||
// </WeaAlertPage>
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return (
|
return (
|
||||||
|
|
@ -246,6 +238,9 @@ export default class CompanyExtend extends React.Component {
|
||||||
>
|
>
|
||||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||||
loading={true}
|
loading={true}
|
||||||
|
title={isEditor ? i18n.label.updateCompany() : i18n.label.viewCompany()}
|
||||||
|
icon={<i className='icon-coms-hrm' />}
|
||||||
|
iconBgcolor='#217346'
|
||||||
buttons={this.getTopButtons()}
|
buttons={this.getTopButtons()}
|
||||||
showDropIcon={true}
|
showDropIcon={true}
|
||||||
dropMenuDatas={this.getRightMenu()}
|
dropMenuDatas={this.getRightMenu()}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @Author: 程亮
|
* @Author: 程亮
|
||||||
* @Date: 2022-05-18 16:23:32
|
* @Date: 2022-05-18 16:23:32
|
||||||
* @LastEditTime: 2022-06-22 10:08:54
|
* @LastEditTime: 2022-06-22 15:13:10
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
||||||
*/
|
*/
|
||||||
|
|
@ -121,7 +121,7 @@ export default class Company extends React.Component {
|
||||||
company
|
company
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
company.setNeDialogTitle(i18n.label.companyName());
|
company.setNeDialogTitle(i18n.label.newCompany());
|
||||||
company.setNewVisible(true);
|
company.setNewVisible(true);
|
||||||
company.getCompanyForm();
|
company.getCompanyForm();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @Author: 程亮
|
* @Author: 程亮
|
||||||
* @Date: 2022-06-02 09:19:37
|
* @Date: 2022-06-02 09:19:37
|
||||||
* @LastEditTime: 2022-06-22 10:10:28
|
* @LastEditTime: 2022-06-22 16:42:37
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js
|
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js
|
||||||
*/
|
*/
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
department
|
department
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
department.setNeDialogTitle(i18n.label.deptManage());
|
department.setNeDialogTitle(i18n.label.newDept());
|
||||||
department.setNewVisible(true);
|
department.setNewVisible(true);
|
||||||
department.getDeptForm();
|
department.getDeptForm();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,282 +1,284 @@
|
||||||
/**
|
/**
|
||||||
* @Author: 程亮
|
* @Author: 程亮
|
||||||
* @Date: 2022-06-02 09:20:03
|
* @Date: 2022-06-02 09:20:03
|
||||||
* @LastEditTime: 2022-06-02 11:40:57
|
* @LastEditTime: 2022-06-22 16:54:39
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js
|
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import { Button, Modal, message, Row, Col, Spin } from 'antd';
|
import { Button, Modal, message, Row, Col, Spin } from 'antd';
|
||||||
import isEmpty from 'lodash/isEmpty'
|
import isEmpty from 'lodash/isEmpty'
|
||||||
import cloneDeep from 'lodash/cloneDeep'
|
import cloneDeep from 'lodash/cloneDeep'
|
||||||
import forEach from 'lodash/forEach'
|
import forEach from 'lodash/forEach'
|
||||||
import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom'
|
import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop } from 'ecCom'
|
||||||
import { WeaSwitch } from 'comsMobx';
|
import { WeaSwitch } from 'comsMobx';
|
||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
import * as mobx from 'mobx';
|
import * as mobx from 'mobx';
|
||||||
import { i18n } from '../../public/i18n';
|
import { i18n } from '../../public/i18n';
|
||||||
|
|
||||||
const toJS = mobx.toJS;
|
const toJS = mobx.toJS;
|
||||||
import '../../style/common.less';
|
import '../../style/common.less';
|
||||||
|
|
||||||
|
|
||||||
@inject('departmentExtend')
|
@inject('departmentExtend')
|
||||||
@inject('department')
|
@inject('department')
|
||||||
@observer
|
@observer
|
||||||
export default class DepartmentExtendStore extends React.Component {
|
export default class DepartmentExtendStore extends React.Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
init = () => {
|
init = () => {
|
||||||
const { departmentExtend,department } = this.props;
|
const { departmentExtend, department } = this.props;
|
||||||
let {hash} = window.location;
|
let { hash } = window.location;
|
||||||
hash = hash.split("?")[0];
|
hash = hash.split("?")[0];
|
||||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||||
departmentExtend.init();
|
departmentExtend.init();
|
||||||
departmentExtend.setId(id);
|
departmentExtend.setId(id);
|
||||||
departmentExtend.getData();
|
departmentExtend.getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
getTabChildren = () => {
|
getTabChildren = () => {
|
||||||
const { departmentExtend } = this.props;
|
const { departmentExtend } = this.props;
|
||||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = departmentExtend;
|
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = departmentExtend;
|
||||||
let tabChildren = [];
|
let tabChildren = [];
|
||||||
tableInfo = toJS(tableInfo);
|
tableInfo = toJS(tableInfo);
|
||||||
tableInfo && tableInfo.map((t, i) => {
|
tableInfo && tableInfo.map((t, i) => {
|
||||||
if (detailSelectedKey == i) {
|
if (detailSelectedKey == i) {
|
||||||
tabChildren.push(
|
tabChildren.push(
|
||||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||||
ref={(ref)=>departmentExtend.setPersonalEditTables(ref)}
|
ref={(ref) => departmentExtend.setPersonalEditTables(ref)}
|
||||||
showTitle={isEditor}
|
showTitle={isEditor}
|
||||||
// title={'列表信息'}
|
// title={'列表信息'}
|
||||||
//addFirstRow={isEditor}
|
//addFirstRow={isEditor}
|
||||||
columns={t.tabinfo.columns}
|
columns={t.tabinfo.columns}
|
||||||
datas={t.tabinfo.datas}
|
datas={t.tabinfo.datas}
|
||||||
onChange={this.tableEditChange}
|
onChange={this.tableEditChange}
|
||||||
selectedRowKeys={toJS(selectedRowKeys)}
|
selectedRowKeys={toJS(selectedRowKeys)}
|
||||||
onRowSelect={keys => onRowSelect(keys)}
|
onRowSelect={keys => onRowSelect(keys)}
|
||||||
onBtnsSelect={key => this.onBtnsSelect(key, i)}
|
onBtnsSelect={key => this.onBtnsSelect(key, i)}
|
||||||
viewAttr={isEditor ? 2 : 1}
|
viewAttr={isEditor ? 2 : 1}
|
||||||
getRowSelection={isEditor ? (rowSelection) => {
|
getRowSelection={isEditor ? (rowSelection) => {
|
||||||
Object.assign(rowSelection, {
|
Object.assign(rowSelection, {
|
||||||
getCheckboxProps: record => ({
|
getCheckboxProps: record => ({
|
||||||
disabled: record.viewAttr === 1, // 配置无法勾选的列
|
disabled: record.viewAttr === 1, // 配置无法勾选的列
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return rowSelection;
|
return rowSelection;
|
||||||
} : () => null}
|
} : () => null}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return tabChildren;
|
return tabChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
onBtnsSelect = (key, index) => {
|
onBtnsSelect = (key, index) => {
|
||||||
const {
|
const {
|
||||||
departmentExtend
|
departmentExtend
|
||||||
} = this.props, {
|
} = this.props, {
|
||||||
tableInfo,
|
tableInfo,
|
||||||
selectedRows,
|
selectedRows,
|
||||||
setSelectedRowKeys,
|
setSelectedRowKeys,
|
||||||
selectedRowKeys
|
selectedRowKeys
|
||||||
} = departmentExtend;
|
} = departmentExtend;
|
||||||
|
|
||||||
const datas = tableInfo[index].tabinfo.datas;
|
const datas = tableInfo[index].tabinfo.datas;
|
||||||
if (key === 'copy') {
|
if (key === 'copy') {
|
||||||
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
||||||
if (!selectedRows[index].includes(i)) {
|
if (!selectedRows[index].includes(i)) {
|
||||||
data.viewAttr = 2;
|
data.viewAttr = 2;
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (key === 'delete') {
|
if (key === 'delete') {
|
||||||
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
||||||
if (selectedRows[index].includes(i)) {
|
if (selectedRows[index].includes(i)) {
|
||||||
data.viewAttr = 1;
|
data.viewAttr = 1;
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
});
|
});
|
||||||
setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row)))
|
setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getSearchs = () => {
|
getSearchs = () => {
|
||||||
const { departmentExtend } = this.props;
|
const { departmentExtend } = this.props;
|
||||||
let { form, conditions, isEditor } = departmentExtend;
|
let { form, conditions, isEditor } = departmentExtend;
|
||||||
const { isFormInit } = form;
|
const { isFormInit } = form;
|
||||||
let group = [];
|
let group = [];
|
||||||
let tipPosition = 'bottom';
|
let tipPosition = 'bottom';
|
||||||
window.e9HideFormFieldKeys = [];
|
window.e9HideFormFieldKeys = [];
|
||||||
isFormInit && conditions.forEach((c, i) => {
|
isFormInit && conditions.forEach((c, i) => {
|
||||||
let items = [];
|
let items = [];
|
||||||
c.items.forEach((field, j) => {
|
c.items.forEach((field, j) => {
|
||||||
if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) {
|
if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) {
|
||||||
window.e9HideFormFieldKeys.push(field.domkey[0]);
|
window.e9HideFormFieldKeys.push(field.domkey[0]);
|
||||||
} else {
|
} else {
|
||||||
items.push({
|
items.push({
|
||||||
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
||||||
underline={!isEditor}
|
underline={!isEditor}
|
||||||
label={`${field.label}`}
|
label={`${field.label}`}
|
||||||
error={form.getError(field)}
|
error={form.getError(field)}
|
||||||
tipPosition={tipPosition}
|
tipPosition={tipPosition}
|
||||||
labelCol={{ span: `${field.labelcol}` }}
|
labelCol={{ span: `${field.labelcol}` }}
|
||||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||||
</WeaFormItem>),
|
</WeaFormItem>),
|
||||||
colSpan: 1
|
colSpan: 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@x9hby9@${i}`} className={`${isEditor ? 'hrm-center' : ''}`}
|
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@x9hby9@${i}`} className={`${isEditor ? 'hrm-center' : ''}`}
|
||||||
needTigger={true} hide={c.hide} title={c.title} showGroup={c.defaultshow} items={items} col={2} />)
|
needTigger={true} hide={c.hide} title={c.title} showGroup={c.defaultshow} items={items} col={2} />)
|
||||||
});
|
});
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
tableEditChange = (data) => {
|
tableEditChange = (data) => {
|
||||||
const { departmentExtend } = this.props;
|
const { departmentExtend } = this.props;
|
||||||
let { detailSelectedKey = '0', tableInfo } = departmentExtend;
|
let { detailSelectedKey = '0', tableInfo } = departmentExtend;
|
||||||
tableInfo = toJS(tableInfo);
|
tableInfo = toJS(tableInfo);
|
||||||
let d = cloneDeep(tableInfo);
|
let d = cloneDeep(tableInfo);
|
||||||
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
||||||
departmentExtend.updateTableInfo(d);
|
departmentExtend.updateTableInfo(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRightMenu = () => {
|
getRightMenu = () => {
|
||||||
const { departmentExtend } = this.props;
|
const { departmentExtend } = this.props;
|
||||||
const { isEditor, buttons } = departmentExtend;
|
const { isEditor, buttons } = departmentExtend;
|
||||||
let arr = [];
|
let arr = [];
|
||||||
try {
|
|
||||||
if (buttons.hasEdit) {
|
|
||||||
if (isEditor) {
|
|
||||||
arr = [{
|
|
||||||
icon: <i className='icon-coms-common' />,
|
|
||||||
content: i18n.button.save(),
|
|
||||||
key: 'save',
|
|
||||||
onClick: key => {
|
|
||||||
this.saveEditCard();
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
icon: <i className='icon-coms-go-back' />,
|
|
||||||
content: i18n.button.back(),
|
|
||||||
key: 'back',
|
|
||||||
onClick: key => {
|
|
||||||
this.backCard();
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
} else {
|
|
||||||
arr = [{
|
|
||||||
icon: <i className='icon-coms-edit' />,
|
|
||||||
content: i18n.button.modify(),
|
|
||||||
key: 'editCard',
|
|
||||||
onClick: key => {
|
|
||||||
this.editCard();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) { }
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
getTopButtons = () => {
|
|
||||||
const { departmentExtend } = this.props;
|
|
||||||
const { isEditor, buttons } = departmentExtend;
|
|
||||||
const save = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pkes6y`} type="primary" onClick={this.saveEditCard} >{i18n.button.save()}</Button>;
|
|
||||||
const back = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pl1fw8`} type="primary" onClick={this.backCard} >{i18n.button.back()}</Button>;
|
|
||||||
const edit = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.editCard} >{i18n.button.modify()}</Button>;
|
|
||||||
const btns = [];
|
|
||||||
try {
|
|
||||||
if (isEditor) {
|
|
||||||
if (buttons.hasSave) {
|
|
||||||
btns.push(save);
|
|
||||||
btns.push(back);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (buttons.hasEdit) {
|
|
||||||
btns.push(edit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) { }
|
|
||||||
return btns;
|
|
||||||
}
|
|
||||||
|
|
||||||
editCard = () => {
|
|
||||||
const { departmentExtend } = this.props;
|
|
||||||
departmentExtend.edit();
|
|
||||||
}
|
|
||||||
|
|
||||||
saveEditCard = () => {
|
|
||||||
const { departmentExtend } = this.props;
|
|
||||||
departmentExtend.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
backCard = () => {
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
changeData(key) {
|
|
||||||
const {
|
|
||||||
departmentExtend
|
|
||||||
} = this.props;
|
|
||||||
departmentExtend.changeData(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { departmentExtend } = this.props;
|
|
||||||
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = departmentExtend;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return (
|
if (buttons.hasEdit) {
|
||||||
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
if (isEditor) {
|
||||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
arr = [{
|
||||||
datas={this.getRightMenu()}
|
icon: <i className='icon-coms-common' />,
|
||||||
>
|
content: i18n.button.save(),
|
||||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
key: 'save',
|
||||||
loading={true}
|
onClick: key => {
|
||||||
buttons={this.getTopButtons()}
|
this.saveEditCard();
|
||||||
showDropIcon={true}
|
}
|
||||||
dropMenuDatas={this.getRightMenu()}
|
}, {
|
||||||
>
|
icon: <i className='icon-coms-go-back' />,
|
||||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
content: i18n.button.back(),
|
||||||
datas={topTab}
|
key: 'back',
|
||||||
keyParam="viewCondition" //主键
|
onClick: key => {
|
||||||
selectedKey={selectedKey}
|
this.backCard();
|
||||||
onChange={this.changeData.bind(this)}
|
}
|
||||||
/>
|
}]
|
||||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
} else {
|
||||||
{this.getSearchs()}
|
arr = [{
|
||||||
{
|
icon: <i className='icon-coms-edit' />,
|
||||||
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
content: i18n.button.modify(),
|
||||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
key: 'editCard',
|
||||||
type='card'
|
onClick: key => {
|
||||||
keyParam='key'
|
this.editCard();
|
||||||
datas={toJS(tabInfo)}
|
}
|
||||||
selectedKey={detailSelectedKey}
|
}
|
||||||
onChange={v => {
|
]
|
||||||
departmentExtend.updateDetailSelectedKey(v);
|
}
|
||||||
}}
|
}
|
||||||
/>
|
} catch (e) { }
|
||||||
{this.getTabChildren()}
|
return arr;
|
||||||
</div>
|
}
|
||||||
}
|
|
||||||
</Spin>
|
getTopButtons = () => {
|
||||||
</WeaTop>
|
const { departmentExtend } = this.props;
|
||||||
</WeaRightMenu>
|
const { isEditor, buttons } = departmentExtend;
|
||||||
|
const save = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pkes6y`} type="primary" onClick={this.saveEditCard} >{i18n.button.save()}</Button>;
|
||||||
</div>
|
const back = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pl1fw8`} type="primary" onClick={this.backCard} >{i18n.button.back()}</Button>;
|
||||||
)
|
const edit = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.editCard} >{i18n.button.modify()}</Button>;
|
||||||
} catch (e) {
|
const btns = [];
|
||||||
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
try {
|
||||||
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
if (isEditor) {
|
||||||
</WeaAlertPage>
|
if (buttons.hasSave) {
|
||||||
}
|
btns.push(save);
|
||||||
}
|
btns.push(back);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (buttons.hasEdit) {
|
||||||
|
btns.push(edit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) { }
|
||||||
|
return btns;
|
||||||
|
}
|
||||||
|
|
||||||
|
editCard = () => {
|
||||||
|
const { departmentExtend } = this.props;
|
||||||
|
departmentExtend.edit();
|
||||||
|
}
|
||||||
|
|
||||||
|
saveEditCard = () => {
|
||||||
|
const { departmentExtend } = this.props;
|
||||||
|
departmentExtend.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
backCard = () => {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeData(key) {
|
||||||
|
const {
|
||||||
|
departmentExtend
|
||||||
|
} = this.props;
|
||||||
|
departmentExtend.changeData(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { departmentExtend } = this.props;
|
||||||
|
const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey,isEditor } = departmentExtend;
|
||||||
|
|
||||||
|
try {
|
||||||
|
return (
|
||||||
|
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
||||||
|
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||||
|
datas={this.getRightMenu()}
|
||||||
|
>
|
||||||
|
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||||
|
loading={true}
|
||||||
|
title={isEditor ? i18n.label.editDept() : i18n.label.departmentInfo()}
|
||||||
|
icon={<i className='icon-coms-hrm' />}
|
||||||
|
iconBgcolor='#217346'
|
||||||
|
buttons={this.getTopButtons()}
|
||||||
|
showDropIcon={true}
|
||||||
|
dropMenuDatas={this.getRightMenu()}
|
||||||
|
>
|
||||||
|
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||||
|
datas={topTab}
|
||||||
|
keyParam="viewCondition" //主键
|
||||||
|
selectedKey={selectedKey}
|
||||||
|
onChange={this.changeData.bind(this)}
|
||||||
|
/>
|
||||||
|
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
||||||
|
{this.getSearchs()}
|
||||||
|
{
|
||||||
|
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
||||||
|
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
||||||
|
type='card'
|
||||||
|
keyParam='key'
|
||||||
|
datas={toJS(tabInfo)}
|
||||||
|
selectedKey={detailSelectedKey}
|
||||||
|
onChange={v => {
|
||||||
|
departmentExtend.updateDetailSelectedKey(v);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{this.getTabChildren()}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</Spin>
|
||||||
|
</WeaTop>
|
||||||
|
</WeaRightMenu>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
||||||
|
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||||
|
</WeaAlertPage>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @Author: 程亮
|
* @Author: 程亮
|
||||||
* @Date: 2022-05-26 14:05:59
|
* @Date: 2022-05-26 14:05:59
|
||||||
* @LastEditTime: 2022-06-22 10:10:58
|
* @LastEditTime: 2022-06-22 16:43:08
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js
|
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js
|
||||||
*/
|
*/
|
||||||
|
|
@ -126,7 +126,7 @@ export default class Job extends React.Component {
|
||||||
job
|
job
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
job.setNeDialogTitle(i18n.label.jobName());
|
job.setNeDialogTitle(i18n.label.newJob());
|
||||||
job.setNewVisible(true);
|
job.setNewVisible(true);
|
||||||
job.getJobForm();
|
job.getJobForm();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,289 +1,284 @@
|
||||||
/**
|
/**
|
||||||
* @Author: 程亮
|
* @Author: 程亮
|
||||||
* @Date: 2022-05-26 14:07:12
|
* @Date: 2022-05-26 14:07:12
|
||||||
* @LastEditTime: 2022-05-30 17:16:47
|
* @LastEditTime: 2022-06-22 17:01:11
|
||||||
* @Description:
|
* @Description:
|
||||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js
|
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Button, Modal, message, Row, Col, Spin } from 'antd';
|
import { Button, Modal, message, Row, Col, Spin } from 'antd';
|
||||||
import isEmpty from 'lodash/isEmpty'
|
import isEmpty from 'lodash/isEmpty'
|
||||||
import cloneDeep from 'lodash/cloneDeep'
|
import cloneDeep from 'lodash/cloneDeep'
|
||||||
import forEach from 'lodash/forEach'
|
import forEach from 'lodash/forEach'
|
||||||
import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom'
|
import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop } from 'ecCom'
|
||||||
import { WeaSwitch } from 'comsMobx';
|
import { WeaSwitch } from 'comsMobx';
|
||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
import * as mobx from 'mobx';
|
import * as mobx from 'mobx';
|
||||||
import { i18n } from '../../public/i18n';
|
import { i18n } from '../../public/i18n';
|
||||||
|
|
||||||
const toJS = mobx.toJS;
|
const toJS = mobx.toJS;
|
||||||
import '../../style/common.less';
|
import '../../style/common.less';
|
||||||
|
|
||||||
|
|
||||||
@inject('jobExtend')
|
@inject('jobExtend')
|
||||||
@inject('job')
|
@inject('job')
|
||||||
@observer
|
@observer
|
||||||
export default class JobExtend extends React.Component {
|
export default class JobExtend extends React.Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
init = () => {
|
init = () => {
|
||||||
const { jobExtend,job } = this.props;
|
const { jobExtend, job } = this.props;
|
||||||
let {hash} = window.location;
|
let { hash } = window.location;
|
||||||
hash = hash.split("?")[0];
|
hash = hash.split("?")[0];
|
||||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||||
jobExtend.init();
|
jobExtend.init();
|
||||||
jobExtend.setId(id);
|
jobExtend.setId(id);
|
||||||
jobExtend.getData();
|
jobExtend.getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
getTabChildren = () => {
|
getTabChildren = () => {
|
||||||
const { jobExtend } = this.props;
|
const { jobExtend } = this.props;
|
||||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = jobExtend;
|
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = jobExtend;
|
||||||
let tabChildren = [];
|
let tabChildren = [];
|
||||||
tableInfo = toJS(tableInfo);
|
tableInfo = toJS(tableInfo);
|
||||||
tableInfo && tableInfo.map((t, i) => {
|
tableInfo && tableInfo.map((t, i) => {
|
||||||
if (detailSelectedKey == i) {
|
if (detailSelectedKey == i) {
|
||||||
tabChildren.push(
|
tabChildren.push(
|
||||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||||
ref={(ref)=>jobExtend.setPersonalEditTables(ref)}
|
ref={(ref) => jobExtend.setPersonalEditTables(ref)}
|
||||||
showTitle={isEditor}
|
showTitle={isEditor}
|
||||||
// title={'列表信息'}
|
// title={'列表信息'}
|
||||||
//addFirstRow={isEditor}
|
//addFirstRow={isEditor}
|
||||||
columns={t.tabinfo.columns}
|
columns={t.tabinfo.columns}
|
||||||
datas={t.tabinfo.datas}
|
datas={t.tabinfo.datas}
|
||||||
onChange={this.tableEditChange}
|
onChange={this.tableEditChange}
|
||||||
selectedRowKeys={toJS(selectedRowKeys)}
|
selectedRowKeys={toJS(selectedRowKeys)}
|
||||||
onRowSelect={keys => onRowSelect(keys)}
|
onRowSelect={keys => onRowSelect(keys)}
|
||||||
onBtnsSelect={key => this.onBtnsSelect(key, i)}
|
onBtnsSelect={key => this.onBtnsSelect(key, i)}
|
||||||
viewAttr={isEditor ? 2 : 1}
|
viewAttr={isEditor ? 2 : 1}
|
||||||
getRowSelection={isEditor ? (rowSelection) => {
|
getRowSelection={isEditor ? (rowSelection) => {
|
||||||
Object.assign(rowSelection, {
|
Object.assign(rowSelection, {
|
||||||
getCheckboxProps: record => ({
|
getCheckboxProps: record => ({
|
||||||
disabled: record.viewAttr === 1, // 配置无法勾选的列
|
disabled: record.viewAttr === 1, // 配置无法勾选的列
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return rowSelection;
|
return rowSelection;
|
||||||
} : () => null}
|
} : () => null}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return tabChildren;
|
return tabChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
onBtnsSelect = (key, index) => {
|
onBtnsSelect = (key, index) => {
|
||||||
const {
|
const {
|
||||||
jobExtend
|
jobExtend
|
||||||
} = this.props, {
|
} = this.props, {
|
||||||
tableInfo,
|
tableInfo,
|
||||||
selectedRows,
|
selectedRows,
|
||||||
setSelectedRowKeys,
|
setSelectedRowKeys,
|
||||||
selectedRowKeys
|
selectedRowKeys
|
||||||
} = jobExtend;
|
} = jobExtend;
|
||||||
|
|
||||||
const datas = tableInfo[index].tabinfo.datas;
|
const datas = tableInfo[index].tabinfo.datas;
|
||||||
if (key === 'copy') {
|
if (key === 'copy') {
|
||||||
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
||||||
if (!selectedRows[index].includes(i)) {
|
if (!selectedRows[index].includes(i)) {
|
||||||
data.viewAttr = 2;
|
data.viewAttr = 2;
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (key === 'delete') {
|
if (key === 'delete') {
|
||||||
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
tableInfo[index].tabinfo.datas = datas.map((data, i) => {
|
||||||
if (selectedRows[index].includes(i)) {
|
if (selectedRows[index].includes(i)) {
|
||||||
data.viewAttr = 1;
|
data.viewAttr = 1;
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
});
|
});
|
||||||
setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row)))
|
setSelectedRowKeys(selectedRowKeys.filter(row => !selectedRows[index].includes(row)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getSearchs = () => {
|
getSearchs = () => {
|
||||||
const { jobExtend } = this.props;
|
const { jobExtend } = this.props;
|
||||||
let { form, conditions, isEditor } = jobExtend;
|
let { form, conditions, isEditor } = jobExtend;
|
||||||
const { isFormInit } = form;
|
const { isFormInit } = form;
|
||||||
let group = [];
|
let group = [];
|
||||||
let tipPosition = 'bottom';
|
let tipPosition = 'bottom';
|
||||||
window.e9HideFormFieldKeys = [];
|
window.e9HideFormFieldKeys = [];
|
||||||
isFormInit && conditions.forEach((c, i) => {
|
isFormInit && conditions.forEach((c, i) => {
|
||||||
let items = [];
|
let items = [];
|
||||||
c.items.forEach((field, j) => {
|
c.items.forEach((field, j) => {
|
||||||
if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) {
|
if (c.hide || (!isEmpty(field.otherParams) && field.otherParams.hide)) {
|
||||||
window.e9HideFormFieldKeys.push(field.domkey[0]);
|
window.e9HideFormFieldKeys.push(field.domkey[0]);
|
||||||
} else {
|
} else {
|
||||||
items.push({
|
items.push({
|
||||||
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
||||||
underline={!isEditor}
|
underline={!isEditor}
|
||||||
label={`${field.label}`}
|
label={`${field.label}`}
|
||||||
error={form.getError(field)}
|
error={form.getError(field)}
|
||||||
tipPosition={tipPosition}
|
tipPosition={tipPosition}
|
||||||
labelCol={{ span: `${field.labelcol}` }}
|
labelCol={{ span: `${field.labelcol}` }}
|
||||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||||
</WeaFormItem>),
|
</WeaFormItem>),
|
||||||
colSpan: 1
|
colSpan: 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@x9hby9@${i}`} className={`${isEditor ? 'hrm-center' : ''}`}
|
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@x9hby9@${i}`} className={`${isEditor ? 'hrm-center' : ''}`}
|
||||||
needTigger={true} hide={c.hide} title={c.title} showGroup={c.defaultshow} items={items} col={2} />)
|
needTigger={true} hide={c.hide} title={c.title} showGroup={c.defaultshow} items={items} col={2} />)
|
||||||
});
|
});
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
tableEditChange = (data) => {
|
tableEditChange = (data) => {
|
||||||
const { jobExtend } = this.props;
|
const { jobExtend } = this.props;
|
||||||
let { detailSelectedKey = '0', tableInfo } = jobExtend;
|
let { detailSelectedKey = '0', tableInfo } = jobExtend;
|
||||||
tableInfo = toJS(tableInfo);
|
tableInfo = toJS(tableInfo);
|
||||||
let d = cloneDeep(tableInfo);
|
let d = cloneDeep(tableInfo);
|
||||||
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
||||||
jobExtend.updateTableInfo(d);
|
jobExtend.updateTableInfo(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRightMenu = () => {
|
getRightMenu = () => {
|
||||||
const { jobExtend } = this.props;
|
const { jobExtend } = this.props;
|
||||||
const { isEditor, buttons } = jobExtend;
|
const { isEditor, buttons } = jobExtend;
|
||||||
let arr = [];
|
let arr = [];
|
||||||
try {
|
|
||||||
if (buttons.hasEdit) {
|
|
||||||
if (isEditor) {
|
|
||||||
arr = [{
|
|
||||||
icon: <i className='icon-coms-common' />,
|
|
||||||
content: i18n.button.save(),
|
|
||||||
key: 'save',
|
|
||||||
onClick: key => {
|
|
||||||
this.saveEditCard();
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
icon: <i className='icon-coms-go-back' />,
|
|
||||||
content: i18n.button.back(),
|
|
||||||
key: 'back',
|
|
||||||
onClick: key => {
|
|
||||||
this.backCard();
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
} else {
|
|
||||||
arr = [{
|
|
||||||
icon: <i className='icon-coms-edit' />,
|
|
||||||
content: i18n.button.modify(),
|
|
||||||
key: 'editCard',
|
|
||||||
onClick: key => {
|
|
||||||
this.editCard();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) { }
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
getTopButtons = () => {
|
|
||||||
const { jobExtend } = this.props;
|
|
||||||
const { isEditor, buttons } = jobExtend;
|
|
||||||
const save = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pkes6y`} type="primary" onClick={this.saveEditCard} >{i18n.button.save()}</Button>;
|
|
||||||
const back = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pl1fw8`} type="primary" onClick={this.backCard} >{i18n.button.back()}</Button>;
|
|
||||||
const edit = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.editCard} >{i18n.button.modify()}</Button>;
|
|
||||||
const btns = [];
|
|
||||||
try {
|
|
||||||
if (isEditor) {
|
|
||||||
if (buttons.hasSave) {
|
|
||||||
btns.push(save);
|
|
||||||
btns.push(back);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (buttons.hasEdit) {
|
|
||||||
btns.push(edit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) { }
|
|
||||||
return btns;
|
|
||||||
}
|
|
||||||
|
|
||||||
editCard = () => {
|
|
||||||
const { jobExtend } = this.props;
|
|
||||||
jobExtend.edit();
|
|
||||||
}
|
|
||||||
|
|
||||||
saveEditCard = () => {
|
|
||||||
const { jobExtend } = this.props;
|
|
||||||
jobExtend.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
backCard = () => {
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
changeData(key) {
|
|
||||||
const {
|
|
||||||
jobExtend
|
|
||||||
} = this.props;
|
|
||||||
jobExtend.changeData(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { jobExtend } = this.props;
|
|
||||||
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = jobExtend;
|
|
||||||
|
|
||||||
// if(!hasRight && !loading){
|
|
||||||
// return (
|
|
||||||
// <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@387kx5`}>
|
|
||||||
// <div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
|
||||||
// </WeaAlertPage>
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return (
|
if (buttons.hasEdit) {
|
||||||
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
if (isEditor) {
|
||||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
arr = [{
|
||||||
datas={this.getRightMenu()}
|
icon: <i className='icon-coms-common' />,
|
||||||
>
|
content: i18n.button.save(),
|
||||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
key: 'save',
|
||||||
loading={true}
|
onClick: key => {
|
||||||
buttons={this.getTopButtons()}
|
this.saveEditCard();
|
||||||
showDropIcon={true}
|
}
|
||||||
dropMenuDatas={this.getRightMenu()}
|
}, {
|
||||||
>
|
icon: <i className='icon-coms-go-back' />,
|
||||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
content: i18n.button.back(),
|
||||||
datas={topTab}
|
key: 'back',
|
||||||
keyParam="viewCondition" //主键
|
onClick: key => {
|
||||||
selectedKey={selectedKey}
|
this.backCard();
|
||||||
onChange={this.changeData.bind(this)}
|
}
|
||||||
/>
|
}]
|
||||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
} else {
|
||||||
{this.getSearchs()}
|
arr = [{
|
||||||
{
|
icon: <i className='icon-coms-edit' />,
|
||||||
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
content: i18n.button.modify(),
|
||||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
key: 'editCard',
|
||||||
type='card'
|
onClick: key => {
|
||||||
keyParam='key'
|
this.editCard();
|
||||||
datas={toJS(tabInfo)}
|
}
|
||||||
selectedKey={detailSelectedKey}
|
}
|
||||||
onChange={v => {
|
]
|
||||||
jobExtend.updateDetailSelectedKey(v);
|
}
|
||||||
}}
|
}
|
||||||
/>
|
} catch (e) { }
|
||||||
{this.getTabChildren()}
|
return arr;
|
||||||
</div>
|
}
|
||||||
}
|
|
||||||
</Spin>
|
getTopButtons = () => {
|
||||||
</WeaTop>
|
const { jobExtend } = this.props;
|
||||||
</WeaRightMenu>
|
const { isEditor, buttons } = jobExtend;
|
||||||
|
const save = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pkes6y`} type="primary" onClick={this.saveEditCard} >{i18n.button.save()}</Button>;
|
||||||
</div>
|
const back = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pl1fw8`} type="primary" onClick={this.backCard} >{i18n.button.back()}</Button>;
|
||||||
)
|
const edit = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.editCard} >{i18n.button.modify()}</Button>;
|
||||||
} catch (e) {
|
const btns = [];
|
||||||
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
try {
|
||||||
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
if (isEditor) {
|
||||||
</WeaAlertPage>
|
if (buttons.hasSave) {
|
||||||
}
|
btns.push(save);
|
||||||
}
|
btns.push(back);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (buttons.hasEdit) {
|
||||||
|
btns.push(edit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) { }
|
||||||
|
return btns;
|
||||||
|
}
|
||||||
|
|
||||||
|
editCard = () => {
|
||||||
|
const { jobExtend } = this.props;
|
||||||
|
jobExtend.edit();
|
||||||
|
}
|
||||||
|
|
||||||
|
saveEditCard = () => {
|
||||||
|
const { jobExtend } = this.props;
|
||||||
|
jobExtend.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
backCard = () => {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeData(key) {
|
||||||
|
const {
|
||||||
|
jobExtend
|
||||||
|
} = this.props;
|
||||||
|
jobExtend.changeData(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { jobExtend } = this.props;
|
||||||
|
const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey,isEditor } = jobExtend;
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
return (
|
||||||
|
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
||||||
|
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||||
|
datas={this.getRightMenu()}
|
||||||
|
>
|
||||||
|
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||||
|
loading={true}
|
||||||
|
title={isEditor ? i18n.label.editJobInfo() : i18n.label.jobInfo()}
|
||||||
|
icon={<i className='icon-coms-hrm' />}
|
||||||
|
iconBgcolor='#217346'
|
||||||
|
buttons={this.getTopButtons()}
|
||||||
|
showDropIcon={true}
|
||||||
|
dropMenuDatas={this.getRightMenu()}
|
||||||
|
>
|
||||||
|
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||||
|
datas={topTab}
|
||||||
|
keyParam="viewCondition" //主键
|
||||||
|
selectedKey={selectedKey}
|
||||||
|
onChange={this.changeData.bind(this)}
|
||||||
|
/>
|
||||||
|
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
||||||
|
{this.getSearchs()}
|
||||||
|
{
|
||||||
|
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
||||||
|
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
||||||
|
type='card'
|
||||||
|
keyParam='key'
|
||||||
|
datas={toJS(tabInfo)}
|
||||||
|
selectedKey={detailSelectedKey}
|
||||||
|
onChange={v => {
|
||||||
|
jobExtend.updateDetailSelectedKey(v);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{this.getTabChildren()}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</Spin>
|
||||||
|
</WeaTop>
|
||||||
|
</WeaRightMenu>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
||||||
|
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||||
|
</WeaAlertPage>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import {
|
||||||
WeaTab,
|
WeaTab,
|
||||||
WeaFormItem,
|
WeaFormItem,
|
||||||
WeaRightMenu,
|
WeaRightMenu,
|
||||||
|
WeaLeftRightLayout,
|
||||||
|
WeaLeftTree
|
||||||
} from 'ecCom'
|
} from 'ecCom'
|
||||||
import {
|
import {
|
||||||
Row,
|
Row,
|
||||||
|
|
@ -67,10 +69,10 @@ export default class JobGrade extends React.Component {
|
||||||
const {
|
const {
|
||||||
jobGrade
|
jobGrade
|
||||||
} = this.props;
|
} = this.props;
|
||||||
jobGrade.getTableInfo();
|
|
||||||
jobGrade.getHasRight();
|
jobGrade.getHasRight();
|
||||||
|
jobGrade.initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getTopMenuBtns() {
|
getTopMenuBtns() {
|
||||||
const {
|
const {
|
||||||
|
|
@ -117,7 +119,7 @@ export default class JobGrade extends React.Component {
|
||||||
jobGrade.getForm();
|
jobGrade.getForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
custom = () => {
|
custom = () => {
|
||||||
const {
|
const {
|
||||||
jobGrade
|
jobGrade
|
||||||
|
|
@ -240,14 +242,14 @@ export default class JobGrade extends React.Component {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
columns.forEach((c, index) => {
|
columns.forEach((c, index) => {
|
||||||
if (c.dataIndex == 'forbidden_tag') {
|
if (c.dataIndex == 'forbidden_tag') {
|
||||||
c.render = function(text, record) {
|
c.render = function (text, record) {
|
||||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked,record.id)} />
|
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
updateForbiddenTag(checked,id) {
|
updateForbiddenTag(checked, id) {
|
||||||
const {
|
const {
|
||||||
jobGrade
|
jobGrade
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
@ -278,7 +280,7 @@ export default class JobGrade extends React.Component {
|
||||||
const {
|
const {
|
||||||
jobGrade
|
jobGrade
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
jobGrade.setNeDialogTitle(i18n.label.editJobGrade());
|
jobGrade.setNeDialogTitle(i18n.label.editJobGrade());
|
||||||
jobGrade.setGradeId(id);
|
jobGrade.setGradeId(id);
|
||||||
jobGrade.setIsNew(false);
|
jobGrade.setIsNew(false);
|
||||||
|
|
@ -325,29 +327,29 @@ export default class JobGrade extends React.Component {
|
||||||
|
|
||||||
isFormInit && searchCondition.map(c => {
|
isFormInit && searchCondition.map(c => {
|
||||||
c.items.map((field, index) => {
|
c.items.map((field, index) => {
|
||||||
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} span={(index%2 == 0) ? 10 : 11} offset={1}>
|
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} span={(index % 2 == 0) ? 10 : 11} offset={1}>
|
||||||
<div style={{marginTop: 20}}>
|
<div style={{ marginTop: 20 }}>
|
||||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
||||||
label={`${field.label}`}
|
label={`${field.label}`}
|
||||||
labelCol={{span: `${field.labelcol}`}}
|
labelCol={{ span: `${field.labelcol}` }}
|
||||||
wrapperCol={{span: `${field.fieldcol}`}}>
|
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
|
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
|
||||||
</WeaFormItem>
|
</WeaFormItem>
|
||||||
</div>
|
</div>
|
||||||
</Col>)
|
</Col>)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
if (searchConditionLoading) {
|
if (searchConditionLoading) {
|
||||||
return (
|
return (
|
||||||
<div className='hrm-loading-center-small' style={{top:'25%'}}>
|
<div className='hrm-loading-center-small' style={{ top: '25%' }}>
|
||||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@lbktzb`} spinning={searchConditionLoading}></Spin>
|
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@lbktzb`} spinning={searchConditionLoading}></Spin>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => {
|
return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => {
|
||||||
if ( e.keyCode == 13 && e.target.tagName === "INPUT") {
|
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
|
||||||
jobGrade.getTableInfo();
|
jobGrade.getTableInfo();
|
||||||
jobGrade.setPanelStatus(false)
|
jobGrade.setPanelStatus(false)
|
||||||
}
|
}
|
||||||
}}>{arr}</Row>
|
}}>{arr}</Row>
|
||||||
|
|
@ -371,14 +373,32 @@ export default class JobGrade extends React.Component {
|
||||||
jobGrade
|
jobGrade
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
isPanelShow, form2, gradeName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date,hasRight
|
form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight, treeConfig, treeLoading
|
||||||
} = jobGrade;
|
} = jobGrade;
|
||||||
|
|
||||||
if (hasRight === false) {
|
if (hasRight === false) {
|
||||||
return renderNoright();
|
return renderNoright();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
data,
|
||||||
|
onSelectedTreeNode,
|
||||||
|
selectedKeys,
|
||||||
|
onExpand,
|
||||||
|
treeExpandKeys
|
||||||
|
} = toJS(treeConfig);
|
||||||
|
const treeCom = (
|
||||||
|
<WeaLeftTree ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftTree@ifgbi1`}
|
||||||
|
datas={data}
|
||||||
|
searchLabel={"等级方案"}
|
||||||
|
onSelect={onSelectedTreeNode}
|
||||||
|
selectedKeys={selectedKeys}
|
||||||
|
onExpand={onExpand}
|
||||||
|
loading={treeLoading}
|
||||||
|
expandedKeys={treeExpandKeys} />
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
hasRight && <div ref='page' style={{ height: '100%' }}>
|
hasRight && <div ref='page' style={{ height: '100%' }}>
|
||||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||||
|
|
@ -395,35 +415,37 @@ export default class JobGrade extends React.Component {
|
||||||
dropMenuDatas={this.getDropMenuDatas()}
|
dropMenuDatas={this.getDropMenuDatas()}
|
||||||
onDropMenuClick={(e) => this.handleMenuClick(e)}
|
onDropMenuClick={(e) => this.handleMenuClick(e)}
|
||||||
>
|
>
|
||||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@q6b87k`} leftCom={treeCom}>
|
||||||
datas={topTab}
|
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||||
counts={topTabCount}
|
datas={topTab}
|
||||||
keyParam="viewCondition" //主键
|
counts={topTabCount}
|
||||||
countParam="groupId" //数量
|
keyParam="viewCondition" //主键
|
||||||
selectedKey={selectedKey}
|
countParam="groupId" //数量
|
||||||
onChange={this.changeData.bind(this)}
|
selectedKey={selectedKey}
|
||||||
searchType={['base', 'advanced']}
|
onChange={this.changeData.bind(this)}
|
||||||
showSearchAd={isPanelShow}
|
searchType={['base', 'advanced']}
|
||||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? gradeName : form2.getFormParams().gradeName}
|
showSearchAd={isPanelShow}
|
||||||
setShowSearchAd={bool => jobGrade.setPanelStatus(bool)}
|
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? gradeName : form2.getFormParams().gradeName}
|
||||||
hideSearchAd={() => jobGrade.setPanelStatus(false)}
|
setShowSearchAd={bool => jobGrade.setPanelStatus(bool)}
|
||||||
searchsAd= {isPanelShow ? this.getPanelComponents() : <div></div>}
|
hideSearchAd={() => jobGrade.setPanelStatus(false)}
|
||||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||||
hasMask={false}
|
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||||
buttonsAd={this.getTabBtn()}
|
hasMask={false}
|
||||||
onSearch={() => jobGrade.getTableInfo()}
|
buttonsAd={this.getTabBtn()}
|
||||||
onSearchChange={val => this.onSearchChange(val)}
|
onSearch={() => jobGrade.getTableInfo()}
|
||||||
/>
|
onSearchChange={val => this.onSearchChange(val)}
|
||||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
/>
|
||||||
comsWeaTableStore={tableStore}
|
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||||
hasOrder={true}
|
comsWeaTableStore={tableStore}
|
||||||
needScroll={true}
|
hasOrder={true}
|
||||||
getColumns={c => this.reRenderColumns(c)}
|
needScroll={true}
|
||||||
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
getColumns={c => this.reRenderColumns(c)}
|
||||||
/>
|
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
||||||
|
/>
|
||||||
|
</WeaLeftRightLayout>
|
||||||
</WeaTop>
|
</WeaTop>
|
||||||
</WeaRightMenu>
|
</WeaRightMenu>
|
||||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||||
title={nEdialogTitle}
|
title={nEdialogTitle}
|
||||||
visible={visible}
|
visible={visible}
|
||||||
condition={toJS(condition)}
|
condition={toJS(condition)}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import {
|
||||||
WeaTab,
|
WeaTab,
|
||||||
WeaFormItem,
|
WeaFormItem,
|
||||||
WeaRightMenu,
|
WeaRightMenu,
|
||||||
|
WeaLeftRightLayout,
|
||||||
|
WeaLeftTree
|
||||||
} from 'ecCom'
|
} from 'ecCom'
|
||||||
import {
|
import {
|
||||||
Row,
|
Row,
|
||||||
|
|
@ -66,8 +68,8 @@ export default class JobLevel extends React.Component {
|
||||||
const {
|
const {
|
||||||
jobLevel
|
jobLevel
|
||||||
} = this.props;
|
} = this.props;
|
||||||
jobLevel.getTableInfo();
|
|
||||||
jobLevel.getHasRight();
|
jobLevel.getHasRight();
|
||||||
|
jobLevel.initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
getTopMenuBtns() {
|
getTopMenuBtns() {
|
||||||
|
|
@ -368,13 +370,31 @@ export default class JobLevel extends React.Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
isPanelShow, form2, levelName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
isPanelShow, form2, levelName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||||
form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight
|
form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight, treeConfig, treeLoading
|
||||||
} = jobLevel;
|
} = jobLevel;
|
||||||
|
|
||||||
if (hasRight === false) {
|
if (hasRight === false) {
|
||||||
return renderNoright();
|
return renderNoright();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
data,
|
||||||
|
onSelectedTreeNode,
|
||||||
|
selectedKeys,
|
||||||
|
onExpand,
|
||||||
|
treeExpandKeys
|
||||||
|
} = toJS(treeConfig);
|
||||||
|
const treeCom = (
|
||||||
|
<WeaLeftTree ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftTree@ifgbi1`}
|
||||||
|
datas={data}
|
||||||
|
searchLabel={"等级方案"}
|
||||||
|
onSelect={onSelectedTreeNode}
|
||||||
|
selectedKeys={selectedKeys}
|
||||||
|
onExpand={onExpand}
|
||||||
|
loading={treeLoading}
|
||||||
|
expandedKeys={treeExpandKeys} />
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
hasRight && <div ref='page' style={{ height: '100%' }}>
|
hasRight && <div ref='page' style={{ height: '100%' }}>
|
||||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||||
|
|
@ -391,32 +411,35 @@ export default class JobLevel extends React.Component {
|
||||||
dropMenuDatas={this.getDropMenuDatas()}
|
dropMenuDatas={this.getDropMenuDatas()}
|
||||||
onDropMenuClick={(e) => this.handleMenuClick(e)}
|
onDropMenuClick={(e) => this.handleMenuClick(e)}
|
||||||
>
|
>
|
||||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@q6b87k`} leftCom={treeCom}>
|
||||||
datas={topTab}
|
|
||||||
counts={topTabCount}
|
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||||
keyParam="viewCondition" //主键
|
datas={topTab}
|
||||||
countParam="groupId" //数量
|
counts={topTabCount}
|
||||||
selectedKey={selectedKey}
|
keyParam="viewCondition" //主键
|
||||||
onChange={this.changeData.bind(this)}
|
countParam="groupId" //数量
|
||||||
searchType={['base', 'advanced']}
|
selectedKey={selectedKey}
|
||||||
showSearchAd={isPanelShow}
|
onChange={this.changeData.bind(this)}
|
||||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? levelName : form2.getFormParams().levelName}
|
searchType={['base', 'advanced']}
|
||||||
setShowSearchAd={bool => jobLevel.setPanelStatus(bool)}
|
showSearchAd={isPanelShow}
|
||||||
hideSearchAd={() => jobLevel.setPanelStatus(false)}
|
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? levelName : form2.getFormParams().levelName}
|
||||||
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
setShowSearchAd={bool => jobLevel.setPanelStatus(bool)}
|
||||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
hideSearchAd={() => jobLevel.setPanelStatus(false)}
|
||||||
hasMask={false}
|
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||||
buttonsAd={this.getTabBtn()}
|
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||||
onSearch={() => jobLevel.getTableInfo()}
|
hasMask={false}
|
||||||
onSearchChange={val => this.onSearchChange(val)}
|
buttonsAd={this.getTabBtn()}
|
||||||
/>
|
onSearch={() => jobLevel.getTableInfo()}
|
||||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
onSearchChange={val => this.onSearchChange(val)}
|
||||||
comsWeaTableStore={tableStore}
|
/>
|
||||||
hasOrder={true}
|
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||||
needScroll={true}
|
comsWeaTableStore={tableStore}
|
||||||
getColumns={c => this.reRenderColumns(c)}
|
hasOrder={true}
|
||||||
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
needScroll={true}
|
||||||
/>
|
getColumns={c => this.reRenderColumns(c)}
|
||||||
|
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
||||||
|
/>
|
||||||
|
</WeaLeftRightLayout>
|
||||||
</WeaTop>
|
</WeaTop>
|
||||||
</WeaRightMenu>
|
</WeaRightMenu>
|
||||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,9 @@ export const i18n = {
|
||||||
postNumSetting: () => getLabel(386246, '岗位编号设置'),
|
postNumSetting: () => getLabel(386246, '岗位编号设置'),
|
||||||
userNumSetting: () => getLabel(386246, '人员编号设置'),
|
userNumSetting: () => getLabel(386246, '人员编号设置'),
|
||||||
companyName: () => getLabel(385937, '分部'),
|
companyName: () => getLabel(385937, '分部'),
|
||||||
|
newCompany: () => getLabel(385937, '新增分部'),
|
||||||
|
viewCompany: () => getLabel(385937, '分部信息'),
|
||||||
|
updateCompany: () => getLabel(385937, '修改分部信息'),
|
||||||
staffSchemeName: () => getLabel(385936, '编制方案'),
|
staffSchemeName: () => getLabel(385936, '编制方案'),
|
||||||
newStaffScheme: () => getLabel(386246, '新建编制方案'),
|
newStaffScheme: () => getLabel(386246, '新建编制方案'),
|
||||||
ediStaffScheme: () => getLabel(386247, '编辑编制方案'),
|
ediStaffScheme: () => getLabel(386247, '编辑编制方案'),
|
||||||
|
|
@ -141,12 +144,14 @@ export const i18n = {
|
||||||
editStaff: () => getLabel(386247, '编辑编制'),
|
editStaff: () => getLabel(386247, '编辑编制'),
|
||||||
changeStaff: () => getLabel(386247, '编制变更'),
|
changeStaff: () => getLabel(386247, '编制变更'),
|
||||||
jobName: () => getLabel(385936, '岗位'),
|
jobName: () => getLabel(385936, '岗位'),
|
||||||
newJob: () => getLabel(386246, '新建岗位'),
|
newJob: () => getLabel(386246, '新增岗位'),
|
||||||
editJob: () => getLabel(386247, '编辑岗位'),
|
editJobInfo: () => getLabel(386247, '修改岗位信息'),
|
||||||
|
jobInfo: () => getLabel(386247, '岗位信息'),
|
||||||
deptManage: () => getLabel(385936, '部门管理'),
|
deptManage: () => getLabel(385936, '部门管理'),
|
||||||
newDept: () => getLabel(386246, '新建部门'),
|
newDept: () => getLabel(386246, '新增部门'),
|
||||||
mergeDept:()=> getLabel(386246, '合并部门'),
|
mergeDept:()=> getLabel(386246, '合并部门'),
|
||||||
transferDept:()=> getLabel(386246, '转移部门'),
|
transferDept:()=> getLabel(386246, '转移部门'),
|
||||||
|
editDept:()=> getLabel(386246, '修改部门信息'),
|
||||||
typeName: () => getLabel(129927, '类型名称'),
|
typeName: () => getLabel(129927, '类型名称'),
|
||||||
ResourceName: () => getLabel(385936, '人员'),
|
ResourceName: () => getLabel(385936, '人员'),
|
||||||
newPeople: () => getLabel(386246, '新建人员'),
|
newPeople: () => getLabel(386246, '新建人员'),
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,10 @@ export class CompanyExtendStore {
|
||||||
this.isEditor = true;
|
this.isEditor = true;
|
||||||
this.getData();
|
this.getData();
|
||||||
this.getTabInfo();
|
this.getTabInfo();
|
||||||
//this.tabkey = '0';
|
|
||||||
this.detailSelectedKey = '0'
|
this.detailSelectedKey = '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
init = () => {
|
init = () => {
|
||||||
//this.tabkey = '0';
|
|
||||||
this.detailSelectedKey = '0'
|
this.detailSelectedKey = '0'
|
||||||
this.isEditor = false;
|
this.isEditor = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,38 +48,73 @@ export class JobGradeStore {
|
||||||
@observable topTab = [];
|
@observable topTab = [];
|
||||||
@observable topTabCount = {};
|
@observable topTabCount = {};
|
||||||
@observable key = '';//
|
@observable key = '';//
|
||||||
@observable hasRight = '';
|
@observable hasRight = true;
|
||||||
|
@observable treeLoading = true;
|
||||||
|
|
||||||
|
@observable treeConfig = {
|
||||||
|
data: [],
|
||||||
|
selectedKeys: [],
|
||||||
|
treeExpandKeys: [],
|
||||||
|
onExpand: (keys) => {
|
||||||
|
this.treeConfig.treeExpandKeys = keys;
|
||||||
|
},
|
||||||
|
onSelectedTreeNode: (key, count, countType) => {
|
||||||
|
this.treeConfig.selectedKeys = [key];
|
||||||
|
this.selectedTreeNodeInfo = countType.node.props.data;
|
||||||
|
this.getTableInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//选中树节点的信息
|
||||||
|
@observable selectedTreeNodeInfo;
|
||||||
|
|
||||||
|
@action initData = () => {
|
||||||
|
this.selectedTreeNodeInfo = null;
|
||||||
|
this.treeConfig.treeExpandKeys.length = 0;
|
||||||
|
Api.getTree().then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
if (res.data.length > 0) {
|
||||||
|
this.treeConfig.data = res.data;
|
||||||
|
this.treeConfig.selectedKeys = [res.data[0].key];
|
||||||
|
this.treeConfig.treeExpandKeys = "-1";
|
||||||
|
this.selectedTreeNodeInfo = res.data[0];
|
||||||
|
this.getTableInfo();
|
||||||
|
this.setTreeLoading(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
message.error(res.msg);
|
||||||
|
}
|
||||||
|
}, error => { })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
getTableInfo() {
|
getTableInfo() {
|
||||||
let params;
|
let params = {
|
||||||
|
schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid,
|
||||||
|
}
|
||||||
this.tableStore = new TableStore();
|
this.tableStore = new TableStore();
|
||||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||||
params = {
|
params = {
|
||||||
...this.form2.getFormParams(),
|
...params,
|
||||||
gradeName: this.gradeName,
|
gradeName: this.gradeName,
|
||||||
viewCondition:this.selectedKey
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
params = {
|
params = {
|
||||||
|
...params,
|
||||||
...this.form2.getFormParams(),
|
...this.form2.getFormParams(),
|
||||||
viewCondition:this.selectedKey
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Api.getSearchList(params).then(res => {
|
Api.getSearchList(params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.setHasRight(res.data.hasRight);
|
this.setHasRight(res.data.hasRight);
|
||||||
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
message.warning(res.msg);
|
message.warning(res.msg);
|
||||||
}
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
message.warning(error.msg);
|
message.warning(error.msg);
|
||||||
})
|
})
|
||||||
//获取tab信息(去除)
|
|
||||||
//this.getTabInfo();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
@ -384,4 +419,8 @@ export class JobGradeStore {
|
||||||
this.hasRight = bool;
|
this.hasRight = bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTreeLoading(bool) {
|
||||||
|
this.treeLoading = bool;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -48,25 +48,59 @@ export class JobLevelStore {
|
||||||
@observable topTab = [];
|
@observable topTab = [];
|
||||||
@observable topTabCount = {};
|
@observable topTabCount = {};
|
||||||
@observable hasRight = '';
|
@observable hasRight = '';
|
||||||
|
@observable treeLoading = true;
|
||||||
|
|
||||||
|
@observable treeConfig = {
|
||||||
|
data: [],
|
||||||
|
selectedKeys: [],
|
||||||
|
treeExpandKeys: [],
|
||||||
|
onExpand: (keys) => {
|
||||||
|
this.treeConfig.treeExpandKeys = keys;
|
||||||
|
},
|
||||||
|
onSelectedTreeNode: (key, count, countType) => {
|
||||||
|
this.treeConfig.selectedKeys = [key];
|
||||||
|
this.selectedTreeNodeInfo = countType.node.props.data;
|
||||||
|
this.getTableInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//选中树节点的信息
|
||||||
|
@observable selectedTreeNodeInfo;
|
||||||
|
|
||||||
|
@action initData = () => {
|
||||||
|
this.selectedTreeNodeInfo = null;
|
||||||
|
this.treeConfig.treeExpandKeys.length = 0;
|
||||||
|
Api.getTree().then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
if (res.data.length > 0) {
|
||||||
|
this.treeConfig.data = res.data;
|
||||||
|
this.treeConfig.selectedKeys = [res.data[0].key];
|
||||||
|
this.treeConfig.treeExpandKeys = "-1";
|
||||||
|
this.selectedTreeNodeInfo = res.data[0];
|
||||||
|
this.getTableInfo();
|
||||||
|
this.setTreeLoading(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
message.error(res.msg);
|
||||||
|
}
|
||||||
|
}, error => { })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
getTableInfo() {
|
getTableInfo() {
|
||||||
let params;
|
let params = {
|
||||||
//获取tab信息
|
schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid,
|
||||||
// this.getTabInfo();
|
}
|
||||||
this.tableStore = new TableStore();
|
this.tableStore = new TableStore();
|
||||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||||
params = {
|
params = {
|
||||||
...this.form2.getFormParams(),
|
...params,
|
||||||
levelName: this.levelName,
|
levelName: this.levelName,
|
||||||
viewCondition:this.selectedKey
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
params = {
|
params = {
|
||||||
|
...params,
|
||||||
...this.form2.getFormParams(),
|
...this.form2.getFormParams(),
|
||||||
viewCondition:this.selectedKey
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Api.getSearchList(params).then(res => {
|
Api.getSearchList(params).then(res => {
|
||||||
|
|
@ -79,7 +113,7 @@ export class JobLevelStore {
|
||||||
}, error => {
|
}, error => {
|
||||||
message.warning(error.msg);
|
message.warning(error.msg);
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除
|
//删除
|
||||||
|
|
@ -225,7 +259,7 @@ export class JobLevelStore {
|
||||||
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
getHasRight() {
|
getHasRight() {
|
||||||
Api.getHasRight().then(res => {
|
Api.getHasRight().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||||
|
|
@ -344,4 +378,8 @@ export class JobLevelStore {
|
||||||
this.hasRight = bool;
|
this.hasRight = bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTreeLoading(bool) {
|
||||||
|
this.treeLoading = bool;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue