Commit 1d48ea95 by xue_wengang

Update queryRole.vue

parent 96e74a8e
...@@ -142,6 +142,7 @@ export default { ...@@ -142,6 +142,7 @@ export default {
checkAll: false, checkAll: false,
selec: [], selec: [],
parentArr: [], parentArr: [],
allMenu: [],
}; };
}, },
created() { created() {
...@@ -185,6 +186,7 @@ export default { ...@@ -185,6 +186,7 @@ export default {
this.getTreeCode(item.children); this.getTreeCode(item.children);
} else { } else {
item.label = item.title; item.label = item.title;
this.allMenu.push(item.id);
} }
}); });
return children; return children;
...@@ -226,7 +228,10 @@ export default { ...@@ -226,7 +228,10 @@ export default {
this.selec = new Set( this.selec = new Set(
this.selectedId[0].menuListId.filter((x) => !arr.has(x)) this.selectedId[0].menuListId.filter((x) => !arr.has(x))
); );
//this.selec = this.selectedId[0].menuListId; debugger;
if (this.selec.size == this.allMenu.length) {
this.checkAll = true;
}
} else { } else {
this.$message.error("请选择角色"); this.$message.error("请选择角色");
} }
...@@ -237,10 +242,6 @@ export default { ...@@ -237,10 +242,6 @@ export default {
}); });
}, },
selectionChange(val) { selectionChange(val) {
// this.selectedId = [];
// row.forEach((item) => {
// this.selectedId.push(item.id);
// });
debugger; debugger;
this.selectedId = val; this.selectedId = val;
this.checkAll = false; this.checkAll = false;
...@@ -251,28 +252,10 @@ export default { ...@@ -251,28 +252,10 @@ export default {
this.$message.warning("只能单选"); this.$message.warning("只能单选");
return; return;
} }
// this.$nextTick(() => {
// this.$refs.tree.setCheckedKeys([]);
// });
}, },
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
}, },
handleCheckChange(data, checked, check) {
// debugger
// if (checked === true) {
// if (data.hasChildren) {
// this.handleChildren(data.children);
// } else {
// this.selectedTree.push(data.id);
// }
// } else {
// let index = this.selectedTree.findIndex((item) => item == data.id);
// let indexs = this.selec.findIndex((item) => item == data.id);
// this.selectedTree.splice(index, 1);
// this.selec.splice(indexs, 1);
// }
},
handleChildren(data) { handleChildren(data) {
data.forEach((item) => { data.forEach((item) => {
if (item.hasChildren) { if (item.hasChildren) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment