Explorar o código

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

Casper Dai %!s(int64=2) %!d(string=hai) anos
pai
achega
2d1e90b26c
Modificáronse 2 ficheiros con 6 adicións e 10 borrados
  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