Commit 08fb8e0d authored by jingnan's avatar jingnan 👀

合并产品【8067】权限设置,勾选父级自动勾选子级<2>

parent 9105f67b
......@@ -160,13 +160,13 @@ export default {
const items = [node.data]
const nodePath = []
const dataPath = []
while (node.level >= 1) {
nodePath.push(node)
dataPath.push(node.data)
node = node.parent
}
if (isChecked) {
// 如果父节点没有勾中,则父节点也要勾中
while (node.level >= 1) {
nodePath.push(node)
dataPath.push(node.data)
node = node.parent
}
for (let i = 1; i < nodePath.length; i++) {
if (nodePath[i].checked) {
break
......@@ -174,10 +174,9 @@ export default {
items.push(dataPath[i])
}
}
// 当前节点选中,自动勾选它所有的后代节点
const subNodesData = this.getSubNodes(clickNode).map(node => node.data)
items.push(...subNodesData)
}
const subNodesData = this.getSubNodes(clickNode).map(node => node.data)
items.push(...subNodesData)
this.updatePermState(items, isChecked)
},
// 获取指定节点下所有子节点
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment