修改人员选择弹窗

This commit is contained in:
qq787203167
2022-04-28 17:45:42 +08:00
parent ec2176a2bb
commit beb7521eb0
@@ -32,10 +32,9 @@
checkable checkable
:loading="loading" :loading="loading"
:tree-data="gData" :tree-data="gData"
v-model:checkedKeys="selectedKey"
@select="onSelect"
@check="onCheck" @check="onCheck"
@expand="onExpand" @expand="onExpand"
v-model:checkedKeys="defaultCheckedKeys"
:defaultCheckedKeys="defaultCheckedKeys" :defaultCheckedKeys="defaultCheckedKeys"
:defaultExpandedKeys="defaultExpandedKeys" :defaultExpandedKeys="defaultExpandedKeys"
> >
@@ -86,9 +85,10 @@
this.queryDepartUserTreeList() this.queryDepartUserTreeList()
this.visible = true this.visible = true
}, },
onSelect(selectedKeys, info) { // onSelect(selectedKeys, info) {
this.selectedKey = selectedKeys // console.log(selectedKeys)
}, // this.selectedKey = selectedKeys
// },
onCheck(checkedKeys, info) { onCheck(checkedKeys, info) {
this.userIds = [] this.userIds = []
@@ -167,30 +167,25 @@
if (res.success) { if (res.success) {
this.gData = res.result this.gData = res.result
this.defaultExpandedKeys = [this.departId] this.defaultExpandedKeys = [this.departId]
if (this.personneQuery[this.query.db_field_name + '_id']) { if (this.userName && this.userName.length == 0) {
this.defaultCheckedKeys = this.personneQuery[this.query.db_field_name + '_id'].split(',') if (this.personneQuery[this.query.db_field_name + 'Name']) {
this.selectedKey = this.personneQuery[this.query.db_field_name + '_id'].split(',') this.userName = this.personneQuery[this.query.db_field_name + 'Name'].split(',')
} else if (this.personneQuery[this.query.db_field_name]) { } else if (this.personneQuery[this.query.db_field_name]) {
this.defaultCheckedKeys = this.personneQuery[this.query.db_field_name].split(',') this.userName = this.personneQuery[this.query.db_field_name].split(',')
this.selectedKey = this.personneQuery[this.query.db_field_name].split(',') } else {
} else { this.userName = []
this.defaultCheckedKeys = [] }
this.selectedKey = []
} }
if (this.personneQuery[this.query.db_field_name + 'Name']) { if (this.userIds && this.userIds.length == 0) {
this.userName = this.personneQuery[this.query.db_field_name + 'Name'].split(',') if (this.personneQuery[this.query.db_field_name + '_id']) {
} else if (this.personneQuery[this.query.db_field_name]) { this.userIds = this.personneQuery[this.query.db_field_name + '_id'].split(',')
this.userName = this.personneQuery[this.query.db_field_name].split(',') } else if (this.personneQuery[this.query.db_field_name]) {
} else { this.userIds = this.personneQuery[this.query.db_field_name].split(',')
this.userName = [] } else {
} this.userIds = []
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 this.treeVisible = true
} else { } else {
this.gData = [] this.gData = []