jiaxing.zhou

refactor(roleConfig): 调整角色配置对话框逻辑

- 将 watch 代码块的位置进行调整,移到 methods 前面
- 优化了 outerVisible监听器中的逻辑,根据不同类型初始化 formData
......@@ -94,6 +94,14 @@ export default {
watch: {
outerVisible(val) {
if (val) {
this.loadings.dialogLoading = false;
if (this.type == "update") {
this.formData = this.active;
} else if (this.type == "menuChange") {
this.formData = this.active;
this.searchTreeData();
this.loadCheckedKeys();//加载已绑定的菜单
}
}
},
},
......@@ -128,20 +136,6 @@ export default {
loadingText: "",
};
},
watch: {
outerVisible(val) {
if (val) {
this.loadings.dialogLoading = false;
if (this.type == "update") {
this.formData = this.active;
} else if (this.type == "menuChange") {
this.formData = this.active;
this.searchTreeData();
this.loadCheckedKeys();//加载已绑定的菜单
}
}
},
},
methods: {
//查询菜单数据
searchTreeData() {
......