From 2e9744218736702a06c42c0ac33fbd688364daf0 Mon Sep 17 00:00:00 2001 From: cks Date: Wed, 23 Mar 2022 15:21:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E8=8F=9C=E5=8D=95=E9=9B=86=E5=90=88=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E6=A1=86=E5=9B=9E=E6=98=BE=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/role/index.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/yudao-ui-admin/src/views/system/role/index.vue b/yudao-ui-admin/src/views/system/role/index.vue index a56349d3b..e38eb69db 100644 --- a/yudao-ui-admin/src/views/system/role/index.vue +++ b/yudao-ui-admin/src/views/system/role/index.vue @@ -392,16 +392,17 @@ export default { // 处理 menuOptions 参数 this.menuOptions = []; this.menuOptions.push(...this.handleTree(response.data, "id")); + // 获取角色拥有的菜单权限 + listRoleMenus(id).then(response => { + // 设置为严格,避免设置父节点自动选中子节点,解决半选中问题 + this.form.menuCheckStrictly = true + // 设置选中 + this.$refs.menu.setCheckedKeys(response.data); + // 设置为非严格,继续使用半选中 + this.form.menuCheckStrictly = false + }) }); - // 获得角色拥有的菜单集合 - listRoleMenus(id).then(response => { - // 设置为严格,避免设置父节点自动选中子节点,解决半选中问题 - this.form.menuCheckStrictly = true - // 设置选中 - this.$refs.menu.setCheckedKeys(response.data); - // 设置为非严格,继续使用半选中 - this.form.menuCheckStrictly = false - }) + }, /** 分配数据权限操作 */ handleDataScope(row) {