From 2952cb2c4fd1c51e28c6a6d6728f505155d4ee47 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期日, 21 八月 2022 22:54:25 +0800
Subject: [PATCH] 优化多角色数据权限匹配规则

---
 src/views/system/role/index.vue |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index cf71f5c..ee2e11d 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -262,9 +262,8 @@
 </template>
 
 <script setup name="Role">
-import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole } from "@/api/system/role";
+import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole, deptTreeSelect } from "@/api/system/role";
 import { roleMenuTreeselect, treeselect as menuTreeselect } from "@/api/system/menu";
-import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
 
 const router = useRouter();
 const { proxy } = getCurrentInstance();
@@ -462,8 +461,8 @@
   });
 }
 /** 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戠粨鏋� */
-function getRoleDeptTreeselect(roleId) {
-  return roleDeptTreeselect(roleId).then(response => {
+function getDeptTree(roleId) {
+  return deptTreeSelect(roleId).then(response => {
     deptOptions.value = response.depts;
     return response;
   });
@@ -543,12 +542,12 @@
 /** 鍒嗛厤鏁版嵁鏉冮檺鎿嶄綔 */
 function handleDataScope(row) {
   reset();
-  const roleDeptTreeselect = getRoleDeptTreeselect(row.roleId);
+  const deptTreeSelect = getDeptTree(row.roleId);
   getRole(row.roleId).then(response => {
     form.value = response.data;
     openDataScope.value = true;
     nextTick(() => {
-      roleDeptTreeselect.then(res => {
+      deptTreeSelect.then(res => {
         nextTick(() => {
           if (deptRef.value) {
             deptRef.value.setCheckedKeys(res.checkedKeys);

--
Gitblit v1.9.3