Переглянути джерело

fix: the department list of non tenant administrators cannot be displayed

Casper Dai 2 роки тому
батько
коміт
2d1e90b26c
2 змінених файлів з 6 додано та 10 видалено
  1. 5 7
      src/api/user.js
  2. 1 3
      src/components/service/DepartmentDrawer/index.vue

+ 5 - 7
src/api/user.js

@@ -330,13 +330,11 @@ export function getDepartmentTree () {
     method: 'GET'
   }).then(({ data }) => {
     return {
-      data: data
-        ? [data]
-        : [{
-          path: store.getters.org,
-          name: '我的部门',
-          children: []
-        }]
+      data: [{
+        path: store.getters.org,
+        name: '我的部门',
+        children: data || []
+      }]
     }
   })
 }

+ 1 - 3
src/components/service/DepartmentDrawer/index.vue

@@ -85,9 +85,7 @@ export default {
         ({ data }) => {
           this.groups = data
           this.expandedKeys = [this.group.path]
-          if (data[0]?.children?.length) {
-            this.drawer = this.$needShow
-          }
+          this.drawer = this.$needShow
         },
         () => {
           this.groups = null