岗位剩余接口对接

This commit is contained in:
Chengliang 2022-06-01 16:22:56 +08:00
parent 24d9f3bc9e
commit 064c40d299
9 changed files with 584 additions and 481 deletions

View File

@ -4,8 +4,7 @@ import {
} from 'ecCom' } from 'ecCom'
export const getSearchList = (params) => { export const getSearchList = (params) => {
//return WeaTools.callApi('/api/bs/hrmorganization/comp/listComp', 'POST', params); return fetch('/api/bs/hrmorganization/job/listPage', {
return fetch('/api/bs/hrmorganization/comp/listComp', {
method: 'POST', method: 'POST',
mode: 'cors', mode: 'cors',
headers: { headers: {
@ -15,20 +14,8 @@ export const getSearchList = (params) => {
}) })
} }
export const getDeptListByPid = (params) => {
return fetch('/api/bs/hrmorganization/dept/getDeptListByPid', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const deleteTableData = (params) => { export const deleteTableData = (params) => {
return fetch('/api/bs/hrmorganization/comp/deleteByIds', { return fetch('/api/bs/hrmorganization/job/deleteByIds', {
method: 'POST', method: 'POST',
mode: 'cors', mode: 'cors',
headers: { headers: {
@ -39,11 +26,30 @@ export const deleteTableData = (params) => {
} }
export const getAdvanceSearchCondition = (params) => { export const getAdvanceSearchCondition = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getSearchCondition', 'GET', params); return WeaTools.callApi('/api/bs/hrmorganization/job/getSearchCondition', 'GET', params);
}
export const getHrmListByJobId = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/job/getHrmListByJobId', 'GET', params);
}
export const getCopyForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/job/getCopyForm', 'GET', params);
} }
export const add = (params) => { export const add = (params) => {
return fetch('/api/bs/hrmorganization/comp/saveBaseComp', { return fetch('/api/bs/hrmorganization/job/saveBaseForm', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const copy = (params) => {
return fetch('/api/bs/hrmorganization/job/copyJobItem', {
method: 'POST', method: 'POST',
mode: 'cors', mode: 'cors',
headers: { headers: {
@ -54,19 +60,11 @@ export const add = (params) => {
} }
export const editResource = (params) => { export const editResource = (params) => {
// return fetch('/api/bs/hrmorganization/comp/updateComp', { return WeaTools.callApi('/api/bs/hrmorganization/job/updateForm', 'POST', params);
// method: 'POST',
// mode: 'cors',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify(params)
// })
return WeaTools.callApi('/api/bs/hrmorganization/comp/updateComp', 'POST', params);
} }
export const updateForbiddenTag = (params) => { export const updateForbiddenTag = (params) => {
return fetch('/api/bs/hrmorganization/comp/updateForbiddenTagById', { return fetch('/api/bs/hrmorganization/job/updateForbiddenTagById', {
method: 'POST', method: 'POST',
mode: 'cors', mode: 'cors',
headers: { headers: {
@ -76,16 +74,16 @@ export const updateForbiddenTag = (params) => {
}) })
} }
export const getCompanyForm = (params) => { export const getJobForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompSaveForm', 'GET', params); return WeaTools.callApi('/api/bs/hrmorganization/job/getSaveForm', 'GET', params);
} }
export const getCompanyExtendForm = (params) => { export const getJobExtendForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params); return WeaTools.callApi('/api/bs/hrmorganization/job/getJobBaseForm', 'GET', params);
} }
export const getHasRight = (params) => { export const getHasRight = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getHasRight', 'GET', params); return WeaTools.callApi('/api/bs/hrmorganization/job/getHasRight', 'GET', params);
} }

View File

@ -1,69 +0,0 @@
import {
WeaNewScroll,
WeaSearchGroup,
WeaMoreButton,
WeaTable
} from 'ecCom'
import {
Spin,
Button,
Pagination
} from 'antd'
import {
WeaSwitch
} from 'comsMobx'
import {
i18n
} from '../public/i18n';
import '../style/common.less';
export default class NewWeaTable extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
dataSource,
columns,
rowSelection,
loading,
indentSize
} = this.props
const pagination = {
total: dataSource.length,
showSizeChanger: true,
showQuickJumper: true,
onShowSizeChange(current, pageSize) {
},
onChange(current) {
},
showTotal(total){
return `${total}`
}
};
return (
loading ? <div className='hrm-new-weatable-spin'>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
</div> :
<WeaTable rowKey={record => record.id}
dataSource={dataSource} childrenColumnName="children"
columns={columns}
rowSelection={rowSelection}
pagination={pagination}
loading={loading}
indentSize={indentSize}
/>
)
}
}

View File

@ -0,0 +1,71 @@
import {
WeaNewScroll,
WeaSearchGroup,
WeaMoreButton,
WeaDialog
} from 'ecCom'
import {
Spin,
Button,
Pagination
} from 'antd'
import {
WeaSwitch,
WeaTableNew
} from 'comsMobx'
import {
i18n
} from '../public/i18n';
import '../style/common.less';
const WeaTable = WeaTableNew.WeaTable;
export default class NewWeaTableDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
width: 800,
}
}
render() {
const {
title,
visible,
onCancel,
height,
tableStore
} = this.props, {
width,
} = this.state;
const buttons = [
//(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.save()}</Button>),
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@e4f4n1`} />)
];
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1txk5f`}
title={title}
icon="icon-coms-hrm"
iconBgcolor="#217346"
visible={visible}
closable={true}
hasScroll={true}
onCancel={() => onCancel()}
buttons={buttons}
style={{ width: width, height: height }}
>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
comsWeaTableStore={tableStore}
hasOrder={true}
needScroll={true}
/>
</WeaDialog>
)
}
}

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-18 16:23:32 * @Date: 2022-05-18 16:23:32
* @LastEditTime: 2022-05-27 15:05:49 * @LastEditTime: 2022-06-01 11:51:20
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
*/ */
@ -40,7 +40,7 @@ import '../../style/common.less';
import NewTableDialog from '../NewTableDialog'; import NewTableDialog from '../NewTableDialog';
import NewAndEditDialog from '../NewAndEditDialog'; import NewAndEditDialog from '../NewAndEditDialog';
import NewWeaTable from '../NewWeaTable'; import NewWeaTable from '../NewWeaTableDialog';
import { renderLoading } from '../../util'; // 从util文件引入公共的方法 import { renderLoading } from '../../util'; // 从util文件引入公共的方法

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-26 14:05:59 * @Date: 2022-05-26 14:05:59
* @LastEditTime: 2022-05-30 17:08:21 * @LastEditTime: 2022-06-01 16:18:15
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/job.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/job.js
*/ */
@ -40,9 +40,8 @@ import {
import '../../style/common.less'; import '../../style/common.less';
import NewTableDialog from '../NewTableDialog';
import NewAndEditDialog from '../NewAndEditDialog'; import NewAndEditDialog from '../NewAndEditDialog';
import NewWeaTable from '../NewWeaTable'; import NewWeaTableDialog from '../NewWeaTableDialog';
import { renderLoading } from '../../util'; // 从util文件引入公共的方法 import { renderLoading } from '../../util'; // 从util文件引入公共的方法
@ -82,6 +81,7 @@ export default class Job extends React.Component {
} = this.props; } = this.props;
job.getTableInfo(); job.getTableInfo();
job.getHasRight(); job.getHasRight();
job.getCopyForm();
} }
getTopMenuBtns() { getTopMenuBtns() {
@ -95,10 +95,13 @@ export default class Job extends React.Component {
let btns = []; let btns = [];
topMenu.map((item, i) => { topMenu.map((item, i) => {
if (item.menuFun !== 'batchDelete') { 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={selectedRowKeys.length > 0 ? false : true} >{item.menuName}</Button>); btns.push(<Button type='primary' onClick={() => this.handleClick(item)} disabled={selectedRowKeys.length > 0 ? false : true} >{item.menuName}</Button>);
} else if (item.menuFun === 'copy') {
btns.push(<Button type='primary' onClick={() => this.handleClick(item)} disabled={selectedRowKeys.length > 0 ? false : true} >{item.menuName}</Button>);
} else {
btns.push(<Button type='primary' onClick={() => this.handleClick(item)}>{item.menuName}</Button>);
} }
}); });
@ -125,20 +128,70 @@ export default class Job extends React.Component {
job.setNeDialogTitle(i18n.label.jobName()); job.setNeDialogTitle(i18n.label.jobName());
job.setNewVisible(true); job.setNewVisible(true);
job.getCompanyForm(); job.getJobForm();
} }
//联查部门 //联查人员
select(id) { select(id) {
const { const {
job job
} = this.props; } = this.props;
job.setNeDialogTitle(i18n.label.jobName()); job.setNeDialogTitle("联查人员");
job.setVisible(true); job.setVisible(true);
job.setDialogLoadingStatus(true); job.getHrmTable(id);
job.getDeptTable(id); }
copy() {
const {
job
} = this.props;
const {
selectedRowKeys
} = job;
let keys = toJS(selectedRowKeys).toString();
job.setIds(keys);
confirm({
title: i18n.confirm.defaultTitle(),
content: this.getCopyForm(),
okText: i18n.button.ok(),
cancelText: i18n.button.cancel(),
onOk() {
job.copy()
},
onCancel() {
return false;
},
});
}
getCopyForm() {
const {
job
} = this.props;
const {
copyCondition,
form2,
} = job;
let formParams = form2.getFormParams();
const {
isFormInit
} = form2;
let arr = [];
isFormInit && copyCondition.map(c => {
c.items.map((field, index) => {
arr.push(
<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>
)
})
})
return arr;
} }
batchDelete() { batchDelete() {
@ -210,6 +263,13 @@ export default class Job extends React.Component {
this[key] && this[key](); this[key] && this[key]();
} }
updateForbiddenTag(checked, id) {
const {
job
} = this.props;
job.updateForbiddenTag(checked, id);
}
onSearchChange(val) { onSearchChange(val) {
@ -220,7 +280,7 @@ export default class Job extends React.Component {
form form
} = job; } = job;
job.setCompanyName(val); job.setJobName(val);
!this.isEmptyObject(form.getFormParams()) && job.updateFields(val); !this.isEmptyObject(form.getFormParams()) && job.updateFields(val);
} }
@ -236,7 +296,7 @@ export default class Job extends React.Component {
return <Switch defaultChecked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} /> return <Switch defaultChecked={record.forbiddenTag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
} }
}; };
if (c.dataIndex == 'compName') { if (c.dataIndex == 'jobName') {
c.render = function (text, record) { c.render = function (text, record) {
return <a href='javascript:void(0);' onClick={() => { return <a href='javascript:void(0);' onClick={() => {
window.open(`/spa/organization/static/index.html#/main/organization/jobExtend/${record.id}`, "_blank") window.open(`/spa/organization/static/index.html#/main/organization/jobExtend/${record.id}`, "_blank")
@ -253,7 +313,7 @@ export default class Job extends React.Component {
<a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a> <a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
</Menu.Item> </Menu.Item>
<Menu.Item> <Menu.Item>
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查部门</a> <a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查人员</a>
</Menu.Item> </Menu.Item>
</Menu> </Menu>
) )
@ -504,13 +564,11 @@ export default class Job extends React.Component {
</WeaLeftRightLayout> </WeaLeftRightLayout>
</WeaTop> </WeaTop>
</WeaRightMenu> </WeaRightMenu>
<NewTableDialog ecId={`${this && this.props && this.props.ecId || ''}_NewTableDialog@q4rrwm`} <NewWeaTableDialog ecId={`${this && this.props && this.props.ecId || ''}_NewTableDialog@q4rrwm`}
title={nEdialogTitle} title={nEdialogTitle}
visible={visible} visible={visible}
loading={dialogLoading}
height={400} height={400}
dataSource={deptDataSource} //联查部门数据 tableStore={tableStore}
columns={deptColumns}
onCancel={() => job.setVisible(false)} onCancel={() => job.setVisible(false)}
/> />
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`} <NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
@ -522,7 +580,7 @@ export default class Job extends React.Component {
loading={dialogLoading} loading={dialogLoading}
isEdit={isEdit} isEdit={isEdit}
height={300} height={300}
conditionLen={4} conditionLen={13}
save={() => this.handleSave()} save={() => this.handleSave()}
onCancel={() => job.setNewVisible(false)} onCancel={() => job.setNewVisible(false)}
enable={false} //是否开启字段联动 enable={false} //是否开启字段联动

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-26 14:07:12 * @Date: 2022-05-26 14:07:12
* @LastEditTime: 2022-05-30 17:04:50 * @LastEditTime: 2022-05-30 17:16:47
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/JobExtend.js
*/ */
@ -21,7 +21,7 @@
@inject('jobExtend') @inject('jobExtend')
@inject('company') @inject('job')
@observer @observer
export default class JobExtend extends React.Component { export default class JobExtend extends React.Component {
@ -29,8 +29,7 @@
this.init(); this.init();
} }
init = () => { init = () => {
const { jobExtend,company } = this.props; const { jobExtend,job } = this.props;
//const {id} = company;
let {hash} = window.location; let {hash} = window.location;
hash = hash.split("?")[0]; hash = hash.split("?")[0];
let id = hash.match("[^/]+(?=/$|$)")[0]; let id = hash.match("[^/]+(?=/$|$)")[0];

View File

@ -141,6 +141,7 @@ export const i18n = {
editJob: () => getLabel(386247, '编辑岗位'), editJob: () => getLabel(386247, '编辑岗位'),
authorizationGroup: () => getLabel(492, '权限组'), authorizationGroup: () => getLabel(492, '权限组'),
allAuthorization: () => getLabel(33363, '全部权限'), allAuthorization: () => getLabel(33363, '全部权限'),

View File

@ -1,374 +1,419 @@
import { import {
observable, observable,
action action
} from 'mobx'; } from 'mobx';
import * as mobx from 'mobx'; import * as mobx from 'mobx';
import * as Api from '../apis/job'; // 引入API接口文件 import * as Api from '../apis/job'; // 引入API接口文件
import { import {
WeaForm WeaForm
} from 'comsMobx'; } from 'comsMobx';
import { import {
WeaTableNew WeaTableNew
} from 'comsMobx'; } from 'comsMobx';
import { import {
Modal, Modal,
message, message,
} from 'antd' } from 'antd'
import { import {
i18n i18n
} from '../public/i18n'; } from '../public/i18n';
const toJS = mobx.toJS;
const {
TableStore
} = WeaTableNew;
export class JobStore {
@observable topMenu = []
@observable rightMenu = [];
@observable dataSource = [];
@observable columns = [];
@observable deptDataSource = [];
@observable deptColumns = [];
@observable tableStore = new TableStore();
@observable loading = true;
@observable dialogLoading = true;
@observable isEdit = true;
@observable nEdialogTitle = '';
@observable searchCondition = [];
@observable condition = [];
@observable isPanelShow = false; //高级搜索面板
@observable form = new WeaForm();
@observable form1 = new WeaForm(); //新增主表表单
@observable jobName = '';
@observable conditionNum = 8;
@observable ids = ''; //选择行id
@observable id = ''; //页面跳转参数id
@observable searchConditionLoading = true;
@observable visible = false;
@observable newVisible = false; //新增弹窗
@observable jobId = '';
@observable selectedRowKeys = '';
@observable date = '';
@observable init = true; //是否首次加载
@observable total = '';
@observable current = 1;
@observable pageSize = 10;
@observable defaultShowLeft = true; const toJS = mobx.toJS;
@observable companysId = 1 const {
TableStore
} = WeaTableNew;
@action export class JobStore {
getTableInfo(params) { @observable tableStore = new TableStore();
this.setLoading(true); @observable topMenu = []
@observable rightMenu = [];
@observable dataSource = [];
@observable columns = [];
@observable deptDataSource = [];
@observable deptColumns = [];
@observable loading = true;
@observable dialogLoading = true;
@observable isEdit = true;
@observable nEdialogTitle = '';
@observable searchCondition = [];
@observable condition = [];
@observable copyCondition = [];
@observable isPanelShow = false; //高级搜索面板
@observable form = new WeaForm();
@observable form1 = new WeaForm(); //新增主表表单
@observable form2 = new WeaForm(); //复制表单
@observable jobName = '';
@observable conditionNum = 12;
@observable ids = ''; //选择行id
@observable id = ''; //页面跳转参数id
@observable searchConditionLoading = true;
@observable visible = false;
@observable newVisible = false; //新增弹窗
@observable jobId = '';
@observable selectedRowKeys = '';
@observable date = '';
@observable init = true; //是否首次加载
@observable total = '';
@observable current = 1;
@observable pageSize = 10;
@observable defaultShowLeft = true;
@observable companysId = 1
@action
getTableInfo(params) {
this.setLoading(true);
params = {
...params,
current: this.current,
pageSize: this.pageSize
}
if (this.isEmptyObject(this.form.getFormParams())) {
params = { params = {
...params, ...params,
current:this.current, ...this.form.getFormParams(),
pageSize:this.pageSize compName: this.jobName
} };
if (this.isEmptyObject(this.form.getFormParams())) { } else {
params = { params = {
...params, ...params,
...this.form.getFormParams(), ...this.form.getFormParams(),
compName: this.jobName
};
} else {
params = {
...params,
...this.form.getFormParams(),
};
}
Api.getSearchList(params).then(response => {
return response.json()
}).then(res => {
if (res.code === 200) {
res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns);
this.setTotal(res.data.pageInfo.total);
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
this.setLoading(false);
this.setInit(false);
} else {
message.warning(res.msg);
}
}).catch(error => {
message.warning(error.msg);
})
}
@action("nodetree事件")
doSearch (params){
this.setInit(true);
this.getTableInfo(params);
}
@action("联查部门")
getDeptTable(id) {
let params = {
parentComp:id
}
Api.getDeptListByPid(params).then(response => {
return response.json()
}).then(res => {
if (res.code === 200) {
res.data.list && this.setDeptDataSource(res.data.list);
res.data.columns && this.setDeptColumns(res.data.columns);
this.setDialogLoadingStatus(false);
} else {
message.warning(res.msg);
}
}).catch(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.getSearchList(params).then(response => {
updateForbiddenTag(checked, id) { return response.json()
let params = { }).then(res => {
forbiddenTag: checked, if (res.code === 200) {
id: id res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns);
this.setTotal(res.data.pageInfo.total);
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
this.setLoading(false);
this.setInit(false);
} else {
message.warning(res.msg);
} }
Api.updateForbiddenTag(params).then(response => { }).catch(error => {
return response.json() message.warning(error.msg);
}).then(data => { })
if (data.code === 200) {
message.success(data.msg);
} else {
message.warning(data.msg);
}
}).catch(error => {
message.warning(error.msg);
})
}
getSearchCondition() {
this.setScLoadingStatus(true);
Api.getAdvanceSearchCondition().then(res => {
if (res.code === 200) {
this.setScLoadingStatus(false);
res.data.conditions && this.setSearchCondition(res.data.conditions);
res.data.conditions && this.form.initFormFields(res.data.conditions);
} else {
message.warning(res.msg);
}
}, error => {
message.warning(error.msg);
})
}
getCompanyForm() {
let params = {};
this.setDialogLoadingStatus(true);
Api.getCompanyForm(params).then(res => {
if (res.code === 200) {
this.setDialogLoadingStatus(false);
res.data.condition && this.setCondition(res.data.condition);
res.data.condition && this.form1.initFormFields(res.data.condition);
} else {
message.warning(res.msg);
}
}, error => {
message.warning(error.msg);
})
} }
@action("nodetree事件")
doSearch(params) {
this.setInit(true);
this.getTableInfo(params);
}
@action("联查人员")
getHrmTable(id) {
let params = {
jobId: id
}
this.tableStore = new TableStore();
Api.getHrmListByJobId(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);
})
}
//删除
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);
})
}
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, 1);
} else {
message.warning(data.msg);
}
}).catch(error => {
message.warning(error.msg);
})
}
getSearchCondition() {
this.setScLoadingStatus(true);
Api.getAdvanceSearchCondition().then(res => {
if (res.code === 200) {
this.setScLoadingStatus(false);
res.data.conditions && this.setSearchCondition(res.data.conditions);
res.data.conditions && this.form.initFormFields(res.data.conditions);
} else {
message.warning(res.msg);
}
}, error => {
message.warning(error.msg);
})
}
getJobForm() {
let params = {};
this.setDialogLoadingStatus(true);
Api.getJobForm(params).then(res => {
if (res.code === 200) {
this.setDialogLoadingStatus(false);
res.data.condition && this.setCondition(res.data.condition);
res.data.condition && this.form1.initFormFields(res.data.condition);
} else {
message.warning(res.msg);
}
}, error => {
message.warning(error.msg);
})
}
@action("复制表单")
getCopyForm() {
let params = {};
Api.getCopyForm(params).then(res => {
if (res.code === 200) {
res.data && this.setCopyCondition(res.data);
res.data && this.form2.initFormFields(res.data);
} else {
message.warning(res.msg);
}
}, error => {
message.warning(error.msg);
})
}
save() { save() {
let params = { let params = {
...this.form1.getFormParams() ...this.form1.getFormParams()
}; };
this.form1.validateForm().then(f => { this.form1.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
Api.add(params).then(response => { Api.add(params).then(response => {
return response.json() return response.json()
}).then(data => { }).then(data => {
if (data.code === 200) { if (data.code === 200) {
message.success(data.msg); message.success(data.msg);
this.getTableInfo(); this.getTableInfo();
this.setNewVisible(false); this.setNewVisible(false);
} else { } else {
message.warning(data.msg); message.warning(data.msg);
} }
}).catch(error => { }).catch(error => {
message.warning(error.msg); message.warning(error.msg);
}) })
} else { } else {
f.showErrors(); f.showErrors();
this.setDate(new Date()); this.setDate(new Date());
} }
}); });
} }
copy() {
@action debugger
getHasRight() { let params = {
Api.getHasRight().then(res => { ids: this.ids,
if (res.code === 200) { ...this.form2.getFormParams()
res.data.rightMenu && this.setRightMenu(res.data.rightMenu); };
res.data.topMenu && this.setTopMenu(res.data.topMenu); this.form2.validateForm().then(f => {
if (f.isValid) {
Api.copy(params).then(response => {
return response.json()
}).then(data => {
if (data.code === 200) {
message.success(data.msg);
this.getTableInfo();
} else { } else {
message.warning(res.msg); message.error(data.msg);
} }
}, error => { }).catch(error => {
message.warning(error.msg); message.warning(error.msg);
}) })
} } else {
f.showErrors();
updateFields(val) { this.setDate(new Date());
this.form.updateFields({
compName: {
value: val
}
});
}
setSearchCondition(condition) {
this.searchCondition = condition;
}
setScLoadingStatus(bool) {
this.searchConditionLoading = bool;
}
setPanelStatus(bool) {
this.isPanelShow = bool;
bool && this.getSearchCondition();
if (!bool) {
this.scLoadingReset();
} }
} });
setJobName(val) {
this.jobName = val;
}
isEmptyObject(obj) {
for (let key in obj) {
return false;
}
return true;
}
setIds(ids) {
this.ids = ids;
}
setId(id) {
this.id =id;
}
scLoadingReset() {
this.searchConditionLoading = true;
}
formReset() {
this.form1 = new WeaForm();
}
setVisible(bool) {
this.visible = bool;
}
setDialogLoadingStatus(bool) {
this.dialogLoading = bool;
} }
setSearchCondition(searchCondition) { @action
this.searchCondition = searchCondition; 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.form.updateFields({
compName: {
value: val
}
});
}
setSearchCondition(condition) {
this.searchCondition = condition;
}
setScLoadingStatus(bool) {
this.searchConditionLoading = bool;
}
setPanelStatus(bool) {
this.isPanelShow = bool;
bool && this.getSearchCondition();
if (!bool) {
this.scLoadingReset();
} }
}
setJobId(jobId) {
this.jobId = jobId; setJobName(val) {
this.jobName = val;
}
isEmptyObject(obj) {
for (let key in obj) {
return false;
} }
return true;
setDate(date) { }
this.date = date;
} setIds(ids) {
this.ids = ids;
setTopMenu(topMenu) { }
this.topMenu = topMenu;
} setId(id) {
this.id = id;
setRightMenu(rightMenu) { }
this.rightMenu = rightMenu;
} scLoadingReset() {
this.searchConditionLoading = true;
setDataSource(dataSource) { }
this.dataSource = dataSource;
}
formReset() {
setDeptDataSource(deptDataSource) { this.form1 = new WeaForm();
this.deptDataSource = deptDataSource; }
}
setColumns(columns) { setVisible(bool) {
this.columns = columns this.visible = bool;
} }
setDeptColumns(deptColumns) { setDialogLoadingStatus(bool) {
this.deptColumns = deptColumns this.dialogLoading = bool;
} }
setSelectedRowKeys(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys; setSearchCondition(searchCondition) {
} this.searchCondition = searchCondition;
}
setLoading(bool) {
this.loading = bool; setJobId(jobId) {
} this.jobId = jobId;
}
setNeDialogTitle(title) {
this.nEdialogTitle = title setDate(date) {
} this.date = date;
}
setCondition(condition) {
this.condition = condition; setTopMenu(topMenu) {
} this.topMenu = topMenu;
}
setNewVisible(bool) {
this.formReset(); setRightMenu(rightMenu) {
this.newVisible = bool; this.rightMenu = rightMenu;
} }
setTotal(total) { setDataSource(dataSource) {
this.total = total; this.dataSource = dataSource;
} }
setCurrent(current) { setDeptDataSource(deptDataSource) {
this.current = current; this.deptDataSource = deptDataSource;
} }
setPageSize(pageSize) { setColumns(columns) {
this.pageSize = pageSize; this.columns = columns
} }
setInit(bool) { setDeptColumns(deptColumns) {
this.init = bool; this.deptColumns = deptColumns
} }
} setSelectedRowKeys(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys;
}
setLoading(bool) {
this.loading = bool;
}
setNeDialogTitle(title) {
this.nEdialogTitle = title
}
setCondition(condition) {
this.condition = condition;
}
setCopyCondition(copyCondition) {
this.copyCondition = copyCondition;
}
setNewVisible(bool) {
this.formReset();
this.newVisible = bool;
}
setTotal(total) {
this.total = total;
}
setCurrent(current) {
this.current = current;
}
setPageSize(pageSize) {
this.pageSize = pageSize;
}
setInit(bool) {
this.init = bool;
}
}

View File

@ -126,7 +126,7 @@ export class JobExtendStore {
id: this.id, id: this.id,
viewCondition:this.selectedKey viewCondition:this.selectedKey
} }
Api.getCompanyExtendForm(params).then((res) => { Api.getJobExtendForm(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {
res.data.result.conditions && this.form.initFormFields(res.data.result.conditions); res.data.result.conditions && this.form.initFormFields(res.data.result.conditions);
res.data.result.conditions && this.setConditions(res.data.result.conditions); res.data.result.conditions && this.setConditions(res.data.result.conditions);