From d1760f765acfaa9d74b4a3281421f1ae92fcdd72 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 30 Jul 2024 16:22:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=8A=B1=E5=90=8D=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/components/resource/resource.js | 10 ++++++---- pc4mobx/organization/stores/resource.js | 15 +++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index e10bb12..63da137 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -333,7 +333,8 @@ export default class Resource extends React.Component { const btn = [ (), (), (), @@ -546,7 +547,7 @@ export default class Resource extends React.Component { store.setPanelStatus(bool)} hideSearchAd={() => store.setPanelStatus(false)} @@ -555,8 +556,9 @@ export default class Resource extends React.Component { hasMask={false} buttonsAd={this.getTabBtn()} onSearch={() => { - store.hideRadioGroup();store.getTableInfo(); - }} + store.isBaseValue = true; + store.hideRadioGroup();store.getTableInfo(); + }} onSearchChange={val => this.onSearchChange(val)} /> diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index e942ff5..da3fba2 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -47,6 +47,8 @@ export class ResourceStore extends HrmBaseStore{ @observable form2 = new WeaForm(); @observable form = new WeaForm(); @observable lastName = ''; + @observable isBaseValue = true; + @observable conditionNum = 8; @observable ids = ''; //选择行id @observable searchConditionLoading = false; @@ -125,17 +127,18 @@ export class ResourceStore extends HrmBaseStore{ params = { isQuickSearch:false, ...this.selectTreeNodeInfo, + } - //高级搜索内容为空 - if (this.isEmptyObject(this.form2.getFormParams())) { + //外部INPUT搜索 + if (this.isBaseValue) { params = { ...params, - lastName: this.lastName, + lastName: this.lastName }; - } else { + }else { params = { ...params, - ...this.form2.getFormParams() + ...this.form2.getFormParams(), }; } }else { @@ -810,7 +813,7 @@ export class ResourceStore extends HrmBaseStore{ updateFields(val) { this.form2.updateFields({ - lastname: { + "-1_hrm_lastname": { value: val } }); From cf20e06137e4b695c2834faa98a0b579204d3e97 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 8 Aug 2024 16:59:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/stores/job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index cfb1c60..ebf88df 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -75,7 +75,7 @@ export class JobStore { @action initData() { this.getHasRight(); - this.refresh(); + //this.refresh(); // this.getCopyForm(); // this.getMergeForm(); } From 13da1c14bcf3042411c63f4a66213232ea944d2e Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 20 Aug 2024 15:27:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=86=E6=9D=83=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=92=E8=89=B2=E9=80=89=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NewAndEditDialog.js | 3 ++ .../components/detach/ManagerDetach.js | 17 +++++-- pc4mobx/organization/stores/job.js | 1 + pc4mobx/organization/stores/jobgrade.js | 2 +- pc4mobx/organization/stores/joblevel.js | 2 +- pc4mobx/organization/stores/managerDetach.js | 47 ++++++++++++++++++- 6 files changed, 64 insertions(+), 8 deletions(-) diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js index 51a984e..91bab48 100644 --- a/pc4mobx/organization/components/NewAndEditDialog.js +++ b/pc4mobx/organization/components/NewAndEditDialog.js @@ -72,6 +72,9 @@ export default class NewAndEditDialog extends React.Component { if (moduleName == 'staff' && data.planId) { bindChangeEnvent(data); } + if (moduleName == 'managerDetach' && data.managerType) { + bindChangeEnvent(data); + } }; onBlur = data => { diff --git a/pc4mobx/organization/components/detach/ManagerDetach.js b/pc4mobx/organization/components/detach/ManagerDetach.js index bca09d9..544de24 100644 --- a/pc4mobx/organization/components/detach/ManagerDetach.js +++ b/pc4mobx/organization/components/detach/ManagerDetach.js @@ -9,7 +9,8 @@ import { WeaTab, WeaFormItem, WeaRightMenu, - WeaAlertPage + WeaAlertPage, + WeaBrowser } from 'ecCom' import { Row, @@ -234,9 +235,13 @@ export default class ManagerDetach extends React.Component { reRenderColumns(columns) { let _this = this; - // columns.forEach((c, index) => { - - // }) + columns.forEach((c, index) => { + if (c.dataIndex == 'manager_type') { + c.render = function (text, record) { + return record.manager_type == "0" ? '人员' : '角色' + } + }; + }) } doDetachSwitch(checked) { @@ -430,10 +435,12 @@ export default class ManagerDetach extends React.Component { isFormInit={form.isFormInit} loading={dialogLoading} isEdit={isEdit} - height={200} + height={220} conditionLen={1} save={() => this.handleSave()} onCancel={() => managerDetach.setVisible(false)} + moduleName='managerDetach' + bindChangeEnvent={val => managerDetach.updateConditions(val)} /> ) diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index ebf88df..a180536 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -75,6 +75,7 @@ export class JobStore { @action initData() { this.getHasRight(); + this.getTableInfo(); //this.refresh(); // this.getCopyForm(); // this.getMergeForm(); diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index c4e27c0..8f67913 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -69,7 +69,7 @@ export class JobGradeStore { @action initData = () => { this.selectedTreeNodeInfo = null; - this.treeConfig.treeExpandKeys.length = 0; + //this.treeConfig.treeExpandKeys.length = 0; Api.getTree().then(res => { if (res.code === 200) { if (res.data.length > 0) { diff --git a/pc4mobx/organization/stores/joblevel.js b/pc4mobx/organization/stores/joblevel.js index f164ef1..5f949b8 100644 --- a/pc4mobx/organization/stores/joblevel.js +++ b/pc4mobx/organization/stores/joblevel.js @@ -68,7 +68,7 @@ export class JobLevelStore { @action initData = () => { this.selectedTreeNodeInfo = null; - this.treeConfig.treeExpandKeys.length = 0; + //this.treeConfig.treeExpandKeys.length = 0; Api.getTree().then(res => { if (res.code === 200) { if (res.data.length > 0) { diff --git a/pc4mobx/organization/stores/managerDetach.js b/pc4mobx/organization/stores/managerDetach.js index 3af8f26..87a998a 100644 --- a/pc4mobx/organization/stores/managerDetach.js +++ b/pc4mobx/organization/stores/managerDetach.js @@ -28,6 +28,7 @@ export class ManagerDetachStore { @observable topMenu = [] @observable rightMenu = []; @observable condition = []; + fcondition = []; @observable searchCondition = []; @observable isEdit = true; @observable isNew = true; @@ -93,10 +94,16 @@ export class ManagerDetachStore { }) } - @action("新建删除") save() { + @action("新建保存") save() { let params = { ...this.form.getFormParams() }; + if (params.managerType == "0" && params.ecManager == "") { + return message.error("管理员字段必填"); + } + if (params.managerType == "1" && params.roleId == "") { + return message.error("角色字段必填"); + } this.form.validateForm().then(f => { if (f.isValid) { Api.add(params).then(response => { @@ -152,6 +159,7 @@ export class ManagerDetachStore { Api.getForm(params).then(res => { if (res.code === 200) { this.setDialogLoadingStatus(false); + res.data.condition && this.setFcondition(res.data.condition); res.data.condition && this.setCondition(res.data.condition); res.data.condition && this.form.initFormFields(res.data.condition); } else { @@ -213,6 +221,39 @@ export class ManagerDetachStore { }); } + updateConditions(data) { + this.form.updateFields({ + ecManager: { + value: '' + }, + roleId: { + value: '' + } + }); + const type = data.managerType.value; + debugger + this.condition = this.fcondition; + switch(type) { + case '0': + this.condition[0].items = this.condition[0].items.filter(item => { + if(item.domkey[0] == 'ecManager'){ + item.viewAttr = 3; + } + return item.domkey[0] != 'roleId'; + }); + break; + case '1': + this.condition[0].items = this.condition[0].items.filter(item => { + if(item.domkey[0] == 'roleId'){ + item.viewAttr = 3; + } + return item.domkey[0] != 'ecManager'; + }) + } + this.setCondition(this.condition); + this.form.initFormFields(this.condition); + } + setSearchCondition(condition) { this.searchCondition = condition; } @@ -299,4 +340,8 @@ export class ManagerDetachStore { this.hasRight = bool; } + setFcondition(condition) { + this.fcondition = condition; + } + } \ No newline at end of file