Commit ef4b7e08 by xinla

--no commit message

1 parent be107dab
...@@ -43,20 +43,23 @@ export default { ...@@ -43,20 +43,23 @@ export default {
} }
}, },
watch: { watch: {
defaultValues(value) { defaultValues: {
const checkedUserList = [] deep: true,
if (!Array.isArray(value) || value.length == 0) { handler(value) {
this.userList = [] const checkedUserList = []
} else { if (!Array.isArray(value) || value.length == 0) {
value.forEach((i) => { this.userList = []
const id = i.deptId } else {
if (id) { value.forEach((i) => {
checkedUserList.push(i) const id = i.deptId
} if (id) {
}) checkedUserList.push(i)
console.log(checkedUserList) }
this.userList = checkedUserList })
} console.log(checkedUserList)
this.userList = checkedUserList
}
},
}, },
Pvisible(val) { Pvisible(val) {
val && this.$refs.tree && this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.deptId)) val && this.$refs.tree && this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.deptId))
......
...@@ -41,6 +41,7 @@ export default { ...@@ -41,6 +41,7 @@ export default {
this.selectList = value this.selectList = value
}, },
immediate: true, immediate: true,
deep: true,
}, },
Pvisible(val) { Pvisible(val) {
this.selectList = this.defaultValues this.selectList = this.defaultValues
......
...@@ -72,6 +72,7 @@ export default { ...@@ -72,6 +72,7 @@ export default {
} }
}, },
immediate: true, immediate: true,
deep: true,
}, },
Pvisible(val) { Pvisible(val) {
val && this.$refs.tree && this.$refs.tree.setCheckedKeys(this.defaultValues.map((e) => e.userId || e.id)) 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!