Skip to content

Commit 5ff0be3

Browse files
YunaiVgitee-org
authored andcommitted
!107 【修改】角色菜单集合复选框回显不正确
Merge pull request !107 from @C/master
2 parents 7a67fb9 + 3a7b40e commit 5ff0be3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/views/system/role/index.vue

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,16 +392,17 @@ export default {
392392
// 处理 menuOptions 参数
393393
this.menuOptions = [];
394394
this.menuOptions.push(...this.handleTree(response.data, "id"));
395+
// 获取角色拥有的菜单权限
396+
listRoleMenus(id).then(response => {
397+
// 设置为严格,避免设置父节点自动选中子节点,解决半选中问题
398+
this.form.menuCheckStrictly = true
399+
// 设置选中
400+
this.$refs.menu.setCheckedKeys(response.data);
401+
// 设置为非严格,继续使用半选中
402+
this.form.menuCheckStrictly = false
403+
})
395404
});
396-
// 获得角色拥有的菜单集合
397-
listRoleMenus(id).then(response => {
398-
// 设置为严格,避免设置父节点自动选中子节点,解决半选中问题
399-
this.form.menuCheckStrictly = true
400-
// 设置选中
401-
this.$refs.menu.setCheckedKeys(response.data);
402-
// 设置为非严格,继续使用半选中
403-
this.form.menuCheckStrictly = false
404-
})
405+
405406
},
406407
/** 分配数据权限操作 */
407408
handleDataScope(row) {

0 commit comments

Comments
 (0)