修改bug 52218 选人组件,针对选择多人的情况,选择的人员按顺序显示
This commit is contained in:
@@ -125,6 +125,7 @@
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
selectList: [],
|
||||
nodeList2: [],
|
||||
delList: [],
|
||||
roleList: [],
|
||||
@@ -300,7 +301,21 @@
|
||||
this.delList = [data]
|
||||
}
|
||||
} else { // 多选
|
||||
this.roleList = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes())
|
||||
if (this.roleList.length === 0) {
|
||||
this.roleList.push(data)
|
||||
} else {
|
||||
let delFlag = true
|
||||
this.roleList.forEach((item, index) => {
|
||||
if (item.id === data.id) {
|
||||
this.roleList.splice(index, 1)
|
||||
delFlag = false
|
||||
}
|
||||
})
|
||||
if (delFlag) {
|
||||
this.roleList.push(data)
|
||||
}
|
||||
}
|
||||
// this.roleList = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes())
|
||||
}
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
|
||||
Reference in New Issue
Block a user