Commit 20548da999af14063ad0177fab16ebea07baa233

Authored by 芋道源码
Committed by Gitee
2 parents cefcff65 2e974421

!107 【修改】角色菜单集合复选框回显不正确

Merge pull request !107 from @C/master
yudao-ui-admin/src/views/system/role/index.vue
... ... @@ -392,16 +392,17 @@ export default {
392 392 // 处理 menuOptions 参数
393 393 this.menuOptions = [];
394 394 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 + })
395 404 });
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 +
405 406 },
406 407 /** 分配数据权限操作 */
407 408 handleDataScope(row) {
... ...