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