Commit ef4b7e08 by xinla

--no commit message

1 parent be107dab
......@@ -43,20 +43,23 @@ export default {
}
},
watch: {
defaultValues(value) {
const checkedUserList = []
if (!Array.isArray(value) || value.length == 0) {
this.userList = []
} else {
value.forEach((i) => {
const id = i.deptId
if (id) {
checkedUserList.push(i)
}
})
console.log(checkedUserList)
this.userList = checkedUserList
}
defaultValues: {
deep: true,
handler(value) {
const checkedUserList = []
if (!Array.isArray(value) || value.length == 0) {
this.userList = []
} else {
value.forEach((i) => {
const id = i.deptId
if (id) {
checkedUserList.push(i)
}
})
console.log(checkedUserList)
this.userList = checkedUserList
}
},
},
Pvisible(val) {
val && this.$refs.tree && this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.deptId))
......
......@@ -41,6 +41,7 @@ export default {
this.selectList = value
},
immediate: true,
deep: true,
},
Pvisible(val) {
this.selectList = this.defaultValues
......
......@@ -72,6 +72,7 @@ export default {
}
},
immediate: true,
deep: true,
},
Pvisible(val) {
val && this.$refs.tree && this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.userId || e.id))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!