Monalisa Fix Column Name

This commit is contained in:
Eko Haryadi
2024-03-21 17:35:56 +07:00
parent 8c5667de0b
commit 381a8672cc
21 changed files with 1374 additions and 4637 deletions

View File

@ -1,95 +1,40 @@
<template>
<Filters
@reset-form="data = []"
@run-search="() => filterData(filters)"
:report-button="true"
class="mb-4"
>
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" :report-button="true" class="mb-4">
<Type2 @update:filters="(value) => (filters = value)" />
</Filters>
<div id="data">
<DxDataGrid
ref="dataGridRef"
:allow-column-reordering="true"
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="onDataSelectionChanged"
@exporting="onExporting"
:allow-column-resizing="true"
column-resizing-mode="widget"
:word-wrap-enabled="true"
>
<DxDataGrid ref="dataGridRef" :allow-column-reordering="true" 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="onDataSelectionChanged"
@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
shading-color="rgba(0,0,0,0.4)"
:position="position"
:show-indicator="showIndicator"
:show-pane="showPane"
:shading="shading"
v-if="loading"
v-model:visible="loading"
:enabled="true"
/>
<DxLoadPanel shading-color="rgba(0,0,0,0.4)" :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
alignment="center"
data-field="nama_ulp"
caption="Nama Unit"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn alignment="center" data-field="nama_ulp" caption="Nama Unit" css-class="custom-table-column"
cell-template="formatText" />
<DxColumn alignment="center" caption="Tahun" css-class="custom-table-column">
<DxColumn
:width="150"
alignment="center"
data-field="jumlah_gangguan"
data-type="number"
caption="Gangguan"
css-class="custom-table-column"
cell-template="formatNumber"
/>
<DxColumn
:width="150"
alignment="center"
data-field="jumlah_informasi"
data-type="number"
caption="Informasi"
css-class="custom-table-column"
cell-template="formatNumber"
/>
<DxColumn
:width="150"
alignment="center"
data-field="total"
data-type="number"
caption="Total"
css-class="custom-table-column"
cell-template="formatNumber"
/>
<DxColumn :width="150" alignment="center" data-field="jumlah_gangguan" data-type="number" caption="Gangguan"
css-class="custom-table-column" cell-template="formatNumber" />
<DxColumn :width="150" alignment="center" data-field="jumlah_informasi" data-type="number" caption="Informasi"
css-class="custom-table-column" cell-template="formatNumber" />
<DxColumn :width="150" alignment="center" data-field="total" data-type="number" caption="Total"
css-class="custom-table-column" cell-template="formatNumber" />
</DxColumn>
<template #formatNumber="{ data }">
<p class="text-right cursor-pointer">
{{
isNumber(data.text)
? data.column.caption == '%'
? formatPercentage(data.text)
: formatNumber(data.text)
: data.text
}}
isNumber(data.text)
? data.column.caption == '%'
? formatPercentage(data.text)
: formatNumber(data.text)
: data.text
}}
</p>
</template>
@ -100,228 +45,67 @@
</template>
<DxSummary>
<DxTotalItem
summary-type="sum"
display-format="Total"
show-in-column="nama_ulp"
css-class="text-white !text-left"
/>
<DxTotalItem
column="jumlah_gangguan"
summary-type="sum"
display-format="{0}"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxTotalItem
column="jumlah_informasi"
summary-type="sum"
display-format="{0}"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxTotalItem
column="total"
summary-type="sum"
display-format="{0}"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxTotalItem summary-type="sum" display-format="Total" show-in-column="nama_ulp"
css-class="text-white !text-left" />
<DxTotalItem column="jumlah_gangguan" summary-type="sum" display-format="{0}" css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(e.value)" />
<DxTotalItem column="jumlah_informasi" summary-type="sum" display-format="{0}"
css-class="text-white !text-right" :customize-text="(e: any) => formatNumber(e.value)" />
<DxTotalItem column="total" summary-type="sum" display-format="{0}" css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(e.value)" />
</DxSummary>
</DxDataGrid>
</div>
<DetailDialog
:open="dialogDetail"
title="Detail Gangguan Belum Selesai"
@on-close="closeDialog"
:full-width="true"
>
<DetailDialog :open="dialogDetail" title="Detail Gangguan Belum Selesai" @on-close="closeDialog" :full-width="true">
<div class="w-full mb-4 lg:w-[70%] lg:float-left">
<div class="p-4 bg-white rounded-xl lg:mr-4">
<DxDataGrid
:allow-column-reordering="true"
class="max-h-[calc(100vh-140px)]"
: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"
>
<DxDataGrid :allow-column-reordering="true" class="max-h-[calc(100vh-140px)]" :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="20" :enabled="true" />
<DxPager
:visible="true"
:allowed-page-sizes="[20, 50, 100]"
display-mode="full"
:show-page-size-selector="true"
:show-info="true"
:show-navigation-buttons="true"
/>
<DxLoadPanel
shading-color="rgba(0,0,0,0.4)"
:position="position"
:show-indicator="showIndicator"
:show-pane="showPane"
:shading="shading"
v-model:visible="loadingSubData"
:enabled="true"
/>
<DxPager :visible="true" :allowed-page-sizes="[20, 50, 100]" display-mode="full"
:show-page-size-selector="true" :show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel shading-color="rgba(0,0,0,0.4)" :position="position" :show-indicator="showIndicator"
:show-pane="showPane" :shading="shading" v-model:visible="loadingSubData" :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" />
<DxColumn
css-class="custom-table-column"
:width="50"
alignment="center"
:calculateCellValue="(item: any) => dataSub.findIndex((i) => i == item) + 1"
data-type="number"
caption="No"
cell-template="formatNumber"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="No Laporan"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="UID/UIW"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="UP3"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="ULP"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="ID Pelanggan"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="200"
alignment="center"
data-field=""
caption="Nama Pelapor"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="200"
alignment="center"
data-field=""
caption="Alamat Pelapor"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="No Telp Pelapor"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="200"
alignment="center"
data-field=""
caption="Keterangan Pelapor"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="200"
alignment="center"
data-field=""
caption="Penyebab"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="Kode Gangguan"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="200"
alignment="center"
data-field=""
caption="Jenis Gangguan"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="Durasi Response Time"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatTime"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="Durasi Recoery Time:"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatTime"
/>
<DxColumn
:width="150"
alignment="center"
data-field=""
caption="Tgl Lapor"
:allow-resizing="false"
css-class="custom-table-column"
cell-template="formatText"
/>
<DxColumn css-class="custom-table-column" :width="50" alignment="center"
:calculateCellValue="(item: any) => dataSub.findIndex((i) => i == item) + 1" data-type="number" caption="No"
cell-template="formatNumber" />
<DxColumn :width="150" alignment="center" data-field="" caption="No Laporan" css-class="custom-table-column"
cell-template="formatText" />
<DxColumn :width="150" alignment="center" data-field="" caption="UID/UIW" css-class="custom-table-column"
cell-template="formatText" />
<DxColumn :width="150" alignment="center" data-field="" caption="UP3" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="150" alignment="center" data-field="" caption="ULP" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="150" alignment="center" data-field="" caption="ID Pelanggan" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="200" alignment="center" data-field="" caption="Nama Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="200" alignment="center" data-field="" caption="Alamat Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="150" alignment="center" data-field="" caption="No Telp Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="200" alignment="center" data-field="" caption="Keterangan Pelapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="200" alignment="center" data-field="" caption="Penyebab" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="150" alignment="center" data-field="" caption="Kode Gangguan" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="200" alignment="center" data-field="" caption="Jenis Gangguan" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<DxColumn :width="150" alignment="center" data-field="" caption="Durasi Response Time" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatTime" />
<DxColumn :width="150" alignment="center" data-field="" caption="Durasi Recoery Time:" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatTime" />
<DxColumn :width="150" alignment="center" data-field="" caption="Tgl Lapor" :allow-resizing="false"
css-class="custom-table-column" cell-template="formatText" />
<template #formatText="{ data }">
<p class="text-left cursor-pointer">
@ -459,7 +243,6 @@ import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
import InputText from '@/components/InputText.vue'
import { formatWaktu } from '@/components/Form/FiltersType/reference'
const currentYear = ref(new Date().getFullYear())
const currentMonth = ref(new Date().getMonth())
const lastYear = ref(currentYear.value - 1)