diff --git a/src/views/projectFront/configManage/roleManage.vue b/src/views/projectFront/configManage/roleManage.vue index 7829f7ed..6952e8fa 100644 --- a/src/views/projectFront/configManage/roleManage.vue +++ b/src/views/projectFront/configManage/roleManage.vue @@ -300,21 +300,31 @@ export default { console.log('获取角色配置的菜单',arr); // var arr2 = []; console.log(arr); - if (arr.length > 0) { - arr.forEach(element => { - if (element.authorityId) { - this.dataList.push(element.authorityId); - } - // else{ - // arr2.push(element.moduleId) - // } - }); - } + // if (arr.length > 0) { + // arr.forEach(element => { + // if (element.authorityId) { + // this.dataList.push(element.authorityId); + // } + // // else{ + // // arr2.push(element.moduleId) + // // } + // }); + // } this.$nextTick(() => { - this.$refs.tree.setCheckedKeys(this.dataList); + this.$refs.tree.setCheckedKeys(this.getRelativeKeys(res.result)); }); }); }, + // 根据条件获取需要选中的节点keys + getRelativeKeys(arr) { + let keysArr = []; + arr.map((item) => { + if (!item.hasSubList) { + keysArr.push(item.authorityId); + } + }); + return keysArr; + }, // 取消菜单配置 cancleBtn() { this.Popup.power = false;