From beb7521eb0eb3db2db7c21936bad8dc3de18399d Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Thu, 28 Apr 2022 17:45:42 +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=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonnelSelection/index.vue | 49 +++++++++---------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/jero-web/src/components/PersonnelSelection/index.vue b/jero-web/src/components/PersonnelSelection/index.vue index 3228a68df..c03f72ed7 100644 --- a/jero-web/src/components/PersonnelSelection/index.vue +++ b/jero-web/src/components/PersonnelSelection/index.vue @@ -32,10 +32,9 @@ checkable :loading="loading" :tree-data="gData" - v-model:checkedKeys="selectedKey" - @select="onSelect" @check="onCheck" @expand="onExpand" + v-model:checkedKeys="defaultCheckedKeys" :defaultCheckedKeys="defaultCheckedKeys" :defaultExpandedKeys="defaultExpandedKeys" > @@ -86,9 +85,10 @@ this.queryDepartUserTreeList() this.visible = true }, - onSelect(selectedKeys, info) { - this.selectedKey = selectedKeys - }, + // onSelect(selectedKeys, info) { + // console.log(selectedKeys) + // this.selectedKey = selectedKeys + // }, onCheck(checkedKeys, info) { this.userIds = [] @@ -167,30 +167,25 @@ if (res.success) { this.gData = res.result this.defaultExpandedKeys = [this.departId] - if (this.personneQuery[this.query.db_field_name + '_id']) { - this.defaultCheckedKeys = this.personneQuery[this.query.db_field_name + '_id'].split(',') - this.selectedKey = this.personneQuery[this.query.db_field_name + '_id'].split(',') - } else if (this.personneQuery[this.query.db_field_name]) { - this.defaultCheckedKeys = this.personneQuery[this.query.db_field_name].split(',') - this.selectedKey = this.personneQuery[this.query.db_field_name].split(',') - } else { - this.defaultCheckedKeys = [] - this.selectedKey = [] + if (this.userName && this.userName.length == 0) { + if (this.personneQuery[this.query.db_field_name + 'Name']) { + this.userName = this.personneQuery[this.query.db_field_name + 'Name'].split(',') + } else if (this.personneQuery[this.query.db_field_name]) { + this.userName = this.personneQuery[this.query.db_field_name].split(',') + } else { + this.userName = [] + } } - if (this.personneQuery[this.query.db_field_name + 'Name']) { - this.userName = this.personneQuery[this.query.db_field_name + 'Name'].split(',') - } else if (this.personneQuery[this.query.db_field_name]) { - this.userName = this.personneQuery[this.query.db_field_name].split(',') - } else { - this.userName = [] - } - if (this.personneQuery[this.query.db_field_name + '_id']) { - this.userIds = this.personneQuery[this.query.db_field_name + '_id'].split(',') - } else if (this.personneQuery[this.query.db_field_name]) { - this.userIds = this.personneQuery[this.query.db_field_name].split(',') - } else { - this.userIds = [] + if (this.userIds && this.userIds.length == 0) { + if (this.personneQuery[this.query.db_field_name + '_id']) { + this.userIds = this.personneQuery[this.query.db_field_name + '_id'].split(',') + } else if (this.personneQuery[this.query.db_field_name]) { + this.userIds = this.personneQuery[this.query.db_field_name].split(',') + } else { + this.userIds = [] + } } + this.defaultCheckedKeys = this.userIds this.treeVisible = true } else { this.gData = []