|
@@ -39,13 +39,16 @@ const { fetch, result, loading } = useFetch('getStatisticsByGroup')
|
|
|
|
|
|
const data = computed<ExtractApiResponse<'getStatisticsByGroup'>>(() => {
|
|
const data = computed<ExtractApiResponse<'getStatisticsByGroup'>>(() => {
|
|
const groupList = result?.value?.slice(0) || []
|
|
const groupList = result?.value?.slice(0) || []
|
|
|
|
+ const totalIndex = groupList.findIndex((v) => v.markingGroupNumber === 0)
|
|
return fetchModel.value.expand
|
|
return fetchModel.value.expand
|
|
? groupList
|
|
? groupList
|
|
|
|
+ .filter((v) => v.markingGroupNumber !== 0)
|
|
.reduce((total, cur) => {
|
|
.reduce((total, cur) => {
|
|
total.push(...(cur.markerDetails || []))
|
|
total.push(...(cur.markerDetails || []))
|
|
return total
|
|
return total
|
|
}, [] as ExtractApiResponse<'getStatisticsByGroup'>)
|
|
}, [] as ExtractApiResponse<'getStatisticsByGroup'>)
|
|
.sort((a, b) => a.markerId - b.markerId)
|
|
.sort((a, b) => a.markerId - b.markerId)
|
|
|
|
+ .concat(totalIndex >= 0 ? groupList[totalIndex] : [])
|
|
: groupList.sort((a, b) => a.markingGroupNumber - b.markingGroupNumber)
|
|
: groupList.sort((a, b) => a.markingGroupNumber - b.markingGroupNumber)
|
|
})
|
|
})
|
|
|
|
|