Update import statement for getDataRowGroup in RGangguan_ALL and RGangguan_KTI
This commit is contained in:
parent
e97805be5a
commit
948895dfb5
@ -1081,7 +1081,7 @@ import {
|
|||||||
exportDetailToPDF,
|
exportDetailToPDF,
|
||||||
exportDetailToXLSX
|
exportDetailToXLSX
|
||||||
} from '@/report/Gangguan/Rekap/RGangguan_ALL'
|
} from '@/report/Gangguan/Rekap/RGangguan_ALL'
|
||||||
import { getDataRowGroup } from '@/utils/data'
|
import { getDataRowGroup } from '@/utils/helper'
|
||||||
|
|
||||||
const client = apolloClient()
|
const client = apolloClient()
|
||||||
provideApolloClient(client)
|
provideApolloClient(client)
|
||||||
@ -1561,3 +1561,4 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@/utils/helper
|
||||||
|
@ -1134,7 +1134,7 @@ import {
|
|||||||
exportDetailToXLSX
|
exportDetailToXLSX
|
||||||
} from '@/report/Gangguan/Rekap/RGangguan_KTI'
|
} from '@/report/Gangguan/Rekap/RGangguan_KTI'
|
||||||
import { getMonthNumber } from '@/utils/texts'
|
import { getMonthNumber } from '@/utils/texts'
|
||||||
import { getDataRowGroup } from '@/utils/data'
|
import { getDataRowGroup } from '@/utils/helper'
|
||||||
const client = apolloClient()
|
const client = apolloClient()
|
||||||
provideApolloClient(client)
|
provideApolloClient(client)
|
||||||
const position = { of: '#data' }
|
const position = { of: '#data' }
|
||||||
@ -1659,3 +1659,4 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@/utils/helper
|
||||||
|
39
src/utils/helper.ts
Normal file
39
src/utils/helper.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
export const getDataRowGroup = (data: any): any => {
|
||||||
|
if (Array.isArray(data)) {
|
||||||
|
if (data[0].items) {
|
||||||
|
if (Array.isArray(data[0].items)) {
|
||||||
|
return getDataRowGroup(data[0].items[0])
|
||||||
|
} else {
|
||||||
|
return getDataRowGroup(data[0].items)
|
||||||
|
}
|
||||||
|
} else if (data[0].collapsedItems) {
|
||||||
|
if (Array.isArray(data[0].collapsedItems)) {
|
||||||
|
return getDataRowGroup(data[0].collapsedItems[0])
|
||||||
|
} else {
|
||||||
|
return getDataRowGroup(data[0].collapsedItems)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Array.isArray(data[0])) {
|
||||||
|
return getDataRowGroup(data[0])
|
||||||
|
} else {
|
||||||
|
return getDataRowGroup(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (data.items) {
|
||||||
|
if (Array.isArray(data.items)) {
|
||||||
|
return getDataRowGroup(data.items[0])
|
||||||
|
} else {
|
||||||
|
return getDataRowGroup(data.items)
|
||||||
|
}
|
||||||
|
} else if (data.collapsedItems) {
|
||||||
|
if (Array.isArray(data.collapsedItems)) {
|
||||||
|
return getDataRowGroup(data.collapsedItems[0])
|
||||||
|
} else {
|
||||||
|
return getDataRowGroup(data.collapsedItems)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user