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;