From ed990bcfb20ad59f1a2909bec1c28b7eebe9fd3e Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 20 Jun 2022 11:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90v1.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/fieldDefined.js | 11 ++++- pc4mobx/organization/stores/fieldDefined.js | 48 +++++++++------------ 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js index 155fb2a..0d550c1 100644 --- a/pc4mobx/organization/apis/fieldDefined.js +++ b/pc4mobx/organization/apis/fieldDefined.js @@ -103,7 +103,16 @@ export const deleteTree = (moduleName,params) => { }) } -export const changeGroup = (moduleName, params = {}) => WeaTools.callApi(`/api/hrm/${moduleName}/changeGroup`, 'POST', params) +export const changeGroup = (moduleName,params) => { + return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/changeGroup`, { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }) +} export const getEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/getEncryptFieldSettingForm`, 'GET', params) diff --git a/pc4mobx/organization/stores/fieldDefined.js b/pc4mobx/organization/stores/fieldDefined.js index b1c4fe6..cc230f6 100644 --- a/pc4mobx/organization/stores/fieldDefined.js +++ b/pc4mobx/organization/stores/fieldDefined.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-09 10:16:00 - * @LastEditTime: 2022-06-17 18:05:13 + * @LastEditTime: 2022-06-20 11:07:43 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js */ @@ -50,7 +50,7 @@ export class FieldDefinedStore extends HrmBaseStore { //override baseStore.tabConfig tabDef = { color: '#000000', - groupId: '', + //groupId: '', viewCondition: '1', topButtonDef: [{ comType: 'button', @@ -138,9 +138,14 @@ export class FieldDefinedStore extends HrmBaseStore { isDropBtn: true } ] - if (this.selectedTreeNodeInfo != null && this.selectedTreeNodeInfo.viewAttr != 1) { + // if (this.selectedTreeNodeInfo != null && this.selectedTreeNodeInfo.viewAttr != 1) { + // datas.splice(2, 1); + // } + + if (this.selectedTreeNodeInfo != null && !this.selectedTreeNodeInfo.addChild) { datas.splice(2, 1); } + return datas; } dropdownProps = () => ({ @@ -635,7 +640,7 @@ export class FieldDefinedStore extends HrmBaseStore { }); if (tabArr.length > 0) { this.tabConfig.tabs = [...tabArr]; - // this.setTableEditColTitle(); + //this.setTableEditColTitle(); this.setActiveTab(this.tabConfig, init ? '1' : !create ? this.tabConfig.activeTabKey : `${tabArr.length}`); // this.containerInitFinished = { // ...this.containerInitFinished, @@ -1403,8 +1408,6 @@ export class FieldDefinedStore extends HrmBaseStore { if (p.domid === this.treeConfig.selectedKeys[0]) this.selectedTreeNodeInfo = p; p.childs && p.childs.map(c => { - - console.log(this.treeConfig.selectedKeys[0]) if (c.domid === this.treeConfig.selectedKeys[0]) this.selectedTreeNodeInfo = c; }) @@ -1446,16 +1449,6 @@ export class FieldDefinedStore extends HrmBaseStore { icon: this.menuIconCollection.setting //checkAction: 'childInfoOperability' }); - - // defaultType && !this.tableEditConfig.childInfoSetting.hasGroup && t.topButtonDef.push({ - // comType: 'button', - // type: 'primary', - // onClickHandle: this.removeTypeInfo, - // label: i18n.button.delete(), - // icon: this.menuIconCollection.setting - // }) - - } else { this.tableEditConfig.childInfoSetting.showTitle = false; this.tableEditConfig.childInfoSetting.showAdd = false; @@ -1470,7 +1463,6 @@ export class FieldDefinedStore extends HrmBaseStore { } - if (this.selectedTreeNodeInfo.domid === '-1' || this.selectedTreeNodeInfo.addChild) { this.tableEditConfig.fieldDef.columns[2].com[0].options = remove(this.tableEditConfig.fieldDef.columns[1].com[0].options, (v) => v != 'upload'); } else { @@ -1853,7 +1845,7 @@ export class FieldDefinedStore extends HrmBaseStore { break; default: const groupid = e.key; - const tabInfo = this.tabConfig.tabs[findIndex(this.tabConfig.tabs, { groupid })]; + const tabInfo = this.tabConfig.tabs[findIndex(this.tabConfig.tabs, {groupid })]; let moveFieldConfirm = i18n.confirm.moveFieldConfirm().replace('{params}', tabInfo.title); this.changeGroup(moveFieldConfirm, groupid); } @@ -1880,7 +1872,7 @@ export class FieldDefinedStore extends HrmBaseStore { }) } else { Object.assign(params, { - ids: ids.join(','), + fieldids: ids.join(','), groupid }); } @@ -1895,16 +1887,18 @@ export class FieldDefinedStore extends HrmBaseStore { } @action doChangeGroup = (params) => { - api.changeGroup(this.moduleName, params).then(data => { - if (data.status === '1') { + api.changeGroup(this.moduleName, params).then(response => { + return response.json() + }).then(data => { + if (data.code === 200) { message.success(i18n.message.moveSuccess()); - // if (this.moduleName.indexOf('resource') >= 0) this.getTabInfoByTreeNode(); - // else - // this.initData(); - } else - message.error(data.message); - }, error => { message.error(i18n.message.actionError()); }); + } else { + message.warning(data.msg); + } + }).catch(error => { + message.error(i18n.message.actionError()); + }) } @observable encryptDialogVisible = false;