301-角色管理-配置法规库树结构权限和配置法规库数据权限,默认展开形式调整。

This commit is contained in:
zyn
2022-12-27 09:59:24 +08:00
parent 4f34727015
commit 46231403fd
+6 -3
View File
@@ -171,7 +171,7 @@
:data="treeData3" :data="treeData3"
:props="defaultProps3" :props="defaultProps3"
:default-checked-keys="nodeList2" :default-checked-keys="nodeList2"
default-expand-all :default-expanded-keys="defaultExpandedKeys"
highlight-current highlight-current
:expand-on-click-node="false" :expand-on-click-node="false"
:show-checkbox="true" :show-checkbox="true"
@@ -202,7 +202,7 @@
:data="treeData4" :data="treeData4"
:props="defaultProps3" :props="defaultProps3"
:default-checked-keys="nodeList4" :default-checked-keys="nodeList4"
default-expand-all :default-expanded-keys="defaultExpandedKeys"
highlight-current highlight-current
:expand-on-click-node="false" :expand-on-click-node="false"
:show-checkbox="true" :show-checkbox="true"
@@ -468,7 +468,8 @@ export default {
children: 'children', children: 'children',
label: 'menuName' label: 'menuName'
}, },
nodeList: [] nodeList: [],
defaultExpandedKeys:[]//默认展开的key
} }
}, },
methods: { methods: {
@@ -685,6 +686,8 @@ export default {
this.treeData4 = this.sortByKey(list1,"displaySeq") this.treeData4 = this.sortByKey(list1,"displaySeq")
} }
// 默认展开的key
this.defaultExpandedKeys = list1.map(item=>item.id)
}, },
sortByKey(ary, key) { sortByKey(ary, key) {