From 95e71593ffb9f1c154e83b48b30b2b5d7c8e5993 Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Fri, 10 Jun 2022 11:25:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=91=98=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonnelSelection/index.vue | 8 ++-- jero-web/src/components/setCreator/index.vue | 43 +++++++++++++++++-- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/jero-web/src/components/PersonnelSelection/index.vue b/jero-web/src/components/PersonnelSelection/index.vue index 3d3740b2c..41d1778c0 100644 --- a/jero-web/src/components/PersonnelSelection/index.vue +++ b/jero-web/src/components/PersonnelSelection/index.vue @@ -132,7 +132,7 @@ this.treeVisible = false }, handleSubmit() { - if (this.userIds && this.userIds.length > 0) { + // if (this.userIds && this.userIds.length > 0) { if (this.isSingleChoice) { if (this.userIds.length > 1) { this.$message.warning(this.$t('onlyOnePersonCanBeSelected')) @@ -145,9 +145,9 @@ this.$emit('change', this.query.db_field_name, userIds.join(',')) this.visible = false this.treeVisible = false - } else { - this.$message.warning(this.$t('pleaseSelectPersonFirst')) - } + // } else { + // this.$message.warning(this.$t('pleaseSelectPersonFirst')) + // } }, indexclick(event) { this.$emit('input', event.target.value) diff --git a/jero-web/src/components/setCreator/index.vue b/jero-web/src/components/setCreator/index.vue index 244e64594..259c808b4 100644 --- a/jero-web/src/components/setCreator/index.vue +++ b/jero-web/src/components/setCreator/index.vue @@ -56,6 +56,8 @@ userIds: [], departId: '', defaultExpandedKeys: [], + content: [], + userName: [], submitLoading: false, visibleTree: false } @@ -66,6 +68,8 @@ methods: { getPush(data) { this.tableKey = data + this.userName = [] + this.content = [] this.searchModel = '' this.visible = true this.visibleTree = false @@ -95,7 +99,7 @@ handleSubmit() { let query = { id: this.tableKey, - createBy: this.userIds.join(','), + createBy: this.userName.join(',') } this.submitLoading = true this.confirmLoading = true @@ -152,8 +156,41 @@ } }) }, - checkChange(e) { + checkChange(e, info) { this.userIds = e + this.userName = [] + if (info.checkedNodes && info.checkedNodes.length > 0) { + info.checkedNodes.forEach(res => { + 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) + } + }) + }) + } } } } @@ -181,7 +218,7 @@ .drawer-bootom-button { position: absolute; bottom: 0; - z-index:100; + z-index: 100; width: 100%; border-top: 1px solid #e8e8e8; padding: 10px 16px;