Refactor RGangguan_ALL.vue and RGangguan_KTI.vue components, and add getDataRowGroup function
This commit is contained in:
@@ -1134,7 +1134,7 @@ import {
|
||||
exportDetailToXLSX
|
||||
} from '@/report/Gangguan/Rekap/RGangguan_KTI'
|
||||
import { getMonthNumber } from '@/utils/texts'
|
||||
|
||||
import { getDataRowGroup } from '@/utils/data'
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
const position = { of: '#data' }
|
||||
@@ -1155,43 +1155,16 @@ const reportMeta = ref({
|
||||
posko: { id: 0, name: 'Semua Posko' },
|
||||
periode: ''
|
||||
})
|
||||
const groupIndex = ref(0)
|
||||
const groupDialog = ref(false)
|
||||
const groupData = ref<any>(null)
|
||||
|
||||
const onCellClicked = (e: any) => {
|
||||
console.log('cell clicked', e)
|
||||
// console.log('group cell clicked', e.column.caption)
|
||||
// console.log('value', e.values[e.row.groupIndex])
|
||||
if (e.rowType == 'group') {
|
||||
groupDialog.value = true
|
||||
groupIndex.value = e.row.groupIndex
|
||||
if (e.row.groupIndex == 0) {
|
||||
//
|
||||
} else if (e.row.groupIndex == 1) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0].collapsedItems[0].items[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0].items[0].items[0]
|
||||
groupData.value = data
|
||||
}
|
||||
} else if (e.row.groupIndex == 2) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0].collapsedItems[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0].items[0]
|
||||
groupData.value = data
|
||||
}
|
||||
} else if (e.row.groupIndex == 3) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0]
|
||||
groupData.value = data
|
||||
}
|
||||
if (e.row.groupIndex != 0) {
|
||||
const data = getDataRowGroup(e.data)
|
||||
console.table(data)
|
||||
groupData.value = data
|
||||
}
|
||||
showDetail()
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user