!66 人员信息管理

Merge pull request !66 from reset/feature/cl
This commit is contained in:
reset 2022-08-26 07:31:41 +00:00 committed by Gitee
commit aa80d43966
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 150 additions and 135 deletions

View File

@ -0,0 +1,68 @@
import {
WeaTools
} from 'ecCom'
export const getSearchList = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getTable', 'GET', params);
}
export const deleteTableData = (params) => {
return fetch('/api/bs/hrmorganization/resourceBasicInfo/delete', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const recoverData = (params) => {
return fetch('/api/bs/hrmorganization/resourceBasicInfo/recover', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const getAdvanceSearchCondition = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getSearchCondition', 'GET', params);
}
export const add = (params) => {
return fetch('/api/bs/hrmorganization/resourceBasicInfo/save', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const edit = (params) => {
return fetch('/api/bs/hrmorganization/resourceBasicInfo/update', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
})
}
export const getForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getForm', 'GET', params);
}
export const getHasRight = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getHasRight', 'GET', params);
}
export const getTree = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getTreeData', 'GET', params);
}

View File

@ -19,7 +19,8 @@ import {
Modal,
Button,
message,
Switch
Switch,
Tag
} from 'antd'
import {
WeaSwitch,
@ -111,7 +112,7 @@ export default class ResourceBasicInfo extends React.Component {
resourceBasicInfo
} = this.props;
resourceBasicInfo.setNeDialogTitle(i18n.label.newJobLevel());
resourceBasicInfo.setNeDialogTitle(i18n.label.newResourceBasicInfo());
resourceBasicInfo.setIsNew(true);
resourceBasicInfo.setVisible(true);
resourceBasicInfo.getForm();
@ -129,6 +130,7 @@ export default class ResourceBasicInfo extends React.Component {
resourceBasicInfo.setIds(keys);
this.showConfirm('batchDel');
}
showConfirm(v) {
let _this = this;
confirm({
@ -144,6 +146,7 @@ export default class ResourceBasicInfo extends React.Component {
},
});
}
onOk() {
const {
resourceBasicInfo
@ -216,60 +219,27 @@ export default class ResourceBasicInfo extends React.Component {
!this.isEmptyObject(form2.getFormParams()) && resourceBasicInfo.updateFields(val);
}
changeData(key) {
const {
resourceBasicInfo
} = this.props;
resourceBasicInfo.changeData(key);
}
reRenderColumns(columns) {
let _this = this;
columns.forEach((c, index) => {
if (c.dataIndex == 'forbidden_tag') {
if (c.dataIndex == 'fdelete') {
c.render = function (text, record) {
return <Switch checked={record.forbidden_tag == "0" ? true : false} onChange={checked => _this.updateForbiddenTag(checked, record.id)} />
return record.fdelete == '0' ? <Tag color="green" >正常</Tag> : <Tag color="red"></Tag>
}
};
})
}
updateForbiddenTag(checked, id) {
const {
resourceBasicInfo
} = this.props;
confirm({
title: i18n.confirm.defaultTitle(),
content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(),
okText: i18n.button.ok(),
cancelText: i18n.button.cancel(),
onOk() {
resourceBasicInfo.updateForbiddenTag(checked, id);
},
onCancel() {
return false;
},
});
}
onOperatesClick(record, rowIndex, operate) {
const {
index
} = operate;
(index == '0') && this.doEdit(record.randomFieldId);
(index == '1') && this.doDel(record.randomFieldId);
(index == '2') && this.doRecover(record.randomFieldId);
}
custom = () => {
const {
resourceBasicInfo
} = this.props, {
tableStore,
} = resourceBasicInfo;
tableStore.setColSetVisible(true);
tableStore.tableColSet(true);
}
doEdit(id) {
const {
@ -277,7 +247,7 @@ export default class ResourceBasicInfo extends React.Component {
} = this.props;
resourceBasicInfo.setNeDialogTitle(i18n.label.editJobLevel());
resourceBasicInfo.setLevelId(id);
resourceBasicInfo.setFId(id);
resourceBasicInfo.setIsNew(false);
resourceBasicInfo.setVisible(true);
resourceBasicInfo.getForm();
@ -291,6 +261,33 @@ export default class ResourceBasicInfo extends React.Component {
this.showConfirm('del');
}
doRecover(id) {
const {
resourceBasicInfo
} = this.props;
this.showRecoverConfirm(id);
}
showRecoverConfirm(id) {
const {
resourceBasicInfo
} = this.props;
confirm({
title: i18n.confirm.defaultTitle(),
content: i18n.confirm.recoverConfirm(),
okText: i18n.button.ok(),
cancelText: i18n.button.cancel(),
onOk() {
resourceBasicInfo.recover(id);
},
onCancel() {
return false;
},
});
}
handleSave() {
const {
@ -363,7 +360,7 @@ export default class ResourceBasicInfo extends React.Component {
log = () => {
window.setLogViewProp({
logMoudleType: 2,
logMoudleType: 11,
keys: new Date().getTime(),
});
}
@ -375,8 +372,8 @@ export default class ResourceBasicInfo extends React.Component {
resourceBasicInfo
} = this.props;
const {
isPanelShow, form2, levelName, conditionNum, tableStore, nEdialogTitle, visible, condition,
form, dialogLoading, isEdit, selectedKey, topTab, topTabCount, date, hasRight, treeConfig, treeLoading
isPanelShow, form2, fname, conditionNum, tableStore, nEdialogTitle, visible, condition,
form, dialogLoading, isEdit, date, hasRight, treeConfig, treeLoading
} = resourceBasicInfo;
if (hasRight === false) {
@ -393,7 +390,7 @@ export default class ResourceBasicInfo extends React.Component {
const treeCom = (
<WeaLeftTree ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftTree@ifgbi1`}
datas={data}
searchLabel={"等级方案"}
searchLabel={"类型"}
onSelect={onSelectedTreeNode}
selectedKeys={selectedKeys}
onExpand={onExpand}
@ -418,26 +415,6 @@ export default class ResourceBasicInfo extends React.Component {
onDropMenuClick={(e) => this.handleMenuClick(e)}
>
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@q6b87k`} leftCom={treeCom}>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
datas={topTab}
counts={topTabCount}
keyParam="viewCondition" //主键
countParam="groupId" //数量
selectedKey={selectedKey}
onChange={this.changeData.bind(this)}
searchType={['base', 'advanced']}
showSearchAd={isPanelShow}
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? levelName : form2.getFormParams().levelName}
setShowSearchAd={bool => resourceBasicInfo.setPanelStatus(bool)}
hideSearchAd={() => resourceBasicInfo.setPanelStatus(false)}
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
onSearch={() => resourceBasicInfo.getTableInfo()}
onSearchChange={val => this.onSearchChange(val)}
/>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
comsWeaTableStore={tableStore}
hasOrder={true}

View File

@ -158,6 +158,8 @@ export const i18n = {
newPeople: () => getLabel(386246, '新建人员'),
resourceMange: () => getLabel(386246, '人员管理'),
resourceBasicInfo: () => getLabel(386246, '人员信息'),
newResourceBasicInfo: () => getLabel(386246, '新建人员资料'),
authorizationGroup: () => getLabel(492, '权限组'),
@ -951,7 +953,7 @@ export const i18n = {
confirm: {
forbiddenTag: () => getLabel(-131329, '确定禁用该记录吗'),
enableTag: () => getLabel(-131328, '确定启用该记录吗'),
recoverConfirm: () => getLabel(-131310, '确定恢复该记录吗'),
defaultTitle: () => getLabel(131329, '信息确认'),
removeGroupInfo: () => getLabel(383053, '删除分组,该分组下的字段将显示到“基本信息”分组中,确定要删除吗?'),

View File

@ -3,7 +3,7 @@ import {
action
} from 'mobx';
import * as mobx from 'mobx';
import * as Api from '../apis/joblevel'; // 引入API接口文件
import * as Api from '../apis/resourceBasicInfo'; // 引入API接口文件
import {
WeaForm
} from 'comsMobx';
@ -32,21 +32,17 @@ export class ResourceBasicInfoStore {
@observable isEdit = true;
@observable isNew = true;
@observable isPanelShow = false; //高级搜索面板
@observable form2 = new WeaForm();
@observable form = new WeaForm();
@observable form1 = new WeaForm();
@observable levelName = '';
@observable form2 = new WeaForm(); //高级搜索
@observable form = new WeaForm(); //新增编辑
@observable fname = '';
@observable conditionNum = 2;
@observable ids = ''; //选择行id
@observable searchConditionLoading = true;
@observable nEdialogTitle = '';
@observable visible = false;
@observable dialogLoading = true;
@observable levelId = '';
@observable fId = '';
@observable date = '';
@observable selectedKey = -1;
@observable topTab = [];
@observable topTabCount = {};
@observable hasRight = '';
@observable treeLoading = true;
@ -89,13 +85,13 @@ export class ResourceBasicInfoStore {
@action
getTableInfo() {
let params = {
schemeId: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid,
fclassid: this.selectedTreeNodeInfo && this.selectedTreeNodeInfo.domid,
}
this.tableStore = new TableStore();
if (this.isEmptyObject(this.form2.getFormParams())) {
params = {
...params,
levelName: this.levelName,
fname: this.fname,
};
} else {
params = {
@ -135,6 +131,25 @@ export class ResourceBasicInfoStore {
})
}
//恢复
recover(id){
let params = {
ids: id
};
Api.recoverData(params).then(response => {
return response.json()
}).then(data => {
if (data.code === 200) {
message.success(i18n.message.opSuccess());
this.getTableInfo();
} else {
message.warning(data.msg);
}
}).catch(error => {
message.warning(error.msg);
})
}
save() {
let params = {
...this.form.getFormParams()
@ -162,7 +177,7 @@ export class ResourceBasicInfoStore {
}
edit() {
let params = { ...this.form.getFormParams(), id: this.levelId };
let params = { ...this.form.getFormParams(), fid: this.fId };
this.form.validateForm().then(f => {
if (f.isValid) {
Api.edit(params).then(response => {
@ -185,40 +200,19 @@ export class ResourceBasicInfoStore {
});
}
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);
this.getTableInfo();
} else {
message.warning(data.msg);
}
}).catch(error => {
message.warning(error.msg);
})
}
getForm() {
let params = this.isNew ? {} : {
id: this.levelId
let params = this.isNew ? {
fclassid: this.selectedTreeNodeInfo.domid
} : {
fid: this.fId
}
this.setDialogLoadingStatus(true);
Api.getLevelForm(params).then(res => {
Api.getForm(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);
res.data && this.setCondition(res.data);
res.data && this.form.initFormFields(res.data);
} else {
message.warning(res.msg);
}
@ -243,21 +237,6 @@ export class ResourceBasicInfoStore {
})
}
@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 => {
@ -274,7 +253,7 @@ export class ResourceBasicInfoStore {
updateFields(val) {
this.form2.updateFields({
levelName: {
fname: {
value: val
}
});
@ -296,8 +275,8 @@ export class ResourceBasicInfoStore {
}
}
setLevelName(val) {
this.levelName = val;
setFName(val) {
this.fname = val;
}
isEmptyObject(obj) {
@ -346,25 +325,14 @@ export class ResourceBasicInfoStore {
this.condition = condition;
}
setLevelId(levelId) {
this.levelId = levelId;
setFId(fId) {
this.fId = fId;
}
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;