|
|
@@ -44,7 +44,7 @@
|
|
44
|
44
|
<script setup>
|
|
45
|
45
|
import { onMounted, onUnmounted } from 'vue'
|
|
46
|
46
|
import { searchPortraitUsers } from '@/api/score/index'
|
|
47
|
|
-import { getDeptList } from '@/api/item/items'
|
|
|
47
|
+import { getDeptList,getDeptUserTree } from '@/api/item/items'
|
|
48
|
48
|
import { listDept } from '@/api/system/dept'
|
|
49
|
49
|
|
|
50
|
50
|
const props = defineProps({
|
|
|
@@ -140,13 +140,13 @@ const handleNodeClick = (node) => {
|
|
140
|
140
|
if (node.deptType === props.deptType) {
|
|
141
|
141
|
personName.value = node.deptName || node.name || node.label;
|
|
142
|
142
|
let obj = {}
|
|
143
|
|
- if(props.deptType === 'BRIGADE') {
|
|
|
143
|
+ if (props.deptType === 'BRIGADE') {
|
|
144
|
144
|
obj = { deptId: node.deptId || node.id }
|
|
145
|
|
- }
|
|
146
|
|
- if(props.deptType === 'MANAGER') {
|
|
|
145
|
+ }
|
|
|
146
|
+ if (props.deptType === 'MANAGER') {
|
|
147
|
147
|
obj = { teamId: node.deptId || node.id }
|
|
148
|
148
|
}
|
|
149
|
|
- if(props.deptType === 'TEAMS') {
|
|
|
149
|
+ if (props.deptType === 'TEAMS') {
|
|
150
|
150
|
obj = { groupId: node.deptId || node.id }
|
|
151
|
151
|
}
|
|
152
|
152
|
searchHandler(obj)
|
|
|
@@ -177,10 +177,13 @@ const resetStyle = () => {
|
|
177
|
177
|
|
|
178
|
178
|
onMounted(async () => {
|
|
179
|
179
|
setStyle()
|
|
180
|
|
- const res = await getDeptList({ deptType: props.deptType })
|
|
|
180
|
+
|
|
181
|
181
|
if (props.deptType === 'user') {
|
|
|
182
|
+ const res = await getDeptUserTree()
|
|
182
|
183
|
departments.value = res.data
|
|
|
184
|
+
|
|
183
|
185
|
} else {
|
|
|
186
|
+ const res = await getDeptList({ deptType: props.deptType })
|
|
184
|
187
|
departments.value = filterDeptTree(res.data, props.deptType)
|
|
185
|
188
|
}
|
|
186
|
189
|
})
|