From d497d90c746ff797eabef035a7087ea3e26fe74b Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Mon, 30 May 2022 10:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonnelSelection/index.vue | 39 ++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/jero-web/src/components/PersonnelSelection/index.vue b/jero-web/src/components/PersonnelSelection/index.vue index 55e8284cb..3d3740b2c 100644 --- a/jero-web/src/components/PersonnelSelection/index.vue +++ b/jero-web/src/components/PersonnelSelection/index.vue @@ -69,7 +69,8 @@ userIds: [], searchModel: '', defaultExpandedKeys: [], - defaultCheckedKeys: [] + defaultCheckedKeys: [], + content: [] } }, mounted() { @@ -91,12 +92,38 @@ // }, onCheck(checkedKeys, info) { - this.userIds = [] + this.userIds = checkedKeys.checked this.userName = [] if (info.checkedNodes && info.checkedNodes.length > 0) { info.checkedNodes.forEach(res => { - this.userIds.push(res.data.props.id || res.data.props.dataRef.key) - this.userName.push(res.data.props.title) + if (res.data.props.dataRef.key) { + this.content.push({ + id: res.data.props.dataRef.key, + title: res.data.props.dataRef.title + }) + } else { + this.content.push({ + id: res.data.props.id, + title: res.data.props.title + }) + } + }) + } + if (this.content && this.content.length > 0) { + for (let i = 0; i < this.content.length; i++) { + for (let j = i + 1; j < this.content.length; j++) { + if (this.content[i].id == this.content[j].id) { + this.content.splice(j, 1) + j-- + } + } + } + this.userIds.forEach(res => { + this.content.forEach(val => { + if (res == val.id) { + this.userName.push(val.title) + } + }) }) } }, @@ -163,7 +190,7 @@ postAction('sys/user/queryDepartUserTreeList', { departId: this.departId, json: gData, - flag:'1', + flag: '1' }).then((res) => { this.confirmLoading = false if (res.success) { @@ -221,7 +248,7 @@ position: absolute; bottom: 0; width: 100%; - z-index:100; + z-index: 100; border-top: 1px solid #e8e8e8; padding: 10px 16px; text-align: right;