Update DxGrouping configuration in MonalisaGR_JumlahKaliGangguan.vue
This commit is contained in:
@ -22,7 +22,7 @@
|
|||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
:row-alternation-enabled="true"
|
:row-alternation-enabled="true"
|
||||||
:hover-state-enabled="true"
|
:hover-state-enabled="true"
|
||||||
@selection-changed="onSelectionChanged"
|
@selection-changed="onDataSelectionChanged"
|
||||||
@exporting="onExporting"
|
@exporting="onExporting"
|
||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
@ -36,8 +36,7 @@
|
|||||||
:show-indicator="showIndicator"
|
:show-indicator="showIndicator"
|
||||||
:show-pane="showPane"
|
:show-pane="showPane"
|
||||||
:shading="shading"
|
:shading="shading"
|
||||||
v-if="loading"
|
v-model:visible="loadingData"
|
||||||
v-model:visible="loading"
|
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
/>
|
/>
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
@ -419,7 +418,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #formatTime="{ data }">
|
<template #formatTime="{ data }">
|
||||||
<p class="!text-right">
|
<p class="!text-right cursor-pointer">
|
||||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
@ -431,7 +430,7 @@
|
|||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref, watch } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -454,12 +453,23 @@ import { useQuery } from '@vue/apollo-composable'
|
|||||||
import { queries } from '@/utils/api/api.graphql'
|
import { queries } from '@/utils/api/api.graphql'
|
||||||
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||||
import { exportToPDF } from '@/report/Gangguan/Rekap/RGangguan_JenisGangguan'
|
import { exportToPDF } from '@/report/Gangguan/Rekap/RGangguan_JenisGangguan'
|
||||||
|
import { apolloClient } from '@/utils/api/api.graphql'
|
||||||
|
import { provideApolloClient } from '@vue/apollo-composable'
|
||||||
|
|
||||||
|
const client = apolloClient()
|
||||||
|
provideApolloClient(client)
|
||||||
const position = { of: '#data' }
|
const position = { of: '#data' }
|
||||||
const showIndicator = ref(true)
|
const showIndicator = ref(true)
|
||||||
const shading = ref(true)
|
const shading = ref(true)
|
||||||
const showPane = ref(true)
|
const showPane = ref(true)
|
||||||
const data = ref<any[]>([])
|
const data = ref<any[]>([])
|
||||||
|
const dataSub = ref<any[]>([])
|
||||||
|
const dataSelected = ref<any>()
|
||||||
|
const dataSubSelected = ref<any>()
|
||||||
|
const dialogDetail = ref(false)
|
||||||
|
const closedialogDetail = () => (dialogDetail.value = false)
|
||||||
|
const loadingData = ref(false)
|
||||||
|
const loadingSubData = ref(false)
|
||||||
const reportMeta = ref({
|
const reportMeta = ref({
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
@ -467,14 +477,6 @@ const reportMeta = ref({
|
|||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const { onResult, onError, loading, refetch } = useQuery(queries.gangguan.rekap.jenisGangguan, {
|
|
||||||
dateFrom: new Date().toISOString().slice(0, 10),
|
|
||||||
dateTo: new Date().toISOString().slice(0, 10),
|
|
||||||
posko: '',
|
|
||||||
idUid: 0,
|
|
||||||
idUp3: 0
|
|
||||||
})
|
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
const onExporting = (e: any) => {
|
||||||
if (e.format === 'pdf') {
|
if (e.format === 'pdf') {
|
||||||
exportToPDF(reportMeta.value, data.value)
|
exportToPDF(reportMeta.value, data.value)
|
||||||
@ -495,21 +497,67 @@ const onExporting = (e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getDetail = () => {
|
||||||
|
// const dateValue = filters.value.periode.split(' s/d ')
|
||||||
|
// const selected = dataSelected.value
|
||||||
|
// const query = {
|
||||||
|
// dateFrom: dateValue[0]
|
||||||
|
// ? dateValue[0].split('-').reverse().join('-')
|
||||||
|
// : new Date().toISOString().slice(0, 10),
|
||||||
|
// dateTo: dateValue[1]
|
||||||
|
// ? dateValue[1].split('-').reverse().join('-')
|
||||||
|
// : new Date().toISOString().slice(0, 10),
|
||||||
|
// idUlp: selected?.id_ulp ? selected?.id_ulp : 0,
|
||||||
|
// idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||||
|
// idUp3: selected?.id_up3 ? selected?.id_up3 : 0
|
||||||
|
// }
|
||||||
|
// const { onResult, onError, loading } = useQuery(
|
||||||
|
// queries.keluhan.rekap.rekapKeluhanAllDetail,
|
||||||
|
// query
|
||||||
|
// )
|
||||||
|
// onResult((queryResult) => {
|
||||||
|
// if (queryResult.data != undefined) {
|
||||||
|
// dataSub.value = queryResult.data.detailKeluhanAll
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// onError((error) => {
|
||||||
|
// console.log(error)
|
||||||
|
// })
|
||||||
|
// watch(loading, (value) => {
|
||||||
|
// loadingSubData.value = value
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
dataGrid.clearSelection()
|
dataGrid.clearSelection()
|
||||||
}
|
}
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
const showDetail = () => {
|
||||||
const data = selectedRowsData[0]
|
|
||||||
clearSelection()
|
clearSelection()
|
||||||
|
dataSubSelected.value = null
|
||||||
|
dialogDetail.value = true
|
||||||
|
getDetail()
|
||||||
|
}
|
||||||
|
|
||||||
|
const onDataSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
|
if (selectedRowsData[0] != undefined) {
|
||||||
|
dataSelected.value = selectedRowsData[0]
|
||||||
|
showDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
|
const data = selectedRowsData[0]
|
||||||
|
dataSubSelected.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = (params: any) => {
|
const filterData = (params: any) => {
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
const { posko, uid, up3 } = params
|
const { posko, uid, up3 } = params
|
||||||
|
|
||||||
refetch({
|
const { onResult, onError, loading, refetch } = useQuery(queries.gangguan.rekap.jenisGangguan, {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -520,9 +568,11 @@ const filterData = (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
})
|
})
|
||||||
|
|
||||||
onResult((queryResult) => {
|
onResult((queryResult) => {
|
||||||
if (queryResult.data != undefined) {
|
if (queryResult.data != undefined) {
|
||||||
data.value = queryResult.data.rekapitulasiPerJenisGangguan.map((item: any, index: number) => {
|
data.value = [...queryResult.data.rekapitulasiPerJenisGangguan].map(
|
||||||
|
(item: any, index: number) => {
|
||||||
return {
|
return {
|
||||||
no: ++index,
|
no: ++index,
|
||||||
sub_kelompok: item.sub_kelompok,
|
sub_kelompok: item.sub_kelompok,
|
||||||
@ -564,14 +614,20 @@ const filterData = (params: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
reportMeta.value = filters.value
|
||||||
})
|
})
|
||||||
|
|
||||||
onError((queryError) => {
|
onError((queryError) => {
|
||||||
console.log(queryError)
|
console.log(queryError)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(loading, (value) => {
|
||||||
|
loadingData.value = value
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const filters = ref()
|
const filters = ref()
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="true"
|
:word-wrap-enabled="true"
|
||||||
>
|
>
|
||||||
<DxGrouping expand-mode="rowClick" />
|
<DxGrouping expand-mode="rowClick" :auto-expand-all="false" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :enabled="false" />
|
<DxPaging :enabled="false" />
|
||||||
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
||||||
|
Reference in New Issue
Block a user