|
|
@@ -314,12 +314,12 @@ export function getDepartments () {
|
|
|
}
|
|
|
|
|
|
export function getDepartmentTree () {
|
|
|
- if (store.getters.isTenantAdmin) {
|
|
|
+ if (store.getters.isTopGroup) {
|
|
|
return getDepartments().then(({ data }) => {
|
|
|
return {
|
|
|
data: [{
|
|
|
path: store.getters.tenant,
|
|
|
- name: '我的部门',
|
|
|
+ name: store.getters.tenantName || '我的部门',
|
|
|
children: data
|
|
|
}]
|
|
|
}
|
|
|
@@ -330,11 +330,13 @@ export function getDepartmentTree () {
|
|
|
method: 'GET'
|
|
|
}).then(({ data }) => {
|
|
|
return {
|
|
|
- data: [{
|
|
|
- path: store.getters.org,
|
|
|
- name: '我的部门',
|
|
|
- children: data || []
|
|
|
- }]
|
|
|
+ data: Array.isArray(data)
|
|
|
+ ? [{
|
|
|
+ path: store.getters.org,
|
|
|
+ name: '我的部门',
|
|
|
+ children: []
|
|
|
+ }]
|
|
|
+ : [data]
|
|
|
}
|
|
|
})
|
|
|
}
|