@@ -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 || []
+ }]
}
})
@@ -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