Update Type7.vue and DetailDialog.vue components, and style.css
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user