commit
0c5e3cae8f
|
|
@ -64,4 +64,8 @@ export const getTabInfo = (params) => {
|
|||
|
||||
export const getHasRight = (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) => {
|
||||
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: 程亮
|
||||
* @Date: 2022-05-18 14:52:39
|
||||
* @LastEditTime: 2022-05-26 17:11:02
|
||||
* @LastEditTime: 2022-06-22 16:37:43
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
|
||||
*/
|
||||
|
|
@ -228,15 +228,7 @@ export default class CompanyExtend extends React.Component {
|
|||
|
||||
render() {
|
||||
const { companyExtend } = this.props;
|
||||
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = companyExtend;
|
||||
|
||||
// if(!hasRight && !loading){
|
||||
// return (
|
||||
// <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@387kx5`}>
|
||||
// <div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||
// </WeaAlertPage>
|
||||
// )
|
||||
// }
|
||||
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey,isEditor } = companyExtend;
|
||||
|
||||
try {
|
||||
return (
|
||||
|
|
@ -246,6 +238,9 @@ export default class CompanyExtend extends React.Component {
|
|||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
loading={true}
|
||||
title={isEditor ? i18n.label.updateCompany() : i18n.label.viewCompany()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 16:23:32
|
||||
* @LastEditTime: 2022-06-22 10:08:54
|
||||
* @LastEditTime: 2022-06-22 15:13:10
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
||||
*/
|
||||
|
|
@ -121,7 +121,7 @@ export default class Company extends React.Component {
|
|||
company
|
||||
} = this.props;
|
||||
|
||||
company.setNeDialogTitle(i18n.label.companyName());
|
||||
company.setNeDialogTitle(i18n.label.newCompany());
|
||||
company.setNewVisible(true);
|
||||
company.getCompanyForm();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-02 09:19:37
|
||||
* @LastEditTime: 2022-06-22 10:10:28
|
||||
* @LastEditTime: 2022-06-22 16:42:37
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js
|
||||
*/
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
department
|
||||
} = this.props;
|
||||
|
||||
department.setNeDialogTitle(i18n.label.deptManage());
|
||||
department.setNeDialogTitle(i18n.label.newDept());
|
||||
department.setNewVisible(true);
|
||||
department.getDeptForm();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,282 +1,284 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-02 09:20:03
|
||||
* @LastEditTime: 2022-06-02 11:40:57
|
||||
* @LastEditTime: 2022-06-22 16:54:39
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js
|
||||
*/
|
||||
|
||||
|
||||
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,WeaTop } from 'ecCom'
|
||||
import { WeaSwitch } from 'comsMobx';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import * as mobx from 'mobx';
|
||||
import { i18n } from '../../public/i18n';
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
import '../../style/common.less';
|
||||
|
||||
|
||||
@inject('departmentExtend')
|
||||
@inject('department')
|
||||
@observer
|
||||
export default class DepartmentExtendStore extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
init = () => {
|
||||
const { departmentExtend,department } = this.props;
|
||||
let {hash} = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
departmentExtend.init();
|
||||
departmentExtend.setId(id);
|
||||
departmentExtend.getData();
|
||||
}
|
||||
|
||||
getTabChildren = () => {
|
||||
const { departmentExtend } = this.props;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = departmentExtend;
|
||||
let tabChildren = [];
|
||||
tableInfo = toJS(tableInfo);
|
||||
tableInfo && tableInfo.map((t, i) => {
|
||||
if (detailSelectedKey == i) {
|
||||
tabChildren.push(
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||
ref={(ref)=>departmentExtend.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;
|
||||
}
|
||||
|
||||
onBtnsSelect = (key, index) => {
|
||||
const {
|
||||
departmentExtend
|
||||
} = this.props, {
|
||||
tableInfo,
|
||||
selectedRows,
|
||||
setSelectedRowKeys,
|
||||
selectedRowKeys
|
||||
} = departmentExtend;
|
||||
|
||||
const datas = tableInfo[index].tabinfo.datas;
|
||||
if (key === 'copy') {
|
||||
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)))
|
||||
}
|
||||
}
|
||||
|
||||
getSearchs = () => {
|
||||
const { departmentExtend } = this.props;
|
||||
let { form, conditions, isEditor } = departmentExtend;
|
||||
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: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
||||
underline={!isEditor}
|
||||
label={`${field.label}`}
|
||||
error={form.getError(field)}
|
||||
tipPosition={tipPosition}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
}
|
||||
});
|
||||
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} />)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
tableEditChange = (data) => {
|
||||
const { departmentExtend } = this.props;
|
||||
let { detailSelectedKey = '0', tableInfo } = departmentExtend;
|
||||
tableInfo = toJS(tableInfo);
|
||||
let d = cloneDeep(tableInfo);
|
||||
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
||||
departmentExtend.updateTableInfo(d);
|
||||
}
|
||||
|
||||
getRightMenu = () => {
|
||||
const { departmentExtend } = this.props;
|
||||
const { isEditor, buttons } = departmentExtend;
|
||||
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;
|
||||
|
||||
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, WeaTop } from 'ecCom'
|
||||
import { WeaSwitch } from 'comsMobx';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import * as mobx from 'mobx';
|
||||
import { i18n } from '../../public/i18n';
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
import '../../style/common.less';
|
||||
|
||||
|
||||
@inject('departmentExtend')
|
||||
@inject('department')
|
||||
@observer
|
||||
export default class DepartmentExtendStore extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
init = () => {
|
||||
const { departmentExtend, department } = this.props;
|
||||
let { hash } = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
departmentExtend.init();
|
||||
departmentExtend.setId(id);
|
||||
departmentExtend.getData();
|
||||
}
|
||||
|
||||
getTabChildren = () => {
|
||||
const { departmentExtend } = this.props;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = departmentExtend;
|
||||
let tabChildren = [];
|
||||
tableInfo = toJS(tableInfo);
|
||||
tableInfo && tableInfo.map((t, i) => {
|
||||
if (detailSelectedKey == i) {
|
||||
tabChildren.push(
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||
ref={(ref) => departmentExtend.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;
|
||||
}
|
||||
|
||||
onBtnsSelect = (key, index) => {
|
||||
const {
|
||||
departmentExtend
|
||||
} = this.props, {
|
||||
tableInfo,
|
||||
selectedRows,
|
||||
setSelectedRowKeys,
|
||||
selectedRowKeys
|
||||
} = departmentExtend;
|
||||
|
||||
const datas = tableInfo[index].tabinfo.datas;
|
||||
if (key === 'copy') {
|
||||
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)))
|
||||
}
|
||||
}
|
||||
|
||||
getSearchs = () => {
|
||||
const { departmentExtend } = this.props;
|
||||
let { form, conditions, isEditor } = departmentExtend;
|
||||
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: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
||||
underline={!isEditor}
|
||||
label={`${field.label}`}
|
||||
error={form.getError(field)}
|
||||
tipPosition={tipPosition}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
}
|
||||
});
|
||||
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} />)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
tableEditChange = (data) => {
|
||||
const { departmentExtend } = this.props;
|
||||
let { detailSelectedKey = '0', tableInfo } = departmentExtend;
|
||||
tableInfo = toJS(tableInfo);
|
||||
let d = cloneDeep(tableInfo);
|
||||
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
||||
departmentExtend.updateTableInfo(d);
|
||||
}
|
||||
|
||||
getRightMenu = () => {
|
||||
const { departmentExtend } = this.props;
|
||||
const { isEditor, buttons } = departmentExtend;
|
||||
let arr = [];
|
||||
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}
|
||||
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>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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,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: 程亮
|
||||
* @Date: 2022-05-26 14:05:59
|
||||
* @LastEditTime: 2022-06-22 10:10:58
|
||||
* @LastEditTime: 2022-06-22 16:43:08
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js
|
||||
*/
|
||||
|
|
@ -126,7 +126,7 @@ export default class Job extends React.Component {
|
|||
job
|
||||
} = this.props;
|
||||
|
||||
job.setNeDialogTitle(i18n.label.jobName());
|
||||
job.setNeDialogTitle(i18n.label.newJob());
|
||||
job.setNewVisible(true);
|
||||
job.getJobForm();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,289 +1,284 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-26 14:07:12
|
||||
* @LastEditTime: 2022-05-30 17:16:47
|
||||
* @LastEditTime: 2022-06-22 17:01:11
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js
|
||||
*/
|
||||
|
||||
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,WeaTop } from 'ecCom'
|
||||
import { WeaSwitch } from 'comsMobx';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import * as mobx from 'mobx';
|
||||
import { i18n } from '../../public/i18n';
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
import '../../style/common.less';
|
||||
|
||||
|
||||
@inject('jobExtend')
|
||||
@inject('job')
|
||||
@observer
|
||||
export default class JobExtend extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
init = () => {
|
||||
const { jobExtend,job } = this.props;
|
||||
let {hash} = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
jobExtend.init();
|
||||
jobExtend.setId(id);
|
||||
jobExtend.getData();
|
||||
}
|
||||
|
||||
getTabChildren = () => {
|
||||
const { jobExtend } = this.props;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = jobExtend;
|
||||
let tabChildren = [];
|
||||
tableInfo = toJS(tableInfo);
|
||||
tableInfo && tableInfo.map((t, i) => {
|
||||
if (detailSelectedKey == i) {
|
||||
tabChildren.push(
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||
ref={(ref)=>jobExtend.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;
|
||||
}
|
||||
|
||||
onBtnsSelect = (key, index) => {
|
||||
const {
|
||||
jobExtend
|
||||
} = this.props, {
|
||||
tableInfo,
|
||||
selectedRows,
|
||||
setSelectedRowKeys,
|
||||
selectedRowKeys
|
||||
} = jobExtend;
|
||||
|
||||
const datas = tableInfo[index].tabinfo.datas;
|
||||
if (key === 'copy') {
|
||||
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)))
|
||||
}
|
||||
}
|
||||
|
||||
getSearchs = () => {
|
||||
const { jobExtend } = this.props;
|
||||
let { form, conditions, isEditor } = jobExtend;
|
||||
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: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
||||
underline={!isEditor}
|
||||
label={`${field.label}`}
|
||||
error={form.getError(field)}
|
||||
tipPosition={tipPosition}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
}
|
||||
});
|
||||
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} />)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
tableEditChange = (data) => {
|
||||
const { jobExtend } = this.props;
|
||||
let { detailSelectedKey = '0', tableInfo } = jobExtend;
|
||||
tableInfo = toJS(tableInfo);
|
||||
let d = cloneDeep(tableInfo);
|
||||
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
||||
jobExtend.updateTableInfo(d);
|
||||
}
|
||||
|
||||
getRightMenu = () => {
|
||||
const { jobExtend } = this.props;
|
||||
const { isEditor, buttons } = jobExtend;
|
||||
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>
|
||||
// )
|
||||
// }
|
||||
|
||||
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, WeaTop } from 'ecCom'
|
||||
import { WeaSwitch } from 'comsMobx';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import * as mobx from 'mobx';
|
||||
import { i18n } from '../../public/i18n';
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
import '../../style/common.less';
|
||||
|
||||
|
||||
@inject('jobExtend')
|
||||
@inject('job')
|
||||
@observer
|
||||
export default class JobExtend extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
init = () => {
|
||||
const { jobExtend, job } = this.props;
|
||||
let { hash } = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
jobExtend.init();
|
||||
jobExtend.setId(id);
|
||||
jobExtend.getData();
|
||||
}
|
||||
|
||||
getTabChildren = () => {
|
||||
const { jobExtend } = this.props;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = jobExtend;
|
||||
let tabChildren = [];
|
||||
tableInfo = toJS(tableInfo);
|
||||
tableInfo && tableInfo.map((t, i) => {
|
||||
if (detailSelectedKey == i) {
|
||||
tabChildren.push(
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||
ref={(ref) => jobExtend.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;
|
||||
}
|
||||
|
||||
onBtnsSelect = (key, index) => {
|
||||
const {
|
||||
jobExtend
|
||||
} = this.props, {
|
||||
tableInfo,
|
||||
selectedRows,
|
||||
setSelectedRowKeys,
|
||||
selectedRowKeys
|
||||
} = jobExtend;
|
||||
|
||||
const datas = tableInfo[index].tabinfo.datas;
|
||||
if (key === 'copy') {
|
||||
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)))
|
||||
}
|
||||
}
|
||||
|
||||
getSearchs = () => {
|
||||
const { jobExtend } = this.props;
|
||||
let { form, conditions, isEditor } = jobExtend;
|
||||
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: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vh6j67@${j}`}
|
||||
underline={!isEditor}
|
||||
label={`${field.label}`}
|
||||
error={form.getError(field)}
|
||||
tipPosition={tipPosition}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
}
|
||||
});
|
||||
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} />)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
tableEditChange = (data) => {
|
||||
const { jobExtend } = this.props;
|
||||
let { detailSelectedKey = '0', tableInfo } = jobExtend;
|
||||
tableInfo = toJS(tableInfo);
|
||||
let d = cloneDeep(tableInfo);
|
||||
d[Number(detailSelectedKey)].tabinfo.datas = data;
|
||||
jobExtend.updateTableInfo(d);
|
||||
}
|
||||
|
||||
getRightMenu = () => {
|
||||
const { jobExtend } = this.props;
|
||||
const { isEditor, buttons } = jobExtend;
|
||||
let arr = [];
|
||||
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}
|
||||
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>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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,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,
|
||||
WeaFormItem,
|
||||
WeaRightMenu,
|
||||
WeaLeftRightLayout,
|
||||
WeaLeftTree
|
||||
} from 'ecCom'
|
||||
import {
|
||||
Row,
|
||||
|
|
@ -67,10 +69,10 @@ export default class JobGrade extends React.Component {
|
|||
const {
|
||||
jobGrade
|
||||
} = this.props;
|
||||
jobGrade.getTableInfo();
|
||||
jobGrade.getHasRight();
|
||||
jobGrade.initData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
getTopMenuBtns() {
|
||||
const {
|
||||
|
|
@ -117,7 +119,7 @@ export default class JobGrade extends React.Component {
|
|||
jobGrade.getForm();
|
||||
}
|
||||
|
||||
|
||||
|
||||
custom = () => {
|
||||
const {
|
||||
jobGrade
|
||||
|
|
@ -240,14 +242,14 @@ export default class JobGrade extends React.Component {
|
|||
let _this = this;
|
||||
columns.forEach((c, index) => {
|
||||
if (c.dataIndex == 'forbidden_tag') {
|
||||
c.render = function(text, record) {
|
||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked,record.id)} />
|
||||
c.render = function (text, record) {
|
||||
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked,id) {
|
||||
updateForbiddenTag(checked, id) {
|
||||
const {
|
||||
jobGrade
|
||||
} = this.props;
|
||||
|
|
@ -278,7 +280,7 @@ export default class JobGrade extends React.Component {
|
|||
const {
|
||||
jobGrade
|
||||
} = this.props;
|
||||
|
||||
|
||||
jobGrade.setNeDialogTitle(i18n.label.editJobGrade());
|
||||
jobGrade.setGradeId(id);
|
||||
jobGrade.setIsNew(false);
|
||||
|
|
@ -325,29 +327,29 @@ export default class JobGrade extends React.Component {
|
|||
|
||||
isFormInit && searchCondition.map(c => {
|
||||
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}>
|
||||
<div style={{marginTop: 20}}>
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{span: `${field.labelcol}`}}
|
||||
wrapperCol={{span: `${field.fieldcol}`}}>
|
||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
|
||||
</WeaFormItem>
|
||||
</div>
|
||||
</Col>)
|
||||
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 }}>
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
|
||||
</WeaFormItem>
|
||||
</div>
|
||||
</Col>)
|
||||
})
|
||||
})
|
||||
|
||||
if (searchConditionLoading) {
|
||||
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>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => {
|
||||
if ( e.keyCode == 13 && e.target.tagName === "INPUT") {
|
||||
jobGrade.getTableInfo();
|
||||
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
|
||||
jobGrade.getTableInfo();
|
||||
jobGrade.setPanelStatus(false)
|
||||
}
|
||||
}}>{arr}</Row>
|
||||
|
|
@ -371,14 +373,32 @@ export default class JobGrade extends React.Component {
|
|||
jobGrade
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount,date,hasRight
|
||||
isPanelShow, form2, gradeName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||
form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight, treeConfig, treeLoading
|
||||
} = jobGrade;
|
||||
|
||||
if (hasRight === false) {
|
||||
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 (
|
||||
hasRight && <div ref='page' style={{ height: '100%' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
|
|
@ -395,35 +415,37 @@ export default class JobGrade extends React.Component {
|
|||
dropMenuDatas={this.getDropMenuDatas()}
|
||||
onDropMenuClick={(e) => this.handleMenuClick(e)}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
counts={topTabCount}
|
||||
keyParam="viewCondition" //主键
|
||||
countParam="groupId" //数量
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
searchType={['base', 'advanced']}
|
||||
showSearchAd={isPanelShow}
|
||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? gradeName : form2.getFormParams().gradeName}
|
||||
setShowSearchAd={bool => jobGrade.setPanelStatus(bool)}
|
||||
hideSearchAd={() => jobGrade.setPanelStatus(false)}
|
||||
searchsAd= {isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||
hasMask={false}
|
||||
buttonsAd={this.getTabBtn()}
|
||||
onSearch={() => jobGrade.getTableInfo()}
|
||||
onSearchChange={val => this.onSearchChange(val)}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
getColumns={c => this.reRenderColumns(c)}
|
||||
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
||||
/>
|
||||
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@q6b87k`} leftCom={treeCom}>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
counts={topTabCount}
|
||||
keyParam="viewCondition" //主键
|
||||
countParam="groupId" //数量
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
searchType={['base', 'advanced']}
|
||||
showSearchAd={isPanelShow}
|
||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? gradeName : form2.getFormParams().gradeName}
|
||||
setShowSearchAd={bool => jobGrade.setPanelStatus(bool)}
|
||||
hideSearchAd={() => jobGrade.setPanelStatus(false)}
|
||||
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||
hasMask={false}
|
||||
buttonsAd={this.getTabBtn()}
|
||||
onSearch={() => jobGrade.getTableInfo()}
|
||||
onSearchChange={val => this.onSearchChange(val)}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
getColumns={c => this.reRenderColumns(c)}
|
||||
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
||||
/>
|
||||
</WeaLeftRightLayout>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||
title={nEdialogTitle}
|
||||
visible={visible}
|
||||
condition={toJS(condition)}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import {
|
|||
WeaTab,
|
||||
WeaFormItem,
|
||||
WeaRightMenu,
|
||||
WeaLeftRightLayout,
|
||||
WeaLeftTree
|
||||
} from 'ecCom'
|
||||
import {
|
||||
Row,
|
||||
|
|
@ -66,8 +68,8 @@ export default class JobLevel extends React.Component {
|
|||
const {
|
||||
jobLevel
|
||||
} = this.props;
|
||||
jobLevel.getTableInfo();
|
||||
jobLevel.getHasRight();
|
||||
jobLevel.initData();
|
||||
}
|
||||
|
||||
getTopMenuBtns() {
|
||||
|
|
@ -368,13 +370,31 @@ export default class JobLevel extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
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;
|
||||
|
||||
if (hasRight === false) {
|
||||
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 (
|
||||
hasRight && <div ref='page' style={{ height: '100%' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
|
|
@ -391,32 +411,35 @@ export default class JobLevel extends React.Component {
|
|||
dropMenuDatas={this.getDropMenuDatas()}
|
||||
onDropMenuClick={(e) => this.handleMenuClick(e)}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
counts={topTabCount}
|
||||
keyParam="viewCondition" //主键
|
||||
countParam="groupId" //数量
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
searchType={['base', 'advanced']}
|
||||
showSearchAd={isPanelShow}
|
||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? levelName : form2.getFormParams().levelName}
|
||||
setShowSearchAd={bool => jobLevel.setPanelStatus(bool)}
|
||||
hideSearchAd={() => jobLevel.setPanelStatus(false)}
|
||||
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||
hasMask={false}
|
||||
buttonsAd={this.getTabBtn()}
|
||||
onSearch={() => jobLevel.getTableInfo()}
|
||||
onSearchChange={val => this.onSearchChange(val)}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
getColumns={c => this.reRenderColumns(c)}
|
||||
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
||||
/>
|
||||
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@q6b87k`} leftCom={treeCom}>
|
||||
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
counts={topTabCount}
|
||||
keyParam="viewCondition" //主键
|
||||
countParam="groupId" //数量
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
searchType={['base', 'advanced']}
|
||||
showSearchAd={isPanelShow}
|
||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? levelName : form2.getFormParams().levelName}
|
||||
setShowSearchAd={bool => jobLevel.setPanelStatus(bool)}
|
||||
hideSearchAd={() => jobLevel.setPanelStatus(false)}
|
||||
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||
hasMask={false}
|
||||
buttonsAd={this.getTabBtn()}
|
||||
onSearch={() => jobLevel.getTableInfo()}
|
||||
onSearchChange={val => this.onSearchChange(val)}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
getColumns={c => this.reRenderColumns(c)}
|
||||
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
|
||||
/>
|
||||
</WeaLeftRightLayout>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,9 @@ export const i18n = {
|
|||
postNumSetting: () => getLabel(386246, '岗位编号设置'),
|
||||
userNumSetting: () => getLabel(386246, '人员编号设置'),
|
||||
companyName: () => getLabel(385937, '分部'),
|
||||
newCompany: () => getLabel(385937, '新增分部'),
|
||||
viewCompany: () => getLabel(385937, '分部信息'),
|
||||
updateCompany: () => getLabel(385937, '修改分部信息'),
|
||||
staffSchemeName: () => getLabel(385936, '编制方案'),
|
||||
newStaffScheme: () => getLabel(386246, '新建编制方案'),
|
||||
ediStaffScheme: () => getLabel(386247, '编辑编制方案'),
|
||||
|
|
@ -142,12 +145,14 @@ export const i18n = {
|
|||
editStaff: () => getLabel(386247, '编辑编制'),
|
||||
changeStaff: () => getLabel(386247, '编制变更'),
|
||||
jobName: () => getLabel(385936, '岗位'),
|
||||
newJob: () => getLabel(386246, '新建岗位'),
|
||||
editJob: () => getLabel(386247, '编辑岗位'),
|
||||
newJob: () => getLabel(386246, '新增岗位'),
|
||||
editJobInfo: () => getLabel(386247, '修改岗位信息'),
|
||||
jobInfo: () => getLabel(386247, '岗位信息'),
|
||||
deptManage: () => getLabel(385936, '部门管理'),
|
||||
newDept: () => getLabel(386246, '新建部门'),
|
||||
newDept: () => getLabel(386246, '新增部门'),
|
||||
mergeDept:()=> getLabel(386246, '合并部门'),
|
||||
transferDept:()=> getLabel(386246, '转移部门'),
|
||||
editDept:()=> getLabel(386246, '修改部门信息'),
|
||||
typeName: () => getLabel(129927, '类型名称'),
|
||||
ResourceName: () => getLabel(385936, '人员'),
|
||||
newPeople: () => getLabel(386246, '新建人员'),
|
||||
|
|
|
|||
|
|
@ -43,12 +43,10 @@ export class CompanyExtendStore {
|
|||
this.isEditor = true;
|
||||
this.getData();
|
||||
this.getTabInfo();
|
||||
//this.tabkey = '0';
|
||||
this.detailSelectedKey = '0'
|
||||
}
|
||||
|
||||
init = () => {
|
||||
//this.tabkey = '0';
|
||||
this.detailSelectedKey = '0'
|
||||
this.isEditor = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,38 +48,73 @@ export class JobGradeStore {
|
|||
@observable topTab = [];
|
||||
@observable topTabCount = {};
|
||||
@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
|
||||
getTableInfo() {
|
||||
let params;
|
||||
let params = {
|
||||
schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid,
|
||||
}
|
||||
this.tableStore = new TableStore();
|
||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
...params,
|
||||
gradeName: this.gradeName,
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
...params,
|
||||
...this.form2.getFormParams(),
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
}
|
||||
Api.getSearchList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setHasRight(res.data.hasRight);
|
||||
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
//获取tab信息(去除)
|
||||
//this.getTabInfo();
|
||||
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
@ -384,4 +419,8 @@ export class JobGradeStore {
|
|||
this.hasRight = bool;
|
||||
}
|
||||
|
||||
setTreeLoading(bool) {
|
||||
this.treeLoading = bool;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -48,25 +48,59 @@ export class JobLevelStore {
|
|||
@observable topTab = [];
|
||||
@observable topTabCount = {};
|
||||
@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
|
||||
getTableInfo() {
|
||||
let params;
|
||||
//获取tab信息
|
||||
// this.getTabInfo();
|
||||
let params = {
|
||||
schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid,
|
||||
}
|
||||
this.tableStore = new TableStore();
|
||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
...params,
|
||||
levelName: this.levelName,
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
...params,
|
||||
...this.form2.getFormParams(),
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
}
|
||||
Api.getSearchList(params).then(res => {
|
||||
|
|
@ -79,7 +113,7 @@ export class JobLevelStore {
|
|||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
|
|
@ -225,7 +259,7 @@ export class JobLevelStore {
|
|||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
|
|
@ -344,4 +378,8 @@ export class JobLevelStore {
|
|||
this.hasRight = bool;
|
||||
}
|
||||
|
||||
setTreeLoading(bool) {
|
||||
this.treeLoading = bool;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue