Merge branch 'dev' of gitee.com:jmlcl/trunk into dev
This commit is contained in:
commit
559ed2cbee
|
|
@ -0,0 +1,67 @@
|
|||
import {
|
||||
WeaTools
|
||||
} from 'ecCom'
|
||||
|
||||
export const getSearchList = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/grade/getGradeTable', 'GET', params);
|
||||
}
|
||||
|
||||
export const deleteTableData = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/grade/deleteByIds', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const getAdvanceSearchCondition = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/grade/getSearchCondition', 'GET', params);
|
||||
}
|
||||
|
||||
export const add = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/grade/saveGrade', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const edit = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/grade/updateGrade', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const updateForbiddenTag = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/grade/updateForbiddenTagById', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const getGradeForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/grade/getGradeForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const getTabInfo = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/grade/getTabInfo', 'GET', params);
|
||||
}
|
||||
|
||||
export const getHasRight = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/grade/getHasRight', 'GET', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
|
||||
import {
|
||||
WeaTools
|
||||
} from 'ecCom'
|
||||
|
||||
export const getSearchList = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/level/getLevelTable', 'GET', params);
|
||||
}
|
||||
|
||||
export const deleteTableData = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/level/deleteByIds', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const getAdvanceSearchCondition = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/level/getSearchCondition', 'GET', params);
|
||||
}
|
||||
|
||||
export const add = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/level/saveLevel', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const edit = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/level/updateLevel', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const updateForbiddenTag = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/level/updateForbiddenTagById', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const getLevelForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/level/getLevelForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const getTabInfo = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/level/getTabInfo', 'GET', params);
|
||||
}
|
||||
|
||||
export const getHasRight = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/level/getTableBtn', 'GET', params);
|
||||
}
|
||||
|
|
@ -59,4 +59,8 @@ export const updateForbiddenTag = (params) => {
|
|||
|
||||
export const getSchemeForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSchemeForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const getHasRight = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
|
||||
import {
|
||||
WeaTools
|
||||
} from 'ecCom'
|
||||
|
||||
export const getSearchList = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/sequence/getSequenceTable', 'GET', params);
|
||||
}
|
||||
|
||||
export const deleteTableData = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/sequence/deleteByIds', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const getAdvanceSearchCondition = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/sequence/getSearchCondition', 'GET', params);
|
||||
}
|
||||
|
||||
export const add = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/sequence/saveSequence', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const edit = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/sequence/updateSequence', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const updateForbiddenTag = (params) => {
|
||||
return fetch('/api/bs/hrmorganization/sequence/updateForbiddenTagById', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
})
|
||||
}
|
||||
|
||||
export const getSequenceForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/sequence/getSequenceForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const getTabInfo = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/sequence/getTabInfo', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
export const getHasRight = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/sequence/getHasRight', 'GET', params);
|
||||
}
|
||||
|
|
@ -24,6 +24,8 @@ export default class NewAndEditDialog extends React.Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
width: 700,
|
||||
enable: props.enable
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -39,24 +41,41 @@ export default class NewAndEditDialog extends React.Component {
|
|||
isFormInit && condition.map(c => {
|
||||
c.items.map((field, index) => {
|
||||
arr.push(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@jacv6v@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{span: `${field.labelcol}`}}
|
||||
error={form.getError(field)}
|
||||
tipPosition="bottom"
|
||||
wrapperCol={{span: `${field.fieldcol}`}}>
|
||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@7vxyfr@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />}
|
||||
</WeaFormItem>)
|
||||
label={`${field.label}`}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
error={form.getError(field)}
|
||||
tipPosition="bottom"
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@7vxyfr@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />}
|
||||
</WeaFormItem>)
|
||||
})
|
||||
})
|
||||
return <div className="wea-form-item-group">{arr}</div>
|
||||
}
|
||||
|
||||
onChange = data => {
|
||||
if(this.state.enable && data.schemeId) {
|
||||
const {
|
||||
condition,
|
||||
form,
|
||||
bindChangeEnvent,
|
||||
} = this.props;
|
||||
bindChangeEnvent(data.schemeId.value);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
onBlur = data => {
|
||||
//console.log("onBlur 回调", data);
|
||||
};
|
||||
|
||||
|
||||
getSearchGroupForm() {
|
||||
const {
|
||||
condition,
|
||||
form,
|
||||
isFormInit,
|
||||
domkey,
|
||||
isEdit
|
||||
} = this.props;
|
||||
|
||||
|
|
@ -67,15 +86,16 @@ export default class NewAndEditDialog extends React.Component {
|
|||
_arr.push({
|
||||
com: (
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@merei2@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{span: `${field.labelcol}`}}
|
||||
error={form.getError(field)}
|
||||
tipPosition="bottom"
|
||||
wrapperCol={{span: `${field.fieldcol}`}}
|
||||
underline={isEdit?false:true}
|
||||
>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@5r6c5a@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />
|
||||
</WeaFormItem>
|
||||
label={`${field.label}`}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
error={form.getError(field)}
|
||||
tipPosition="bottom"
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}
|
||||
underline={isEdit ? false : true}
|
||||
>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@5r6c5a@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} onChange={this.onChange}
|
||||
onBlur={this.onBlur} />
|
||||
</WeaFormItem>
|
||||
),
|
||||
colSpan: 1
|
||||
})
|
||||
|
|
@ -115,17 +135,17 @@ export default class NewAndEditDialog extends React.Component {
|
|||
visible={visible}
|
||||
closable={true}
|
||||
hasScroll={true}
|
||||
onCancel={() => onCancel() }
|
||||
buttons={isEdit?buttons:buttons.slice(1,2)}
|
||||
style={{width: width, height: height}}
|
||||
onCancel={() => onCancel()}
|
||||
buttons={isEdit ? buttons : buttons.slice(1, 2)}
|
||||
style={{ width: width, height: height }}
|
||||
>
|
||||
{
|
||||
loading ? <div className='hrm-loading-center-small'>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
|
||||
</div>
|
||||
: <div className={conditionLen > 1 ? '' : 'hrm-dialog-form'}>
|
||||
{conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()}
|
||||
</div>
|
||||
loading ? <div className='hrm-loading-center-small'>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
|
||||
</div>
|
||||
: <div className={conditionLen > 1 ? '' : 'hrm-dialog-form'}>
|
||||
{conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()}
|
||||
</div>
|
||||
}
|
||||
</WeaDialog>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,224 @@
|
|||
import React from 'react'
|
||||
import * as mobx from 'mobx'
|
||||
import {
|
||||
inject,
|
||||
observer,
|
||||
} from 'mobx-react'
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaFormItem,
|
||||
WeaRightMenu,
|
||||
} from 'ecCom'
|
||||
import {
|
||||
Row,
|
||||
Col,
|
||||
Spin,
|
||||
Modal,
|
||||
Button,
|
||||
message,
|
||||
Switch
|
||||
} from 'antd'
|
||||
import {
|
||||
WeaSwitch,
|
||||
WeaTableNew
|
||||
} from 'comsMobx'
|
||||
import {
|
||||
i18n
|
||||
} from '../../public/i18n';
|
||||
|
||||
import '../../style/common.less';
|
||||
|
||||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
const confirm = Modal.confirm;
|
||||
|
||||
|
||||
@inject('group')
|
||||
@observer
|
||||
export default class Group extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
|
||||
if (this.props.location.key !== nextProps.location.key) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
init() {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
group.getGroupForm();
|
||||
group.getHasRight();
|
||||
}
|
||||
|
||||
getTopMenuBtns() {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
const {
|
||||
topMenu,
|
||||
tableStore
|
||||
} = group;
|
||||
|
||||
let btns = [];
|
||||
topMenu.map((item, i) => {
|
||||
btns.push(<Button type='primary' onClick={() => this.handleClick(item)}>{item.menuName}</Button>);
|
||||
});
|
||||
return btns;
|
||||
}
|
||||
|
||||
getDropMenuDatas() {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
const {
|
||||
rightMenu
|
||||
} = group;
|
||||
|
||||
let menus = [];
|
||||
toJS(rightMenu).map((item, index) => {
|
||||
let obj = {
|
||||
key: item.menuFun,
|
||||
icon: <i className={`${item.menuIcon}`} />,
|
||||
content: item.menuName,
|
||||
}
|
||||
if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') {
|
||||
obj.disabled = true;
|
||||
}
|
||||
menus.push(obj);
|
||||
})
|
||||
return menus;
|
||||
}
|
||||
|
||||
|
||||
|
||||
doEdit(id) {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
|
||||
group.setNeDialogTitle(i18n.label.editGroup());
|
||||
group.setVisible(true);
|
||||
group.getForm();
|
||||
}
|
||||
|
||||
|
||||
handleSave() {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
group.edit();
|
||||
}
|
||||
|
||||
handleMenuClick(key) {
|
||||
this[key] && this[key]();
|
||||
}
|
||||
|
||||
handleClick(item) {
|
||||
this[item.menuFun] && this[item.menuFun]();
|
||||
}
|
||||
|
||||
|
||||
changeData(key) {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
group.changeData(key);
|
||||
}
|
||||
|
||||
getFormField() {
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
const { form1, groupCondition } = group;
|
||||
|
||||
const { isFormInit } = form1;
|
||||
const formParams = form1.getFormParams();
|
||||
let items = [];
|
||||
isFormInit && toJS(groupCondition).map(c => {
|
||||
c.items.map((fields, index) => {
|
||||
items.push(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@zzk1d0@${index}`}
|
||||
underline={true}
|
||||
label={`${fields.label}`}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p0qhmz@${index}`} fieldConfig={fields} form={form1} formParams={formParams} />
|
||||
</WeaFormItem>);
|
||||
});
|
||||
});
|
||||
return <div className="wea-form-item-group">{items}</div>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
const {
|
||||
group
|
||||
} = this.props;
|
||||
const {
|
||||
nEdialogTitle, visible, condition, form, dialogLoading, isEdit, topTab, selectedKey
|
||||
} = group;
|
||||
|
||||
return (
|
||||
<div ref='page' style={{ height: '100%' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
datas={this.getDropMenuDatas()}
|
||||
onClick={key => this.handleMenuClick(key)}
|
||||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
title={i18n.label.groupInfo()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
loading={true}
|
||||
buttons={this.getTopMenuBtns()}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getDropMenuDatas()}
|
||||
onDropMenuClick={(e) => this.handleMenuClick(e)}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
keyParam="viewCondition" //主键
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
/>
|
||||
<div className='organization-group'>
|
||||
{this.getFormField()}
|
||||
</div>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||
title={nEdialogTitle}
|
||||
visible={visible}
|
||||
condition={toJS(condition)}
|
||||
form={form}
|
||||
isFormInit={form.isFormInit}
|
||||
loading={dialogLoading}
|
||||
isEdit={isEdit}
|
||||
height={250}
|
||||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => group.setVisible(false)}
|
||||
enable={false} //是否开启字段联动
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -69,6 +69,7 @@ export default class JobGrade extends React.Component {
|
|||
jobGrade.getTableInfo();
|
||||
jobGrade.getHasRight();
|
||||
}
|
||||
|
||||
|
||||
getTopMenuBtns() {
|
||||
const {
|
||||
|
|
@ -109,7 +110,7 @@ export default class JobGrade extends React.Component {
|
|||
jobGrade
|
||||
} = this.props;
|
||||
|
||||
jobGrade.setNeDialogTitle(i18n.label.newRankScheme());
|
||||
jobGrade.setNeDialogTitle(i18n.label.newJobGrade());
|
||||
jobGrade.setIsNew(true);
|
||||
jobGrade.setVisible(true);
|
||||
jobGrade.getForm();
|
||||
|
|
@ -174,7 +175,15 @@ export default class JobGrade extends React.Component {
|
|||
}
|
||||
|
||||
handleMenuClick(key) {
|
||||
const {
|
||||
jobGrade
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow
|
||||
} = jobGrade;
|
||||
|
||||
isPanelShow && jobGrade.setPanelStatus(false);
|
||||
this[key] && this[key]();
|
||||
}
|
||||
|
||||
getTabBtn() {
|
||||
|
|
@ -202,10 +211,17 @@ export default class JobGrade extends React.Component {
|
|||
form2
|
||||
} = jobGrade;
|
||||
|
||||
jobGrade.setRankName(val);
|
||||
jobGrade.setGradeName(val);
|
||||
!this.isEmptyObject(form2.getFormParams()) && jobGrade.updateFields(val);
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
const {
|
||||
jobGrade
|
||||
} = this.props;
|
||||
jobGrade.changeData(key);
|
||||
}
|
||||
|
||||
reRenderColumns(columns) {
|
||||
let _this = this;
|
||||
columns.forEach((c, index) => {
|
||||
|
|
@ -238,8 +254,8 @@ export default class JobGrade extends React.Component {
|
|||
jobGrade
|
||||
} = this.props;
|
||||
|
||||
jobGrade.setNeDialogTitle(i18n.label.editRankScheme());
|
||||
jobGrade.setLevelId(id);
|
||||
jobGrade.setNeDialogTitle(i18n.label.editJobGrade());
|
||||
jobGrade.setGradeId(id);
|
||||
jobGrade.setIsNew(false);
|
||||
jobGrade.setVisible(true);
|
||||
jobGrade.getForm();
|
||||
|
|
@ -331,37 +347,9 @@ export default class JobGrade extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, gradeName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit,selectedKey
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
||||
} = jobGrade;
|
||||
|
||||
const topTab = [
|
||||
{
|
||||
color: "#000000",
|
||||
groupid: "flowAll",
|
||||
showcount: true,
|
||||
title: "全部",
|
||||
viewcondition: "0"
|
||||
},
|
||||
{
|
||||
color: "#ff3232",
|
||||
groupid: "flowNew",
|
||||
showcount: true,
|
||||
title: "启用",
|
||||
viewcondition: "1"
|
||||
},
|
||||
{
|
||||
color: "#fea468",
|
||||
groupid: "flowRes",
|
||||
showcount: true,
|
||||
title: "禁用",
|
||||
viewcondition: "2"
|
||||
}
|
||||
];
|
||||
const topTabCount = {
|
||||
flowAll: "120",
|
||||
flowNew: "112",
|
||||
flowOver: "0",
|
||||
};
|
||||
|
||||
return (
|
||||
<div ref='page' style={{ height: '100%' }}>
|
||||
|
|
@ -382,9 +370,10 @@ export default class JobGrade extends React.Component {
|
|||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
counts={topTabCount}
|
||||
keyParam="viewcondition" //主键
|
||||
countParam="groupid" //数量
|
||||
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}
|
||||
|
|
@ -414,10 +403,12 @@ export default class JobGrade extends React.Component {
|
|||
isFormInit={form.isFormInit}
|
||||
loading={dialogLoading}
|
||||
isEdit={isEdit}
|
||||
height={250}
|
||||
height={350}
|
||||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => jobGrade.setVisible(false)}
|
||||
enable={true} //是否开启字段联动
|
||||
bindChangeEnvent={val => jobGrade.updateConditions(val)}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ export default class JobLevel extends React.Component {
|
|||
jobLevel
|
||||
} = this.props;
|
||||
|
||||
jobLevel.setNeDialogTitle(i18n.label.newRankScheme());
|
||||
jobLevel.setNeDialogTitle(i18n.label.newJobLevel());
|
||||
jobLevel.setIsNew(true);
|
||||
jobLevel.setVisible(true);
|
||||
jobLevel.getForm();
|
||||
|
|
@ -174,7 +174,15 @@ export default class JobLevel extends React.Component {
|
|||
}
|
||||
|
||||
handleMenuClick(key) {
|
||||
const {
|
||||
jobLevel
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow
|
||||
} = jobLevel;
|
||||
|
||||
isPanelShow && jobLevel.setPanelStatus(false);
|
||||
this[key] && this[key]();
|
||||
}
|
||||
|
||||
getTabBtn() {
|
||||
|
|
@ -206,6 +214,13 @@ export default class JobLevel extends React.Component {
|
|||
!this.isEmptyObject(form2.getFormParams()) && jobLevel.updateFields(val);
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
const {
|
||||
jobLevel
|
||||
} = this.props;
|
||||
jobLevel.changeData(key);
|
||||
}
|
||||
|
||||
reRenderColumns(columns) {
|
||||
let _this = this;
|
||||
columns.forEach((c, index) => {
|
||||
|
|
@ -238,7 +253,7 @@ export default class JobLevel extends React.Component {
|
|||
jobLevel
|
||||
} = this.props;
|
||||
|
||||
jobLevel.setNeDialogTitle(i18n.label.editRankScheme());
|
||||
jobLevel.setNeDialogTitle(i18n.label.editJobLevel());
|
||||
jobLevel.setLevelId(id);
|
||||
jobLevel.setIsNew(false);
|
||||
jobLevel.setVisible(true);
|
||||
|
|
@ -332,37 +347,9 @@ export default class JobLevel extends React.Component {
|
|||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit,selectedKey
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
||||
} = jobLevel;
|
||||
|
||||
const topTab = [
|
||||
{
|
||||
color: "#000000",
|
||||
groupid: "flowAll",
|
||||
showcount: true,
|
||||
title: "全部",
|
||||
viewcondition: "0"
|
||||
},
|
||||
{
|
||||
color: "#ff3232",
|
||||
groupid: "flowNew",
|
||||
showcount: true,
|
||||
title: "启用",
|
||||
viewcondition: "1"
|
||||
},
|
||||
{
|
||||
color: "#fea468",
|
||||
groupid: "flowRes",
|
||||
showcount: true,
|
||||
title: "禁用",
|
||||
viewcondition: "2"
|
||||
}
|
||||
];
|
||||
const topTabCount = {
|
||||
flowAll: "120",
|
||||
flowNew: "112",
|
||||
flowOver: "0",
|
||||
};
|
||||
|
||||
return (
|
||||
<div ref='page' style={{ height: '100%' }}>
|
||||
|
|
@ -383,9 +370,10 @@ export default class JobLevel extends React.Component {
|
|||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
counts={topTabCount}
|
||||
keyParam="viewcondition" //主键
|
||||
countParam="groupid" //数量
|
||||
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}
|
||||
|
|
@ -415,10 +403,11 @@ export default class JobLevel extends React.Component {
|
|||
isFormInit={form.isFormInit}
|
||||
loading={dialogLoading}
|
||||
isEdit={isEdit}
|
||||
height={250}
|
||||
height={300}
|
||||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => jobLevel.setVisible(false)}
|
||||
enable={false} //是否开启字段联动
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -174,7 +174,15 @@ export default class RankScheme extends React.Component {
|
|||
}
|
||||
|
||||
handleMenuClick(key) {
|
||||
const {
|
||||
rankScheme
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow
|
||||
} = rankScheme;
|
||||
|
||||
isPanelShow && rankScheme.setPanelStatus(false);
|
||||
this[key] && this[key]();
|
||||
}
|
||||
|
||||
getTabBtn() {
|
||||
|
|
@ -385,6 +393,7 @@ export default class RankScheme extends React.Component {
|
|||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => rankScheme.setVisible(false)}
|
||||
enable={false} //是否开启字段联动
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,415 @@
|
|||
import React from 'react'
|
||||
import * as mobx from 'mobx'
|
||||
import {
|
||||
inject,
|
||||
observer,
|
||||
} from 'mobx-react'
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaFormItem,
|
||||
WeaRightMenu,
|
||||
} from 'ecCom'
|
||||
import {
|
||||
Row,
|
||||
Col,
|
||||
Spin,
|
||||
Modal,
|
||||
Button,
|
||||
message,
|
||||
Switch
|
||||
} from 'antd'
|
||||
import {
|
||||
WeaSwitch,
|
||||
WeaTableNew
|
||||
} from 'comsMobx'
|
||||
import {
|
||||
i18n
|
||||
} from '../../public/i18n';
|
||||
|
||||
import '../../style/common.less';
|
||||
|
||||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
|
||||
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
const confirm = Modal.confirm;
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
|
||||
@inject('sequence')
|
||||
@observer
|
||||
export default class Sequence extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
|
||||
if (this.props.location.key !== nextProps.location.key) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
init() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
sequence.getTableInfo();
|
||||
sequence.getHasRight();
|
||||
}
|
||||
|
||||
getTopMenuBtns() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
topMenu,
|
||||
tableStore
|
||||
} = sequence;
|
||||
|
||||
let btns = [];
|
||||
topMenu.map((item, i) => {
|
||||
if (item.menuFun !== 'batchDelete') {
|
||||
btns.push(<Button type='primary' onClick={() => this.handleClick(item)}>{item.menuName}</Button>);
|
||||
} else {
|
||||
btns.push(<Button type='primary' onClick={() => this.handleClick(item)} disabled={tableStore.selectedRowKeys.length > 0 ? false : true} >{item.menuName}</Button>);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return btns;
|
||||
}
|
||||
|
||||
handleClick(item) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow
|
||||
} = sequence;
|
||||
|
||||
isPanelShow && sequence.setPanelStatus(false);
|
||||
this[item.menuFun] && this[item.menuFun]();
|
||||
}
|
||||
|
||||
new() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
|
||||
sequence.setNeDialogTitle(i18n.label.newSequence());
|
||||
sequence.setIsNew(true);
|
||||
sequence.setVisible(true);
|
||||
sequence.getForm();
|
||||
}
|
||||
|
||||
batchDelete() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
tableStore
|
||||
} = sequence;
|
||||
|
||||
let keys = toJS(tableStore.selectedRowKeys).toString();
|
||||
sequence.setIds(keys);
|
||||
this.showConfirm('batchDel');
|
||||
}
|
||||
showConfirm(v) {
|
||||
let _this = this;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: (v == 'del') ? i18n.confirm.delete() : i18n.confirm.batchDeleteConfirm(),
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
_this.onOk();
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
onOk() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
sequence.delete();
|
||||
}
|
||||
|
||||
|
||||
getDropMenuDatas() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
rightMenu
|
||||
} = sequence;
|
||||
|
||||
let menus = [];
|
||||
toJS(rightMenu).map((item, index) => {
|
||||
let obj = {
|
||||
key: item.menuFun,
|
||||
icon: <i className={`${item.menuIcon}`} />,
|
||||
content: item.menuName,
|
||||
}
|
||||
if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') {
|
||||
obj.disabled = true;
|
||||
}
|
||||
menus.push(obj);
|
||||
})
|
||||
return menus;
|
||||
}
|
||||
|
||||
handleMenuClick(key) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow
|
||||
} = sequence;
|
||||
|
||||
isPanelShow && sequence.setPanelStatus(false);
|
||||
this[key] && this[key]();
|
||||
}
|
||||
|
||||
getTabBtn() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
form2
|
||||
} = sequence;
|
||||
|
||||
const btn = [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { sequence.getTableInfo(); sequence.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} onClick={() => form2.reset()}>{i18n.button.reset()}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => sequence.setPanelStatus(false)}>{i18n.button.cancel()}</Button>),
|
||||
];
|
||||
|
||||
return btn;
|
||||
}
|
||||
|
||||
onSearchChange(val) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
form2
|
||||
} = sequence;
|
||||
|
||||
sequence.setSequenceName(val);
|
||||
!this.isEmptyObject(form2.getFormParams()) && sequence.updateFields(val);
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
sequence.changeData(key);
|
||||
}
|
||||
|
||||
reRenderColumns(columns) {
|
||||
let _this = this;
|
||||
columns.forEach((c, index) => {
|
||||
if (c.dataIndex == 'forbidden_tag') {
|
||||
c.render = function(text, record) {
|
||||
return <Switch defaultChecked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked,record.id)} />
|
||||
}
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked,id) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
sequence.updateForbiddenTag(checked,id);
|
||||
}
|
||||
|
||||
onOperatesClick(record, rowIndex, operate) {
|
||||
const {
|
||||
index
|
||||
} = operate;
|
||||
(index == '0') && this.doEdit(record.randomFieldId);
|
||||
(index == '1') && this.doDel(record.randomFieldId);
|
||||
|
||||
}
|
||||
|
||||
doEdit(id) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
|
||||
sequence.setNeDialogTitle(i18n.label.editSequence());
|
||||
sequence.setSequenceId(id);
|
||||
sequence.setIsNew(false);
|
||||
sequence.setVisible(true);
|
||||
sequence.getForm();
|
||||
}
|
||||
|
||||
doDel(id) {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
sequence.setIds(id);
|
||||
this.showConfirm('del');
|
||||
}
|
||||
|
||||
|
||||
handleSave() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
isNew
|
||||
} = sequence;
|
||||
|
||||
isNew && sequence.save();
|
||||
!isNew && sequence.edit();
|
||||
}
|
||||
|
||||
getPanelComponents() {
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
searchCondition,
|
||||
form2,
|
||||
searchConditionLoading
|
||||
} = sequence;
|
||||
|
||||
let arr = [];
|
||||
let formParams = form2.getFormParams();
|
||||
const {
|
||||
isFormInit
|
||||
} = form2;
|
||||
|
||||
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>)
|
||||
})
|
||||
})
|
||||
|
||||
if (searchConditionLoading) {
|
||||
return (
|
||||
<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") {
|
||||
sequence.getTableInfo();
|
||||
sequence.setPanelStatus(false)
|
||||
}
|
||||
}}>{arr}</Row>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//非空判断
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
const {
|
||||
sequence
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, levelName, conditionNum, tableStore,nEdialogTitle,visible,condition,
|
||||
form,dialogLoading,isEdit,selectedKey,topTab,topTabCount
|
||||
} = sequence;
|
||||
|
||||
|
||||
return (
|
||||
<div ref='page' style={{ height: '100%' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
datas={this.getDropMenuDatas()}
|
||||
onClick={key => this.handleMenuClick(key)}
|
||||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
title={i18n.label.sequenceName()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
loading={true}
|
||||
buttons={this.getTopMenuBtns()}
|
||||
showDropIcon={true}
|
||||
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 => sequence.setPanelStatus(bool)}
|
||||
hideSearchAd={() => sequence.setPanelStatus(false)}
|
||||
searchsAd= {isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
|
||||
hasMask={false}
|
||||
buttonsAd={this.getTabBtn()}
|
||||
onSearch={() => sequence.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)}
|
||||
/>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
|
||||
title={nEdialogTitle}
|
||||
visible={visible}
|
||||
condition={toJS(condition)}
|
||||
form={form}
|
||||
isFormInit={form.isFormInit}
|
||||
loading={dialogLoading}
|
||||
isEdit={isEdit}
|
||||
height={250}
|
||||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => sequence.setVisible(false)}
|
||||
enable={false} //是否开启字段联动
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,8 @@ import StandardOrg from "./components/tree/standard_org";
|
|||
import RankScheme from "./components/postionrank/RankScheme";
|
||||
import JobLevel from "./components/postionrank/JobLevel";
|
||||
import JobGrade from "./components/postionrank/JobGrade";
|
||||
import Sequence from "./components/sequence/Sequence";
|
||||
import Group from "./components/group/group";
|
||||
import CompanyManage from "./components/company/companyManage";
|
||||
import OfficeManage from "./components/office/officeManage";
|
||||
import stores from "./stores";
|
||||
|
|
@ -35,6 +37,8 @@ const Routes = (
|
|||
<Route key="rankscheme" path="rankscheme" component={RankScheme} />
|
||||
<Route key="joblevel" path="joblevel" component={JobLevel} />
|
||||
<Route key="jobgrade" path="jobgrade" component={JobGrade} />
|
||||
<Route key="sequence" path="sequence" component={Sequence} />
|
||||
<Route key="group" path="group" component={Group} />
|
||||
<Route key="companyManage" path="companyManage" component={CompanyManage} />
|
||||
<Route key="officeManage" path="officeManage" component={OfficeManage} />
|
||||
</Route>
|
||||
|
|
|
|||
|
|
@ -119,6 +119,12 @@ export const i18n = {
|
|||
gradeName: () => getLabel(385936, '职级'),
|
||||
newJobGrade: () => getLabel(386246, '新建职级'),
|
||||
editJobGrade: () => getLabel(386247, '编辑职级'),
|
||||
sequenceName: () => getLabel(385936, '岗位序列'),
|
||||
newSequence: () => getLabel(386246, '新建岗位序列'),
|
||||
editSequence: () => getLabel(386247, '编辑岗位序列'),
|
||||
groupInfo: () => getLabel(385936, '总部'),
|
||||
editGroup: () => getLabel(386247, '编辑总部'),
|
||||
|
||||
|
||||
|
||||
authorizationGroup: () => getLabel(492, '权限组'),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,458 @@
|
|||
import {
|
||||
observable,
|
||||
action
|
||||
} from 'mobx';
|
||||
import * as mobx from 'mobx';
|
||||
import * as Api from '../apis/group'; // 引入API接口文件
|
||||
import {
|
||||
WeaForm
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
Modal,
|
||||
message,
|
||||
} from 'antd'
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
|
||||
export class GroupStore {
|
||||
@observable topMenu = []
|
||||
@observable rightMenu = [];
|
||||
@observable condition = [];
|
||||
@observable groupCondition = [];
|
||||
@observable isEdit = true;
|
||||
@observable form = new WeaForm();
|
||||
@observable form1 = new WeaForm();
|
||||
@observable nEdialogTitle = '';
|
||||
@observable visible = false;
|
||||
@observable dialogLoading = true;
|
||||
@observable selectedKey = 1;
|
||||
@observable topTab = [];
|
||||
@observable date = '';
|
||||
|
||||
@action
|
||||
getGroupForm() {
|
||||
let params = {
|
||||
viewattr: 1
|
||||
}
|
||||
//api
|
||||
let condition = [
|
||||
{
|
||||
"title": "总部信息",
|
||||
"defaultshow": true,
|
||||
"items": [
|
||||
{
|
||||
"belong": "PC",
|
||||
"checkbox": false,
|
||||
"checkboxValue": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT",
|
||||
"dateGroup": false,
|
||||
"defaultDisplayInBar": false,
|
||||
"detailtype": 1,
|
||||
"domkey": [
|
||||
"companyname"
|
||||
],
|
||||
"entSearch": false,
|
||||
"fieldcol": 16,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"hide": false,
|
||||
"isBase64": false,
|
||||
"isQuickSearch": false,
|
||||
"label": "总部名称",
|
||||
"labelcol": 8,
|
||||
"length": 0,
|
||||
"maxFilesNumber": 0,
|
||||
"maxUploadSize": 0,
|
||||
"multiSelection": false,
|
||||
"multiple": false,
|
||||
"otherParams": {
|
||||
"inputType": "multilang",
|
||||
"isBase64": true
|
||||
},
|
||||
"precision": 0,
|
||||
"rules": "required|string",
|
||||
"secretLimit": false,
|
||||
"showOrder": 0,
|
||||
"showTime": false,
|
||||
"stringLength": 0,
|
||||
"supportCancel": false,
|
||||
"tipPosition": "bottom",
|
||||
"value": "E9TEST",
|
||||
"valueList": [],
|
||||
"viewAttr": 1
|
||||
},
|
||||
{
|
||||
"belong": "PC",
|
||||
"checkbox": false,
|
||||
"checkboxValue": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT",
|
||||
"dateGroup": false,
|
||||
"defaultDisplayInBar": false,
|
||||
"detailtype": 1,
|
||||
"domkey": [
|
||||
"companydesc"
|
||||
],
|
||||
"entSearch": false,
|
||||
"fieldcol": 16,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"hide": false,
|
||||
"isBase64": false,
|
||||
"isQuickSearch": false,
|
||||
"label": "总部全称",
|
||||
"labelcol": 8,
|
||||
"length": 0,
|
||||
"maxFilesNumber": 0,
|
||||
"maxUploadSize": 0,
|
||||
"multiSelection": false,
|
||||
"multiple": false,
|
||||
"otherParams": {
|
||||
"inputType": "multilang",
|
||||
"isBase64": true
|
||||
},
|
||||
"precision": 0,
|
||||
"rules": "required|string",
|
||||
"secretLimit": false,
|
||||
"showOrder": 0,
|
||||
"showTime": false,
|
||||
"stringLength": 0,
|
||||
"supportCancel": false,
|
||||
"tipPosition": "bottom",
|
||||
"value": "E9TEST",
|
||||
"valueList": [],
|
||||
"viewAttr": 1
|
||||
},
|
||||
{
|
||||
"belong": "PC",
|
||||
"checkbox": false,
|
||||
"checkboxValue": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT",
|
||||
"dateGroup": false,
|
||||
"defaultDisplayInBar": false,
|
||||
"detailtype": 1,
|
||||
"domkey": [
|
||||
"companyweb"
|
||||
],
|
||||
"entSearch": false,
|
||||
"fieldcol": 16,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"hide": false,
|
||||
"isBase64": false,
|
||||
"isQuickSearch": false,
|
||||
"label": "公司网站",
|
||||
"labelcol": 8,
|
||||
"length": 0,
|
||||
"maxFilesNumber": 0,
|
||||
"maxUploadSize": 0,
|
||||
"multiSelection": false,
|
||||
"multiple": false,
|
||||
"otherParams": {
|
||||
"inputType": "multilang",
|
||||
"isBase64": true
|
||||
},
|
||||
"precision": 0,
|
||||
"secretLimit": false,
|
||||
"showOrder": 0,
|
||||
"showTime": false,
|
||||
"stringLength": 0,
|
||||
"supportCancel": false,
|
||||
"tipPosition": "bottom",
|
||||
"value": "",
|
||||
"valueList": [],
|
||||
"viewAttr": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
this.setGroupCondition(condition);
|
||||
this.form1.initFormFields(condition);
|
||||
this.getTabInfo();
|
||||
|
||||
}
|
||||
|
||||
getTabInfo() {
|
||||
// Api.getTabInfo().then(res => {
|
||||
// if (res.code === 200) {
|
||||
// res.data.topTabs && this.setTopTab(res.data.topTabs);
|
||||
// res.data.topTabCount && this.setTopTabCount(res.data.topTabCount);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
const topTab = [
|
||||
{
|
||||
"title": "总部信息",
|
||||
"viewCondition": "1"
|
||||
}
|
||||
]
|
||||
this.setTopTab(topTab)
|
||||
}
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
const rightMenu = [
|
||||
{
|
||||
"isTop": "1",
|
||||
"menuFun": "doEdit",
|
||||
"menuIcon": "icon-coms-edit",
|
||||
"menuName": "编辑",
|
||||
"type": "BTN_EDIT"
|
||||
}
|
||||
]
|
||||
const topMenu = [
|
||||
{
|
||||
"isTop": "1",
|
||||
"menuFun": "doEdit",
|
||||
"menuIcon": "icon-coms-edit",
|
||||
"menuName": "编辑",
|
||||
"type": "BTN_EDIT"
|
||||
}
|
||||
]
|
||||
this.setTopMenu(topMenu);
|
||||
this.setRightMenu(rightMenu);
|
||||
// Api.getHasRight().then(res => {
|
||||
// if (res.code === 200) {
|
||||
// res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
// res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
edit() {
|
||||
|
||||
// let params = { ...this.form.getFormParams(), id: this.schemeId };
|
||||
// this.form.validateForm().then(f => {
|
||||
// if (f.isValid) {
|
||||
// Api.edit(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// this.getTableInfo();
|
||||
// this.setVisible(false);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
// } else {
|
||||
// f.showErrors();
|
||||
// this.setDate(new Date());
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
getForm() {
|
||||
let params = {
|
||||
viewattr: 2
|
||||
}
|
||||
|
||||
|
||||
const condition = [
|
||||
{
|
||||
"title": "总部信息",
|
||||
"defaultshow": true,
|
||||
"items": [
|
||||
{
|
||||
"belong": "PC",
|
||||
"checkbox": false,
|
||||
"checkboxValue": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT",
|
||||
"dateGroup": false,
|
||||
"defaultDisplayInBar": false,
|
||||
"detailtype": 1,
|
||||
"domkey": [
|
||||
"companyname"
|
||||
],
|
||||
"entSearch": false,
|
||||
"fieldcol": 16,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"hide": false,
|
||||
"isBase64": false,
|
||||
"isQuickSearch": false,
|
||||
"label": "总部名称",
|
||||
"labelcol": 8,
|
||||
"length": 0,
|
||||
"maxFilesNumber": 0,
|
||||
"maxUploadSize": 0,
|
||||
"multiSelection": false,
|
||||
"multiple": false,
|
||||
"otherParams": {
|
||||
"inputType": "multilang",
|
||||
"isBase64": true
|
||||
},
|
||||
"precision": 0,
|
||||
"rules": "required|string",
|
||||
"secretLimit": false,
|
||||
"showOrder": 0,
|
||||
"showTime": false,
|
||||
"stringLength": 0,
|
||||
"supportCancel": false,
|
||||
"tipPosition": "bottom",
|
||||
"value": "E9TEST",
|
||||
"valueList": [],
|
||||
"viewAttr": 3
|
||||
},
|
||||
{
|
||||
"belong": "PC",
|
||||
"checkbox": false,
|
||||
"checkboxValue": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT",
|
||||
"dateGroup": false,
|
||||
"defaultDisplayInBar": false,
|
||||
"detailtype": 1,
|
||||
"domkey": [
|
||||
"companydesc"
|
||||
],
|
||||
"entSearch": false,
|
||||
"fieldcol": 16,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"hide": false,
|
||||
"isBase64": false,
|
||||
"isQuickSearch": false,
|
||||
"label": "总部全称",
|
||||
"labelcol": 8,
|
||||
"length": 0,
|
||||
"maxFilesNumber": 0,
|
||||
"maxUploadSize": 0,
|
||||
"multiSelection": false,
|
||||
"multiple": false,
|
||||
"otherParams": {
|
||||
"inputType": "multilang",
|
||||
"isBase64": true
|
||||
},
|
||||
"precision": 0,
|
||||
"rules": "required|string",
|
||||
"secretLimit": false,
|
||||
"showOrder": 0,
|
||||
"showTime": false,
|
||||
"stringLength": 0,
|
||||
"supportCancel": false,
|
||||
"tipPosition": "bottom",
|
||||
"value": "E9TEST",
|
||||
"valueList": [],
|
||||
"viewAttr": 3
|
||||
},
|
||||
{
|
||||
"belong": "PC",
|
||||
"checkbox": false,
|
||||
"checkboxValue": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT",
|
||||
"dateGroup": false,
|
||||
"defaultDisplayInBar": false,
|
||||
"detailtype": 1,
|
||||
"domkey": [
|
||||
"companyweb"
|
||||
],
|
||||
"entSearch": false,
|
||||
"fieldcol": 16,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"hide": false,
|
||||
"isBase64": false,
|
||||
"isQuickSearch": false,
|
||||
"label": "公司网站",
|
||||
"labelcol": 8,
|
||||
"length": 0,
|
||||
"maxFilesNumber": 0,
|
||||
"maxUploadSize": 0,
|
||||
"multiSelection": false,
|
||||
"multiple": false,
|
||||
"otherParams": {
|
||||
"inputType": "multilang",
|
||||
"isBase64": true
|
||||
},
|
||||
"precision": 0,
|
||||
"secretLimit": false,
|
||||
"showOrder": 0,
|
||||
"showTime": false,
|
||||
"stringLength": 0,
|
||||
"supportCancel": false,
|
||||
"tipPosition": "bottom",
|
||||
"value": "",
|
||||
"valueList": [],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
this.setCondition(condition);
|
||||
this.form.initFormFields(condition);
|
||||
this.setDialogLoadingStatus(false);
|
||||
// this.setDialogLoadingStatus(true);
|
||||
|
||||
// Api.getSchemeForm(params).then(res => {
|
||||
// if (res.code === 200) {
|
||||
// this.setDialogLoadingStatus(false);
|
||||
// res.data.condition && this.setCondition(res.data.condition);
|
||||
// res.data.condition && this.form.initFormFields(res.data.condition);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
this.setSelectedKey(key);
|
||||
}
|
||||
|
||||
|
||||
setVisible(bool) {
|
||||
this.visible = bool;
|
||||
}
|
||||
|
||||
setGroupCondition(groupCondition) {
|
||||
this.groupCondition = groupCondition
|
||||
}
|
||||
|
||||
setCondition(condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
setTopMenu(topMenu) {
|
||||
this.topMenu = topMenu;
|
||||
}
|
||||
|
||||
setRightMenu(rightMenu) {
|
||||
this.rightMenu = rightMenu;
|
||||
}
|
||||
|
||||
setTopTab(topTab) {
|
||||
this.topTab = topTab;
|
||||
}
|
||||
|
||||
setNeDialogTitle(title) {
|
||||
this.nEdialogTitle = title;
|
||||
}
|
||||
|
||||
setDialogLoadingStatus(bool) {
|
||||
this.dialogLoading = bool;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ import { RankSchemeStore } from "./rankscheme";
|
|||
import { JobLevelStore } from "./joblevel";
|
||||
import { JobGradeStore } from "./jobgrade";
|
||||
import { OfficeManageStore } from "./officeManage";
|
||||
import { SequenceStore } from "./sequence";
|
||||
import { GroupStore } from "./group";
|
||||
|
||||
module.exports = {
|
||||
simpleOrgStore: new SimpleOrgStore(),
|
||||
|
|
@ -12,4 +14,6 @@ module.exports = {
|
|||
jobLevel: new JobLevelStore(),
|
||||
jobGrade: new JobGradeStore(),
|
||||
officeManageStore: new OfficeManageStore(),
|
||||
sequence: new SequenceStore(),
|
||||
group: new GroupStore(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ export class JobGradeStore {
|
|||
@observable dialogLoading = true;
|
||||
@observable gradeId = '';
|
||||
@observable date = '';
|
||||
@observable selectedKey = 0;
|
||||
@observable selectedKey = -1;
|
||||
@observable topTab = [];
|
||||
@observable topTabCount = {};
|
||||
@observable key = '';//
|
||||
|
||||
|
||||
|
||||
|
|
@ -52,95 +55,113 @@ export class JobGradeStore {
|
|||
getTableInfo() {
|
||||
let params;
|
||||
this.tableStore = new TableStore();
|
||||
// if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
// params = {
|
||||
// ...this.form2.getFormParams(),
|
||||
// gradeName: this.gradeName
|
||||
// };
|
||||
// } else {
|
||||
// params = {
|
||||
// ...this.form2.getFormParams()
|
||||
// };
|
||||
// }
|
||||
// Api.getSearchList(params).then(res => {
|
||||
// if (res.code === 200) {
|
||||
// res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
gradeName: this.gradeName,
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
}
|
||||
Api.getSearchList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
//获取tab信息
|
||||
this.getTabInfo();
|
||||
|
||||
}
|
||||
|
||||
@action
|
||||
getTabInfo() {
|
||||
Api.getTabInfo().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.topTabs && this.setTopTab(res.data.topTabs);
|
||||
res.data.topTabCount && this.setTopTabCount(res.data.topTabCount);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
delete() {
|
||||
let params = {
|
||||
ids: this.ids
|
||||
};
|
||||
// Api.deleteTableData(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(i18n.message.deleteSuccess());
|
||||
// this.getTableInfo();
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.deleteTableData(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(i18n.message.deleteSuccess());
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
save() {
|
||||
let params = {
|
||||
...this.form.getFormParams()
|
||||
};
|
||||
// this.form.validateForm().then(f => {
|
||||
// if (f.isValid) {
|
||||
// Api.add(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// this.getTableInfo();
|
||||
// this.setVisible(false);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
// } else {
|
||||
// f.showErrors();
|
||||
// this.setDate(new Date());
|
||||
// }
|
||||
// });
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.add(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
edit() {
|
||||
let params = { ...this.form.getFormParams(), id: this.gradeId };
|
||||
// this.form.validateForm().then(f => {
|
||||
// if (f.isValid) {
|
||||
// Api.edit(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// this.getTableInfo();
|
||||
// this.setVisible(false);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
// } else {
|
||||
// f.showErrors();
|
||||
// this.setDate(new Date());
|
||||
// }
|
||||
// });
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.edit(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked, id) {
|
||||
|
|
@ -148,17 +169,17 @@ export class JobGradeStore {
|
|||
forbiddenTag: checked,
|
||||
id: id
|
||||
}
|
||||
// Api.updateForbiddenTag(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.updateForbiddenTag(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
getForm() {
|
||||
|
|
@ -166,82 +187,48 @@ export class JobGradeStore {
|
|||
id: this.gradeId
|
||||
}
|
||||
this.setDialogLoadingStatus(true);
|
||||
// Api.getSchemeForm(params).then(res => {
|
||||
// if (res.code === 200) {
|
||||
// this.setDialogLoadingStatus(false);
|
||||
// res.data.condition && this.setCondition(res.data.condition);
|
||||
// res.data.condition && this.form.initFormFields(res.data.condition);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.getGradeForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setDialogLoadingStatus(false);
|
||||
res.data.condition && this.setCondition(res.data.condition);
|
||||
res.data.condition && this.form.initFormFields(res.data.condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getSearchCondition() {
|
||||
this.setScLoadingStatus(false);
|
||||
// Api.getAdvanceSearchCondition().then(res => {
|
||||
// if (res.code === 200) {
|
||||
// this.setScLoadingStatus(false);
|
||||
// res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||
// res.data.conditions && this.form2.initFormFields(res.data.conditions);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.getAdvanceSearchCondition().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setScLoadingStatus(false);
|
||||
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||
res.data.conditions && this.form2.initFormFields(res.data.conditions);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
this.topMenu = [
|
||||
{
|
||||
"isBatch": "1",
|
||||
"isTop": "1",
|
||||
"menuFun": "new",
|
||||
"menuIcon": "icon-coms-New-Flow",
|
||||
"menuName": "新建",
|
||||
"type": "BTN_Addnew"
|
||||
},
|
||||
{
|
||||
"isBatch": "1",
|
||||
"isTop": "1",
|
||||
"menuFun": "batchDelete",
|
||||
"menuIcon": "icon-coms-Batch-delete",
|
||||
"menuName": "批量删除",
|
||||
"type": "BTN_BatchDelete"
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
];
|
||||
this.rightMenu = [
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "1",
|
||||
"menuFun": "new",
|
||||
"menuIcon": "icon-coms-New-Flow",
|
||||
"menuName": "新建",
|
||||
"type": "BTN_Addnew"
|
||||
},
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "0",
|
||||
"menuFun": "log",
|
||||
"menuIcon": "icon-coms-Print-log",
|
||||
"menuName": "日志",
|
||||
"type": "BTN_log"
|
||||
},
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "0",
|
||||
"menuFun": "custom",
|
||||
"menuIcon": "icon-coms-task-list",
|
||||
"menuName": "显示列定制",
|
||||
"type": "BTN_COLUMN"
|
||||
}
|
||||
]
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
|
|
@ -252,6 +239,47 @@ export class JobGradeStore {
|
|||
});
|
||||
}
|
||||
|
||||
updateConditions(val) {
|
||||
let currenttime = Date.now();
|
||||
let key = `schemId_${currenttime}`;
|
||||
const lastKey = this.key;
|
||||
// let conditions = [];
|
||||
// this.condition[0].items.map(item => {
|
||||
// if(item.domkey[0] === 'levelId') {
|
||||
// Reflect.deleteProperty(item.browserConditionParam.dataParams,lastKey)
|
||||
// this.setKey(key);
|
||||
// //completeParams conditionDataParams
|
||||
// item.browserConditionParam.dataParams = {
|
||||
// [key]:val,
|
||||
// ...item.browserConditionParam.dataParams,
|
||||
// currenttime: currenttime
|
||||
// }
|
||||
// }
|
||||
// conditions.push(item);
|
||||
// })
|
||||
|
||||
Reflect.deleteProperty(this.condition[0].items[4].browserConditionParam.dataParams,lastKey)
|
||||
this.setKey(key);
|
||||
this.condition[0].items[4].browserConditionParam.dataParams = {
|
||||
[key]:val,
|
||||
...this.condition[0].items[4].browserConditionParam.dataParams,
|
||||
currenttime: currenttime
|
||||
}
|
||||
this.form.updateFields({
|
||||
levelId: {
|
||||
value: ''
|
||||
}
|
||||
});
|
||||
|
||||
this.setCondition(this.condition);
|
||||
}
|
||||
|
||||
|
||||
changeData(key) {
|
||||
this.setSelectedKey(key);
|
||||
this.getTableInfo();
|
||||
}
|
||||
|
||||
setSearchCondition(condition) {
|
||||
this.searchCondition = condition;
|
||||
}
|
||||
|
|
@ -330,4 +358,24 @@ export class JobGradeStore {
|
|||
this.selectedKey = selectedKey;
|
||||
}
|
||||
|
||||
setTopTab(topTab) {
|
||||
this.topTab = topTab;
|
||||
}
|
||||
|
||||
setTopTabCount(topTabCount) {
|
||||
this.topTabCount = topTabCount;
|
||||
}
|
||||
|
||||
setTopMenu(topMenu) {
|
||||
this.topMenu = topMenu;
|
||||
}
|
||||
|
||||
setRightMenu(rightMenu) {
|
||||
this.rightMenu = rightMenu;
|
||||
}
|
||||
|
||||
setKey (key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -44,7 +44,9 @@ export class JobLevelStore {
|
|||
@observable dialogLoading = true;
|
||||
@observable levelId = '';
|
||||
@observable date = '';
|
||||
@observable selectedKey = 0;
|
||||
@observable selectedKey = -1;
|
||||
@observable topTab = [];
|
||||
@observable topTabCount = {};
|
||||
|
||||
|
||||
|
||||
|
|
@ -52,25 +54,29 @@ export class JobLevelStore {
|
|||
getTableInfo() {
|
||||
let params;
|
||||
this.tableStore = new TableStore();
|
||||
// if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
// params = {
|
||||
// ...this.form2.getFormParams(),
|
||||
// levelName: this.levelName
|
||||
// };
|
||||
// } else {
|
||||
// params = {
|
||||
// ...this.form2.getFormParams()
|
||||
// };
|
||||
// }
|
||||
// Api.getSearchList(params).then(res => {
|
||||
// if (res.code === 200) {
|
||||
// res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
levelName: this.levelName,
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
viewCondition:this.selectedKey
|
||||
};
|
||||
}
|
||||
Api.getSearchList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
//获取tab信息
|
||||
this.getTabInfo();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -79,68 +85,73 @@ export class JobLevelStore {
|
|||
let params = {
|
||||
ids: this.ids
|
||||
};
|
||||
// Api.deleteTableData(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(i18n.message.deleteSuccess());
|
||||
// this.getTableInfo();
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.deleteTableData(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(i18n.message.deleteSuccess());
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
save() {
|
||||
let params = {
|
||||
...this.form.getFormParams()
|
||||
};
|
||||
// this.form.validateForm().then(f => {
|
||||
// if (f.isValid) {
|
||||
// Api.add(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// this.getTableInfo();
|
||||
// this.setVisible(false);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
// } else {
|
||||
// f.showErrors();
|
||||
// this.setDate(new Date());
|
||||
// }
|
||||
// });
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.add(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
edit() {
|
||||
let params = { ...this.form.getFormParams(), id: this.levelId };
|
||||
// this.form.validateForm().then(f => {
|
||||
// if (f.isValid) {
|
||||
// Api.edit(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// this.getTableInfo();
|
||||
// this.setVisible(false);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
// } else {
|
||||
// f.showErrors();
|
||||
// this.setDate(new Date());
|
||||
// }
|
||||
// });
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.edit(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
this.setSelectedKey(key);
|
||||
this.getTableInfo();
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked, id) {
|
||||
|
|
@ -148,17 +159,17 @@ export class JobLevelStore {
|
|||
forbiddenTag: checked,
|
||||
id: id
|
||||
}
|
||||
// Api.updateForbiddenTag(params).then(response => {
|
||||
// return response.json()
|
||||
// }).then(data => {
|
||||
// if (data.code === 200) {
|
||||
// message.success(data.msg);
|
||||
// } else {
|
||||
// message.warning(data.msg);
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.updateForbiddenTag(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
getForm() {
|
||||
|
|
@ -166,82 +177,62 @@ export class JobLevelStore {
|
|||
id: this.levelId
|
||||
}
|
||||
this.setDialogLoadingStatus(true);
|
||||
// Api.getSchemeForm(params).then(res => {
|
||||
// if (res.code === 200) {
|
||||
// this.setDialogLoadingStatus(false);
|
||||
// res.data.condition && this.setCondition(res.data.condition);
|
||||
// res.data.condition && this.form.initFormFields(res.data.condition);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.getLevelForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setDialogLoadingStatus(false);
|
||||
res.data.condition && this.setCondition(res.data.condition);
|
||||
res.data.condition && this.form.initFormFields(res.data.condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getSearchCondition() {
|
||||
this.setScLoadingStatus(false);
|
||||
// Api.getAdvanceSearchCondition().then(res => {
|
||||
// if (res.code === 200) {
|
||||
// this.setScLoadingStatus(false);
|
||||
// res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||
// res.data.conditions && this.form2.initFormFields(res.data.conditions);
|
||||
// } else {
|
||||
// message.warning(res.msg);
|
||||
// }
|
||||
// }, error => {
|
||||
// message.warning(error.msg);
|
||||
// })
|
||||
Api.getAdvanceSearchCondition().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setScLoadingStatus(false);
|
||||
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||
res.data.conditions && this.form2.initFormFields(res.data.conditions);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
@action
|
||||
getTabInfo() {
|
||||
Api.getTabInfo().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.topTabs && this.setTopTab(res.data.topTabs);
|
||||
res.data.topTabCount && this.setTopTabCount(res.data.topTabCount);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
this.topMenu = [
|
||||
{
|
||||
"isBatch": "1",
|
||||
"isTop": "1",
|
||||
"menuFun": "new",
|
||||
"menuIcon": "icon-coms-New-Flow",
|
||||
"menuName": "新建",
|
||||
"type": "BTN_Addnew"
|
||||
},
|
||||
{
|
||||
"isBatch": "1",
|
||||
"isTop": "1",
|
||||
"menuFun": "batchDelete",
|
||||
"menuIcon": "icon-coms-Batch-delete",
|
||||
"menuName": "批量删除",
|
||||
"type": "BTN_BatchDelete"
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
];
|
||||
this.rightMenu = [
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "1",
|
||||
"menuFun": "new",
|
||||
"menuIcon": "icon-coms-New-Flow",
|
||||
"menuName": "新建",
|
||||
"type": "BTN_Addnew"
|
||||
},
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "0",
|
||||
"menuFun": "log",
|
||||
"menuIcon": "icon-coms-Print-log",
|
||||
"menuName": "日志",
|
||||
"type": "BTN_log"
|
||||
},
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "0",
|
||||
"menuFun": "custom",
|
||||
"menuIcon": "icon-coms-task-list",
|
||||
"menuName": "显示列定制",
|
||||
"type": "BTN_COLUMN"
|
||||
}
|
||||
]
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
|
|
@ -330,4 +321,20 @@ export class JobLevelStore {
|
|||
this.selectedKey = selectedKey;
|
||||
}
|
||||
|
||||
setTopTab(topTab) {
|
||||
this.topTab = topTab;
|
||||
}
|
||||
|
||||
setTopTabCount(topTabCount) {
|
||||
this.topTabCount = topTabCount;
|
||||
}
|
||||
|
||||
setTopMenu(topMenu) {
|
||||
this.topMenu = topMenu;
|
||||
}
|
||||
|
||||
setRightMenu(rightMenu) {
|
||||
this.rightMenu = rightMenu;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -123,7 +123,6 @@ export class RankSchemeStore {
|
|||
|
||||
edit() {
|
||||
let params = { ...this.form.getFormParams(), id: this.schemeId };
|
||||
debugger
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.edit(params).then(response => {
|
||||
|
|
@ -202,51 +201,17 @@ export class RankSchemeStore {
|
|||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
this.topMenu = [
|
||||
{
|
||||
"isBatch": "1",
|
||||
"isTop": "1",
|
||||
"menuFun": "new",
|
||||
"menuIcon": "icon-coms-New-Flow",
|
||||
"menuName": "新建",
|
||||
"type": "BTN_Addnew"
|
||||
},
|
||||
{
|
||||
"isBatch": "1",
|
||||
"isTop": "1",
|
||||
"menuFun": "batchDelete",
|
||||
"menuIcon": "icon-coms-Batch-delete",
|
||||
"menuName": "批量删除",
|
||||
"type": "BTN_BatchDelete"
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
];
|
||||
this.rightMenu = [
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "1",
|
||||
"menuFun": "new",
|
||||
"menuIcon": "icon-coms-New-Flow",
|
||||
"menuName": "新建",
|
||||
"type": "BTN_Addnew"
|
||||
},
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "0",
|
||||
"menuFun": "log",
|
||||
"menuIcon": "icon-coms-Print-log",
|
||||
"menuName": "日志",
|
||||
"type": "BTN_log"
|
||||
},
|
||||
{
|
||||
"isBatch": "0",
|
||||
"isTop": "0",
|
||||
"menuFun": "custom",
|
||||
"menuIcon": "icon-coms-task-list",
|
||||
"menuName": "显示列定制",
|
||||
"type": "BTN_COLUMN"
|
||||
}
|
||||
]
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
|
|
@ -331,4 +296,12 @@ export class RankSchemeStore {
|
|||
this.date = date;
|
||||
}
|
||||
|
||||
setTopMenu(topMenu) {
|
||||
this.topMenu = topMenu;
|
||||
}
|
||||
|
||||
setRightMenu(rightMenu) {
|
||||
this.rightMenu = rightMenu;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,340 @@
|
|||
import {
|
||||
observable,
|
||||
action
|
||||
} from 'mobx';
|
||||
import * as mobx from 'mobx';
|
||||
import * as Api from '../apis/sequence'; // 引入API接口文件
|
||||
import {
|
||||
WeaForm
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
WeaTableNew
|
||||
} from 'comsMobx';
|
||||
import {
|
||||
Modal,
|
||||
message,
|
||||
} from 'antd'
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
const {
|
||||
TableStore
|
||||
} = WeaTableNew;
|
||||
|
||||
export class SequenceStore {
|
||||
@observable tableStore = new TableStore();
|
||||
@observable topMenu = []
|
||||
@observable rightMenu = [];
|
||||
@observable condition = [];
|
||||
@observable searchCondition = [];
|
||||
@observable isEdit = true;
|
||||
@observable isNew = true;
|
||||
@observable isPanelShow = false; //高级搜索面板
|
||||
@observable form2 = new WeaForm();
|
||||
@observable form = new WeaForm();
|
||||
@observable form1 = new WeaForm();
|
||||
@observable sequenceName = '';
|
||||
@observable conditionNum = 2;
|
||||
@observable ids = ''; //选择行id
|
||||
@observable searchConditionLoading = true;
|
||||
@observable nEdialogTitle = '';
|
||||
@observable visible = false;
|
||||
@observable dialogLoading = true;
|
||||
@observable sequenceId = '';
|
||||
@observable date = '';
|
||||
@observable selectedKey = -1;
|
||||
@observable topTab = [];
|
||||
@observable topTabCount = {};
|
||||
|
||||
|
||||
|
||||
@action
|
||||
getTableInfo() {
|
||||
let params;
|
||||
this.tableStore = new TableStore();
|
||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
sequenceName: this.sequenceName,
|
||||
viewcondition:this.selectedKey
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
...this.form2.getFormParams(),
|
||||
viewcondition:this.selectedKey
|
||||
};
|
||||
}
|
||||
Api.getSearchList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
//获取tab信息
|
||||
this.getTabInfo();
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
delete() {
|
||||
let params = {
|
||||
ids: this.ids
|
||||
};
|
||||
Api.deleteTableData(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(i18n.message.deleteSuccess());
|
||||
this.getTableInfo();
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
save() {
|
||||
let params = {
|
||||
...this.form.getFormParams()
|
||||
};
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.add(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
edit() {
|
||||
let params = { ...this.form.getFormParams(), id: this.sequenceId };
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
Api.edit(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
this.getTableInfo();
|
||||
this.setVisible(false);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setDate(new Date());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
this.setSelectedKey(key);
|
||||
this.getTableInfo();
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked, id) {
|
||||
let params = {
|
||||
forbiddenTag: checked,
|
||||
id: id
|
||||
}
|
||||
Api.updateForbiddenTag(params).then(response => {
|
||||
return response.json()
|
||||
}).then(data => {
|
||||
if (data.code === 200) {
|
||||
message.success(data.msg);
|
||||
} else {
|
||||
message.warning(data.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
getForm() {
|
||||
let params = this.isNew ? {} : {
|
||||
id: this.sequenceId
|
||||
}
|
||||
this.setDialogLoadingStatus(true);
|
||||
Api.getSequenceForm(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setDialogLoadingStatus(false);
|
||||
res.data.condition && this.setCondition(res.data.condition);
|
||||
res.data.condition && this.form.initFormFields(res.data.condition);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getSearchCondition() {
|
||||
this.setScLoadingStatus(false);
|
||||
Api.getAdvanceSearchCondition().then(res => {
|
||||
if (res.code === 200) {
|
||||
this.setScLoadingStatus(false);
|
||||
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
||||
res.data.conditions && this.form2.initFormFields(res.data.conditions);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
@action
|
||||
getTabInfo() {
|
||||
Api.getTabInfo().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.topTabs && this.setTopTab(res.data.topTabs);
|
||||
res.data.topTabCount && this.setTopTabCount(res.data.topTabCount);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@action
|
||||
getHasRight() {
|
||||
Api.getHasRight().then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
||||
res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form2.updateFields({
|
||||
sequenceName: {
|
||||
value: val
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setSearchCondition(condition) {
|
||||
this.searchCondition = condition;
|
||||
}
|
||||
|
||||
setScLoadingStatus(bool) {
|
||||
this.searchConditionLoading = bool;
|
||||
}
|
||||
|
||||
setPanelStatus(bool) {
|
||||
this.isPanelShow = bool;
|
||||
bool && this.getSearchCondition();
|
||||
if (!bool) {
|
||||
this.scLoadingReset();
|
||||
}
|
||||
}
|
||||
|
||||
setSequenceName(val) {
|
||||
this.sequenceName = val;
|
||||
}
|
||||
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
setIds(ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
|
||||
scLoadingReset() {
|
||||
this.searchConditionLoading = true;
|
||||
}
|
||||
|
||||
|
||||
formReset() {
|
||||
this.form = new WeaForm();
|
||||
}
|
||||
|
||||
dialogLoadingReset() {
|
||||
this.dialogLoading = true;
|
||||
}
|
||||
|
||||
setVisible(bool) {
|
||||
this.visible = bool;
|
||||
this.formReset();
|
||||
!bool && this.dialogLoadingReset();
|
||||
}
|
||||
|
||||
setDialogLoadingStatus(bool) {
|
||||
this.dialogLoading = bool;
|
||||
}
|
||||
|
||||
setNeDialogTitle(title) {
|
||||
this.nEdialogTitle = title;
|
||||
}
|
||||
|
||||
setIsNew(bool) {
|
||||
this.isNew = bool;
|
||||
}
|
||||
|
||||
setCondition(condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
setSequenceId(sequenceId) {
|
||||
this.sequenceId = sequenceId;
|
||||
}
|
||||
|
||||
setDate(date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
setSelectedKey(selectedKey) {
|
||||
this.selectedKey = selectedKey;
|
||||
}
|
||||
|
||||
setTopTab(topTab) {
|
||||
this.topTab = topTab;
|
||||
}
|
||||
|
||||
setTopTabCount(topTabCount) {
|
||||
this.topTabCount = topTabCount;
|
||||
}
|
||||
|
||||
setTopMenu(topMenu) {
|
||||
this.topMenu = topMenu;
|
||||
}
|
||||
|
||||
setRightMenu(rightMenu) {
|
||||
this.rightMenu = rightMenu;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +1,32 @@
|
|||
/* 公共样式 */
|
||||
.hrm-loading-center-small{
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
margin-left:-8px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
||||
.hrm-dialog-form{
|
||||
padding-top: 27px;
|
||||
padding-right: 8%;
|
||||
padding-left: 8%;
|
||||
padding-bottom: 25px;
|
||||
|
||||
.wea-upload-list-item {
|
||||
& > div{
|
||||
width: 400px !important;
|
||||
line-height: 30px;
|
||||
}
|
||||
.hrm-loading-center-small {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
||||
.hrm-dialog-form {
|
||||
padding-top: 27px;
|
||||
padding-right: 8%;
|
||||
padding-left: 8%;
|
||||
padding-bottom: 25px;
|
||||
|
||||
.wea-upload-list-item {
|
||||
&>div {
|
||||
width: 400px !important;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//集团管理
|
||||
.organization-group {
|
||||
padding-left: 25%;
|
||||
padding-right: 25%;
|
||||
padding-top: 28px;
|
||||
height: calc(100% - 47px);
|
||||
overflow: auto;
|
||||
}
|
||||
Loading…
Reference in New Issue