Bladeren bron

数据权限更换用户接口

Karsa 3 maanden geleden
bovenliggende
commit
92f37bcdd3
2 gewijzigde bestanden met toevoegingen van 17 en 6 verwijderingen
  1. 2 2
      src/views/system_manage/components/opearAuthSetDia.vue
  2. 15 4
      src/views/system_manage/dataOperaAuth.vue

+ 2 - 2
src/views/system_manage/components/opearAuthSetDia.vue

@@ -21,8 +21,8 @@
           ref="userRef"
           :options="userList"
           :props="{
-            value: 'ItemId',
-            label: 'ItemName',
+            value: 'NodeId',
+            label: 'NodeName',
             children: 'Children',
             emitPath: false,
             multiple: true,

+ 15 - 4
src/views/system_manage/dataOperaAuth.vue

@@ -13,8 +13,8 @@
           v-model="searchForm.user"
           :options="userList"
           :props="{
-            value: 'ItemId',
-            label: 'ItemName',
+            value: 'NodeId',
+            label: 'NodeName',
             children: 'Children',
             emitPath: false
           }"
@@ -466,10 +466,21 @@ export default {
      /* 获取用户列表 */
     async getUserList() {
       
-      const res = await dataAuthInterface.userSearch();
+      const res = await departInterence.getSystemUser();
       if (res.Ret !== 200) return
-      
+    
       this.userList = res.Data || []
+      this.filterTreeEmpty(this.userList)
+    },
+
+    // 递归处理数组
+    filterTreeEmpty(arr) {
+      arr.length && arr.forEach(item => {
+        item.Children && item.Children.length && this.filterTreeEmpty(item.Children)
+        if (!item.Children || !item.Children.length) {
+          delete item.Children
+        }
+      })
     },
 
     /* 获取用户的资产数量 */