Update Type7.vue and DetailDialog.vue components, and style.css

This commit is contained in:
Dede Fuji Abdul
2024-03-07 17:05:21 +07:00
parent c6bb405b57
commit 7bad39e629
9 changed files with 3987 additions and 375 deletions

View File

@ -6,8 +6,8 @@
<div id="data">
<DxDataGrid class="max-h-[calc(100vh-140px)] mb-10" :data-source="data" :show-column-lines="true"
:show-row-lines="false" :show-borders="true" :row-alternation-enabled="true" :hover-state-enabled="true"
@selection-changed="onSelectionChanged" :column-width="100" @exporting="onExporting" :allow-column-resizing="true"
column-resizing-mode="widget">
@selection-changed="onDataSelectionChanged" :column-width="100" @exporting="onExporting"
:allow-column-resizing="true" column-resizing-mode="widget">
<DxSelection mode="single" />
<DxPaging :page-size="5" :enabled="true" />
<DxPager :visible="true" :allowed-page-sizes="[5, 10, 20]" display-mode="full" :show-page-size-selector="true"
@ -69,19 +69,19 @@
</DxColumn>
<template #cellCenter="{ data }">
<p class="cursor-pointer">
<p class="cursor-pointer" @click="showDialogDataSelected()">
{{ data.text }}
</p>
</template>
<template #cellLeft="{ data }">
<p class="text-left cursor-pointer">
<p class="text-left cursor-pointer" @click="showDialogDataSelected()">
{{ data.text }}
</p>
</template>
<template #cellRight="{ data }">
<p class="text-right cursor-pointer">
<p class="text-right cursor-pointer" @click="showDialogDataSelected()">
{{ isNumber(data.text) ? data.column.caption == '%' ? formatPercentage(data.text) :
formatNumber(data.text) :
data.text }}
@ -89,12 +89,114 @@
</template>
<template #data-waktu="{ data }">
<p>
<p @click="showDialogDataSelected()">
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
</p>
</template>
</DxDataGrid>
</div>
<DetailDialog :open="dialogDataSelected" title="Detail Gangguan All" @on-close="closeDialogDataSelected"
:full-width="true">
<div class="flex flex-col w-full space-x-4 space-y-4 lg:flex-row lg:justify-between lg:space-x-4 lg:space-y-0 ">
<div class="flex flex-1 p-4 bg-white rounded-xl">
<div class="w-full">
<DxDataGrid class="max-h-[calc(100vh-140px)] mb-10" :data-source="dataSub" :show-column-lines="true"
:show-row-lines="false" :show-borders="true" :row-alternation-enabled="true" :hover-state-enabled="true"
@selection-changed="onDataSubSelectionChanged" :column-width="100" @exporting="onExporting"
:allow-column-resizing="true" column-resizing-mode="widget">
<DxSelection mode="single" />
<DxPaging :page-size="5" :enabled="true" />
<DxPager :visible="true" :allowed-page-sizes="[5, 10, 20]" display-mode="full"
:show-page-size-selector="true" :show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
<DxColumn css-class="custom-table-column" :width="50" alignment="center"
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1" data-type="number" caption="No"
cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Posko" css-class="custom-table-column"
cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="No Lapor" css-class="custom-table-column"
cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Tgl/Jam Lapor"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Tgl/Jam Datang" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Tgl/Jam Nyala" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Durasi Response Time"
:allow-resizing="false" css-class="custom-table-column" cell-template="data-waktu" />
<DxColumn :width="150" alignment="center" data-field="" caption="Durasi Recovery Time"
:allow-resizing="false" css-class="custom-table-column" cell-template="data-waktu" />
<DxColumn :width="150" alignment="center" data-field="" caption="Durasi Penugasan Regu"
:allow-resizing="false" css-class="custom-table-column" cell-template="data-waktu" />
<DxColumn :width="150" alignment="center" data-field="" caption="Duras Perjalanan Regu"
:allow-resizing="false" css-class="custom-table-column" cell-template="data-waktu" />
<DxColumn :width="150" alignment="center" data-field="" caption="Jarak Closing (m)" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Dispatch Oleh" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="IDPEL/NO METER" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Nama Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Alamat Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="No Telp Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Keterangan Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Sumber Lapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Diselesaikan Oleh" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Status" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Referensi Marking" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Kode Gangguan" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Jenis Gangguan" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Penyebab" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="" caption="Tindakan" :allow-resizing="false"
css-class="custom-table-column" cell-template="cellLeft" />
<template #cellCenter="{ data }">
<p class="cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellLeft="{ data }">
<p class="text-left cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellRight="{ data }">
<p class="text-right cursor-pointer">
{{ isNumber(data.text) ? data.column.caption == '%' ? formatPercentage(data.text) :
formatNumber(data.text) :
data.text }}
</p>
</template>
<template #data-waktu="{ data }">
<p>
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
</p>
</template>
</DxDataGrid>
</div>
</div>
</div>
</DetailDialog>
</template>
<script setup lang="ts">
@ -121,12 +223,19 @@ import { useQuery } from '@vue/apollo-composable'
import { queries } from '@/utils/graphql'
import { dummyData } from '@/utils/dummy'
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
const position = { of: '#data' }
const showIndicator = ref(true)
const shading = ref(true)
const showPane = ref(true)
const data = ref<any[]>([])
const dataSub = ref<any[]>([])
const dataSelected = ref<any>()
const dataSubSelected = ref<any>()
const dialogDataSelected = ref(false)
const closeDialogDataSelected = () => dialogDataSelected.value = false
const showDialogDataSelected = () => dialogDataSelected.value = true
const { onResult, onError, loading, refetch } = useQuery(queries.gangguan.rekap.gangguanAll, {
dateFrom: new Date().toISOString().slice(0, 10),
@ -191,8 +300,15 @@ const onExporting = (e: any) => {
}
}
const onSelectionChanged = ({ selectedRowsData }: any) => {
const onDataSelectionChanged = ({ selectedRowsData }: any) => {
const data = selectedRowsData[0]
dataSelected.value = data
console.log(data)
}
const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
const data = selectedRowsData[0]
dataSubSelected.value = data
console.log(data)
}

View File

@ -1,109 +1,64 @@
<template>
<Filters
@reset-form="data = []"
:report-button="true"
@run-search="() => filterData(filters)"
class="mb-4"
>
<Filters @reset-form="data = []" :report-button="true" @run-search="() => filterData(filters)" class="mb-4">
<Type1 @update:filters="(value) => filters = value" />
</Filters>
<div id="data">
<DxDataGrid
class="max-h-[calc(100vh-140px)] mb-10"
:data-source="data"
:show-column-lines="true"
:show-row-lines="false"
:show-borders="true"
:row-alternation-enabled="true"
:hover-state-enabled="true"
@selection-changed="onSelectionChanged"
@exporting="onExporting"
:allow-column-resizing="true"
column-resizing-mode="widget"
:word-wrap-enabled="true"
>
<DxDataGrid class="max-h-[calc(100vh-140px)] mb-10" :data-source="data" :show-column-lines="true"
:show-row-lines="false" :show-borders="true" :row-alternation-enabled="true" :hover-state-enabled="true"
@selection-changed="onSelectionChanged" @exporting="onExporting" :allow-column-resizing="true"
column-resizing-mode="widget" :word-wrap-enabled="true">
<DxSelection mode="single" />
<DxPaging :enabled="false" />
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
<DxLoadPanel
:position="position"
:show-indicator="showIndicator"
:show-pane="showPane"
:shading="shading"
v-if="loading"
v-model:visible="loading"
:enabled="true"
/>
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
<DxExport
:enabled="true"
:formats="['pdf', 'xlsx', 'document']"
:allow-export-selected-data="false"
/>
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
<DxColumnFixing :enabled="true" />
<DxColumn
css-class="custom-table-column"
:width="50"
alignment="center"
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1"
data-type="number"
caption="No"
/>
<DxColumn
alignment="center"
:min-width="180"
data-field="nama_up3"
caption="Nama UP3"
css-class="custom-table-column"
/>
<DxColumn
alignment="center"
:min-width="180"
data-field="nama_up3"
caption="Nama UP3"
css-class="custom-table-column"
:group-index="0"
/>
<DxColumn
alignment="center"
:min-width="180"
data-field="nama_posko"
caption="Nama Posko"
css-class="custom-table-column"
/>
<DxColumn
:width="180"
alignment="center"
data-field="posko_in"
caption="Posko IN"
css-class="custom-table-column"
/>
<DxColumn
:width="180"
alignment="center"
data-field="posko_out"
caption="Posko OUT"
css-class="custom-table-column"
/>
<DxColumn css-class="custom-table-column" :width="50" alignment="center"
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1" data-type="number" caption="No"
name="number" cell-template="cellRight" />
<DxColumn alignment="center" :min-width="180" data-field="nama_up3" caption="Nama UP3"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn alignment="center" :min-width="180" data-field="nama_up3" caption="Nama UP3"
css-class="custom-table-column" :group-index="0" />
<DxColumn alignment="center" :min-width="180" data-field="nama_posko" caption="Nama Posko"
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="180" alignment="center" data-field="posko_in" caption="Posko IN" css-class="custom-table-column"
cell-template="cellRight" />
<DxColumn :width="180" alignment="center" data-field="posko_out" caption="Posko OUT"
css-class="custom-table-column" cell-template="cellRight" />
<DxSummary>
<DxGroupItem :show-in-group-footer="true" column="nama_up3" display-format="Total" />
<DxGroupItem
:show-in-group-footer="true"
column="posko_in"
summary-type="sum"
display-format="{0}"
/>
<DxGroupItem
:show-in-group-footer="true"
column="posko_out"
summary-type="sum"
display-format="{0}"
/>
<DxGroupItem :show-in-group-footer="true" column="number" display-format="Total" css-class="!text-left" />
<DxGroupItem :show-in-group-footer="true" column="posko_in" summary-type="sum" display-format="{0}"
css-class="!text-right" />
<DxGroupItem :show-in-group-footer="true" column="posko_out" summary-type="sum" display-format="{0}"
css-class="!text-right" />
</DxSummary>
<template #cellCenter="{ data }">
<p class="cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellLeft="{ data }">
<p class="text-left cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellRight="{ data }">
<p class="text-right cursor-pointer">
{{ isNumber(data.text) ? data.column.caption == '%' ? formatPercentage(data.text) :
formatNumber(data.text) :
data.text }}
</p>
</template>
</DxDataGrid>
</div>
</template>
@ -111,7 +66,7 @@
<script setup lang="ts">
import Filters from '@/components/Form/Filters.vue'
import Type1 from '@/components/Form/FiltersType/Type1.vue'
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import { DxDataGrid } from 'devextreme-vue'
import {
DxColumn,
@ -132,6 +87,8 @@ import { saveAs } from 'file-saver'
import { Workbook } from 'exceljs'
import { useQuery } from '@vue/apollo-composable'
import { queries } from '@/utils/graphql'
import { dummyData } from '@/utils/dummy'
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
const position = { of: '#data' }
const showIndicator = ref(true)
@ -209,4 +166,7 @@ const filterData = (params: any) => {
}
const filters = ref()
onMounted(() => {
data.value = dummyData.gangguan.rekap.rekapitulasiGangguanAlihPosko
})
</script>

View File

@ -1,91 +1,54 @@
<template>
<Filters
@reset-form="data = []"
:report-button="true"
@run-search="() => filterData(filters)"
class="mb-4"
>
<Filters @reset-form="data = []" :report-button="true" @run-search="() => filterData(filters)" class="mb-4">
<Type1 @update:filters="(value) => filters = value" />
</Filters>
<div id="data">
<DxDataGrid
class="max-h-[calc(100vh-140px)] mb-10"
:data-source="data"
:show-column-lines="true"
:show-row-lines="false"
:show-borders="true"
:row-alternation-enabled="true"
:hover-state-enabled="true"
@selection-changed="onSelectionChanged"
:column-width="100"
@exporting="onExporting"
:allow-column-resizing="true"
column-resizing-mode="widget"
:word-wrap-enabled="true"
>
<DxDataGrid class="max-h-[calc(100vh-140px)] mb-10" :data-source="data" :show-column-lines="true"
:show-row-lines="false" :show-borders="true" :row-alternation-enabled="true" :hover-state-enabled="true"
@selection-changed="onSelectionChanged" :column-width="100" @exporting="onExporting" :allow-column-resizing="true"
column-resizing-mode="widget" :word-wrap-enabled="true">
<DxSelection mode="single" />
<DxPaging :enabled="false" />
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
<DxLoadPanel
:position="position"
:show-indicator="showIndicator"
:show-pane="showPane"
:shading="shading"
v-if="loading"
v-model:visible="loading"
:enabled="true"
/>
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
<DxExport
:enabled="true"
:formats="['pdf', 'xlsx', 'document']"
:allow-export-selected-data="false"
/>
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
<DxColumnFixing :enabled="true" />
<DxColumn
css-class="custom-table-column"
:width="100"
alignment="center"
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1"
data-type="number"
caption="No"
data-field="no"
/>
<DxColumn
:width="170"
data-field="media"
caption="Nama Media"
alignment="center"
cell-template="data"
css-class="custom-table-column"
header-cell-template="title-header"
/>
<DxColumn css-class="custom-table-column" :width="50" alignment="center"
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1" data-type="number" caption="No"
data-field="no" cell-template="cellRight" />
<DxColumn :width="170" data-field="media" caption="Nama Media" alignment="center" cell-template="cellLeft"
css-class="custom-table-column" header-cell-template="title-header" />
<DxColumn alignment="center" caption="Tanggal" css-class="custom-table-column">
<DxColumn
v-for="i in 31"
:width="150"
alignment="center"
:data-field="`tgl${i}`"
data-type="number"
:caption="i"
css-class="custom-table-column"
/>
<DxColumn v-for="i in 31" :width="100" alignment="center" :data-field="`tgl${i}`" data-type="number"
:caption="i" css-class="custom-table-column" cell-template="cellRight" />
</DxColumn>
<DxColumn
:width="170"
alignment="center"
data-field="total"
caption="Total"
css-class="custom-table-column"
/>
<DxColumn :width="170" alignment="center" data-field="total" caption="Total" css-class="custom-table-column"
cell-template="cellRight" />
<template #data="{ data }">
<template #cellCenter="{ data }">
<p class="cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellLeft="{ data }">
<p class="text-left cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellRight="{ data }">
<p class="text-right cursor-pointer">
{{ isNumber(data.text) ? data.column.caption == '%' ? formatPercentage(data.text) :
formatNumber(data.text) :
data.text }}
</p>
</template>
<template #title-header="{ data }">
<p class="w-full text-center">
{{ data.column.caption }}
@ -93,25 +56,12 @@
</template>
<DxSummary>
<DxTotalItem
summary-type="sum"
display-format="Call PLN 123"
show-in-column="no"
css-class="text-white"
/>
<DxTotalItem
v-for="i in 31"
summary-type="sum"
display-format="{0}"
:column="`tgl${i}`"
css-class="text-white"
/>
<DxTotalItem
column="total"
summary-type="sum"
display-format="{0}"
css-class="text-white"
/>
<DxTotalItem display-format="Call PLN 123" show-in-column="media" css-class="text-white !text-left" />
<DxTotalItem v-for="i in 31" summary-type="sum" display-format="{0}" :column="`tgl${i}`"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))" />
<DxTotalItem column="total" summary-type="sum" display-format="{0}" css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))" />
</DxSummary>
</DxDataGrid>
</div>
@ -120,7 +70,7 @@
<script setup lang="ts">
import Filters from '@/components/Form/Filters.vue'
import Type1 from '@/components/Form/FiltersType/Type1.vue'
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import { DxDataGrid } from 'devextreme-vue'
import {
DxColumn,
@ -141,6 +91,8 @@ import { saveAs } from 'file-saver'
import { Workbook } from 'exceljs'
import { useQuery } from '@vue/apollo-composable'
import { queries } from '@/utils/graphql'
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
import { dummyData } from '@/utils/dummy'
const position = { of: '#data' }
const showIndicator = ref(true)
@ -219,4 +171,7 @@ const filterData = (params: any) => {
}
const filters = ref()
onMounted(() => {
data.value = dummyData.gangguan.rekap.rekapitulasiGangguanBerdasarkanMedia
})
</script>

View File

@ -4,163 +4,73 @@
</Filters>
<div id="data">
<DxDataGrid
class="max-h-[calc(100vh-140px)] mb-10"
:data-source="data"
:show-column-lines="true"
:show-row-lines="false"
:show-borders="true"
:row-alternation-enabled="true"
:hover-state-enabled="true"
@selection-changed="onSelectionChanged"
:column-width="100"
@exporting="onExporting"
:allow-column-resizing="true"
column-resizing-mode="widget"
:word-wrap-enabled="true"
>
<DxDataGrid class="max-h-[calc(100vh-140px)] mb-10" :data-source="data" :show-column-lines="true"
:show-row-lines="false" :show-borders="true" :row-alternation-enabled="true" :hover-state-enabled="true"
@selection-changed="onSelectionChanged" :column-width="100" @exporting="onExporting" :allow-column-resizing="true"
column-resizing-mode="widget" :word-wrap-enabled="true">
<DxSelection mode="single" />
<DxPaging :page-size="5" :enabled="true" />
<DxPager
:visible="true"
:allowed-page-sizes="[5, 10, 20]"
display-mode="full"
:show-page-size-selector="true"
:show-info="true"
:show-navigation-buttons="true"
/>
<DxLoadPanel
:position="position"
:show-indicator="showIndicator"
:show-pane="showPane"
:shading="shading"
v-if="loading"
v-model:visible="loading"
:enabled="true"
/>
<DxPager :visible="true" :allowed-page-sizes="[5, 10, 20]" display-mode="full" :show-page-size-selector="true"
:show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
<DxExport
:enabled="true"
:formats="['pdf', 'xlsx', 'document']"
:allow-export-selected-data="false"
/>
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
<DxColumnFixing :enabled="true" />
<DxColumn
css-class="custom-table-column"
:width="50"
alignment="center"
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1"
data-type="number"
caption="No"
/>
<DxColumn
:width="170"
alignment="center"
data-field="no_laporan"
caption="No Laporan"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="pembuat_laporan"
caption="Pembuat Laporan"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="waktu_lapor"
caption="Tgl Lapor"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="waktu_dialihkan"
caption="Tgl Dialihkan"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="waktu_response"
caption="Tgl Response"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="waktu_recovery"
caption="Tgl Recovery"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="durasi_response_time"
caption="Durasi Response Time"
css-class="custom-table-column"
cell-template="data-waktu"
/>
<DxColumn
:width="170"
alignment="center"
data-field="durasi_recovery_time"
caption="Durasi Recovery Time"
css-class="custom-table-column"
cell-template="data-waktu"
/>
<DxColumn
:width="170"
alignment="center"
data-field="nama_unit_lama"
caption="Unit Asal"
css-class="custom-table-column"
/>
<DxColumn
:width="120"
alignment="center"
data-field="status_akhir"
caption="Status"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="idpel_nometer"
caption="IDPEL/NO METER"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="nama_pelapor"
caption="Nama Pelapor"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="alamat_pelapor"
caption="Alamat Pelapor"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="no_telp_pelapor"
caption="No Telp Pelapor"
css-class="custom-table-column"
/>
<DxColumn
:width="170"
alignment="center"
data-field="keterangan_pelapor"
caption="Keterangan Pelapor"
css-class="custom-table-column"
/>
<DxColumn css-class="custom-table-column !align-top" :width="50" alignment="center"
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1" data-type="number" caption="No"
cell-template="cellRight" />
<DxColumn :width="170" alignment="center" data-field="no_laporan" caption="No Laporan"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="pembuat_laporan" caption="Pembuat Laporan"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="waktu_lapor" caption="Tgl Lapor"
css-class="custom-table-column !align-top" />
<DxColumn :width="170" alignment="center" data-field="waktu_dialihkan" caption="Tgl Dialihkan"
css-class="custom-table-column !align-top" />
<DxColumn :width="170" alignment="center" data-field="waktu_response" caption="Tgl Response"
css-class="custom-table-column !align-top" />
<DxColumn :width="170" alignment="center" data-field="waktu_recovery" caption="Tgl Recovery"
css-class="custom-table-column !align-top" />
<DxColumn :width="170" alignment="center" data-field="durasi_response_time" caption="Durasi Response Time"
css-class="custom-table-column !align-top" cell-template="data-waktu" />
<DxColumn :width="170" alignment="center" data-field="durasi_recovery_time" caption="Durasi Recovery Time"
css-class="custom-table-column !align-top" cell-template="data-waktu" />
<DxColumn :width="170" alignment="center" data-field="nama_unit_lama" caption="Unit Asal"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<DxColumn :width="120" alignment="center" data-field="status_akhir" caption="Status"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="idpel_nometer" caption="IDPEL/NO METER"
css-class="custom-table-column !align-top" />
<DxColumn :width="170" alignment="center" data-field="nama_pelapor" caption="Nama Pelapor"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="alamat_pelapor" caption="Alamat Pelapor"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="no_telp_pelapor" caption="No Telp Pelapor"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="keterangan_pelapor" caption="Keterangan Pelapor"
css-class="custom-table-column !align-top" cell-template="cellLeft" />
<template #cellCenter="{ data }">
<p class="cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellLeft="{ data }">
<p class="text-left cursor-pointer">
{{ data.text }}
</p>
</template>
<template #cellRight="{ data }">
<p class="text-right cursor-pointer">
{{ isNumber(data.text) ? data.column.caption == '%' ? formatPercentage(data.text) :
formatNumber(data.text) :
data.text }}
</p>
</template>
<template #data-waktu="{ data }">
<p>
@ -175,7 +85,7 @@
import Filters from '@/components/Form/Filters.vue'
import Type3 from '@/components/Form/FiltersType/Type3.vue'
import { formatWaktu } from '@/components/Form/FiltersType/reference'
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import { DxDataGrid } from 'devextreme-vue'
import {
DxColumn,
@ -194,6 +104,8 @@ import { saveAs } from 'file-saver'
import { Workbook } from 'exceljs'
import { useQuery } from '@vue/apollo-composable'
import { queries } from '@/utils/graphql'
import { dummyData } from '@/utils/dummy'
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
const position = { of: '#data' }
const showIndicator = ref(true)
@ -277,4 +189,7 @@ const filterData = (params: any) => {
}
const filters = ref()
onMounted(() => {
data.value = dummyData.keluhan.daftar.daftarKeluhanDialihkanKeUnitLain
})
</script>