Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
eddde649
Commit
eddde649
authored
Nov 09, 2023
by
jingnan
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并产品【8067】 权限设置,勾选父级自动勾选子级
parent
a8682b52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
menuPermTree.vue
.../views/roleManagement/menuPermAssignment/menuPermTree.vue
+16
-0
No files found.
applications/dee-perm/src/views/roleManagement/menuPermAssignment/menuPermTree.vue
View file @
eddde649
...
...
@@ -155,6 +155,7 @@ export default {
},
onCheckBoxClick(nodeData) {
let node = this.$refs.tree.getNode(nodeData.id)
const clickNode = node
const isChecked = node.checked
const items = [node.data]
const nodePath = []
...
...
@@ -173,8 +174,23 @@ export default {
items.push(dataPath[i])
}
}
// 当前节点选中,自动勾选它所有的后代节点
const subNodesData = this.getSubNodes(clickNode).map(node => node.data)
items.push(...subNodesData)
}
this.updatePermState(items, isChecked)
},
// 获取指定节点下所有子节点
getSubNodes(parentNode, nodes = []) {
if (!parentNode) return nodes
const childNodes = parentNode.childNodes
if (Array.isArray(childNodes)) {
childNodes.forEach(node => {
nodes.push(node)
this.getSubNodes(node, nodes)
})
}
return nodes
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment