Prechádzať zdrojové kódy

Merge branch 'bug5284'

Karsa 3 mesiacov pred
rodič
commit
97ff520e3d

+ 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
+        }
+      })
     },
 
     /* 获取用户的资产数量 */