|
|
|
@ -30,6 +30,7 @@
|
|
|
|
|
<a-tree
|
|
|
|
|
class="tree"
|
|
|
|
|
v-model="checkedKeys"
|
|
|
|
|
v-if="treeShow != undefined"
|
|
|
|
|
checkable
|
|
|
|
|
:defaultExpandAll="true"
|
|
|
|
|
:replace-fields="replaceFields"
|
|
|
|
@ -91,6 +92,7 @@ export default {
|
|
|
|
|
actions: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
treeShow: undefined,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
@ -108,7 +110,7 @@ export default {
|
|
|
|
|
this.roleId = data;
|
|
|
|
|
FindAllMenus({ roleId: this.roleId }).then((res) => {
|
|
|
|
|
this.menus = res.data;
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
// console.log(res.data)
|
|
|
|
|
this.defaultCheck(this.menus);
|
|
|
|
|
});
|
|
|
|
|
} else if (data === undefined) {
|
|
|
|
@ -116,7 +118,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
rolechange(data) {
|
|
|
|
|
if (data) {
|
|
|
|
|
this.treeShow = data;
|
|
|
|
|
if (data != undefined) {
|
|
|
|
|
this.checkedKeys = [];
|
|
|
|
|
this.roleId = this.roleList[data].id;
|
|
|
|
|
FindAllMenus({ roleId: this.roleId }).then((res) => {
|
|
|
|
@ -125,7 +128,7 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.roleId = null;
|
|
|
|
|
this.menus = [];
|
|
|
|
|
// this.menus = [];
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
defaultCheck(arr) {
|
|
|
|
@ -139,7 +142,7 @@ export default {
|
|
|
|
|
this.checkedKeys.push(item.id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(this.checkedKeys)
|
|
|
|
|
// console.log(this.checkedKeys)
|
|
|
|
|
},
|
|
|
|
|
onExpand(expandedKeys) {
|
|
|
|
|
this.expandedKeys = expandedKeys;
|
|
|
|
|