From 17666c26534382cf454008634eaef6818378020d Mon Sep 17 00:00:00 2001 From: qinoy Date: Thu, 20 Apr 2023 16:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=8A=E5=88=A9=E5=AE=A2=E6=88=B7=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E4=BC=98=E5=8C=96=E7=82=B9=E4=BF=AE=E5=A4=8D=20?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=8F=82=E8=80=83=E3=80=90=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=A1=B9=E5=8F=8D=E9=A6=88-4.19=E3=80=91=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CooperationUpdate/component.vue | 117 +++++++++++++++++- .../src/views/role/RoleUpdate.vue | 17 +-- 2 files changed, 124 insertions(+), 10 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue b/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue index 7eae67f..f90ecb0 100644 --- a/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue +++ b/com.actionsoft.apps.coe.pal.cooperation/src/components/CooperationUpdate/component.vue @@ -18,7 +18,10 @@ -
+ + + +
@@ -69,6 +72,7 @@
+
{ + // console.log('--------',ro) + let userIdArr = [...ro.data]; + if (userIdArr.length) { + // 查询当前部门节所有父级部门 + that.searchParentUserIdFun(userIdArr,that.searchUserName); + }else { + that.$message({type:'warning',message:'查询的部门不存在,请检查输入的部门名称'}); + } + }).catch(error => { + console.log(error); + }) + }else { + that.userTreeNode.childNodes = []; + that.loadUserNode(that.userTreeNode,that.userTreeResolve); + that.expandKeys = []; + if (that.tempNodeArr?.length){ + that.tempNodeArr.forEach(node => { + that.$refs.userTree.remove(node); + }) + that.tempNodeArr.length = 0; + } } + //this.$refs.tree.filter(this.searchUserName); + }, + searchParentUserIdFun(userid,orgName){ + let that = this; + const data = { + url: 'jd', + data: { + cmd: 'com.actionsoft.apps.coe.pal_search_user_tree_parent_node', + userid, + } + } + awsuiAxios.post(data) + .then(ro => { + // console.log('父级部门',ro.data); + that.expandKeys = [...ro.data]; + setTimeout(() => { + // that.$refs.orgTree.filter(orgName); + let tempNode = []; + userid.forEach(userId => { + let node = that.$refs.userTree.getNode(userId); + tempNode.push(node); + that.tempNodeArr.push(node); + }) + that.$refs.userTree.filter(tempNode); + },600); + }) + .catch(err => { + console.log(err); + }); + }, + filterNode(values, data) { + console.log('xxxx',values); + if (!values) return true; + //return data.name.indexOf(value) !== -1; + let tempIds = []; + values.forEach(value => { + if (value.data.pathIdList.indexOf(data.id) !== -1) { + let node = this.$refs.userTree.getNode(data.id); + if (node) { + this.tempNodeArr.push(node); + } + } + value.data.pathIdList.forEach(pathId => { + if (tempIds.indexOf(pathId) === -1) { + tempIds.push(pathId) + } + }); + // return value.data.pathIdList.indexOf(data.id) !== -1; + }); + return tempIds.indexOf(data.id) !== -1; + }, }, watch: { visible(val) { @@ -567,7 +665,20 @@ this.initData(); } else {// 关闭 } + }, + searchUserName(newval, oldval) { + if (!newval) { + this.userTreeNode.childNodes = []; + this.loadUserNode(this.userTreeNode,this.userTreeResolve); + this.expandKeys = []; + if (this.tempNodeArr?.length){ + this.tempNodeArr.forEach(node => { + this.$refs.userTree.remove(node); + }); + this.tempNodeArr.length = 0; + } } + } } } diff --git a/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue b/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue index a28052e..593e634 100644 --- a/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue +++ b/com.actionsoft.apps.coe.pal.cooperation/src/views/role/RoleUpdate.vue @@ -5,6 +5,7 @@ :title="title" :before-close="handleClose" :wrapper-closable=false + :destroy-on-close=true :visible.sync="sidebarVisible">
@@ -51,6 +52,7 @@