Commit edb9b36d by LJM

bug

parent 8cc1b7dc
Showing with 44 additions and 5 deletions
......@@ -27,7 +27,7 @@
<section class="role-auth">
<ul class="row">
<li v-for="(item,index) in menuData" :key="item.id">
<el-tree :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckChange"></el-tree>
<el-tree ref="tree" :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckChange"></el-tree>
</li>
</ul>
</section>
......@@ -36,7 +36,7 @@
<section class="role-auth">
<ul class="row">
<li v-for="(item,index) in messageMenu" :key="item.id">
<el-tree :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckMsgChange"></el-tree>
<el-tree ref="treeMsg" :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckMsgChange"></el-tree>
</li>
</ul>
</section>
......@@ -92,8 +92,8 @@ export default {
name: '',
password_raw: '123456',
email: '',
user_message_rule: [],
user_rule: []
user_rule: [],
user_message_rule: []
}
};
},
......@@ -103,6 +103,40 @@ export default {
},
methods: {
/**
* 全选 反选
*/
checkAll(type) {
if (type == 1) {
var data = this.$refs.tree;
if (data.length > 0) {
if (this.checked) {
data.forEach((element, index) => {
if (this.menuData[index][0].name != '概况') {
data[index].setCheckedKeys([this.menuData[index][0].id]);
}
});
} else {
data.forEach((element, index) => {
data[index].setCheckedKeys([]);
});
}
}
} else {
var data = this.$refs.treeMsg;
if (data.length > 0) {
if (this.checked_msg) {
data.forEach((element, index) => {
data[index].setCheckedKeys([this.messageMenu[index][0].id]);
});
} else {
data.forEach((element, index) => {
data[index].setCheckedKeys([]);
});
}
}
}
},
/**
* 获取当前用户的权限菜单
*/
getMenu() {
......@@ -197,9 +231,14 @@ export default {
this.$router.push('/subAccount')
}, 2000)
} else {
this.formParam.user_rule = JSON.parse(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.parse(this.formParam.user_message_rule);
this.$message({
message: res.msg,
type: 'error'
type: 'error',
onClose: () => {
}
});
}
})
......
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 sign in to comment