Refactor CSS styles and input components

This commit is contained in:
Dede Fuji Abdul
2024-03-08 13:52:14 +07:00
parent 163c0b7d25
commit b66bc38b1c
13 changed files with 378708 additions and 140 deletions

View File

@ -7,7 +7,7 @@
<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">
column-resizing-mode="widget" :word-wrap-enabled="false">
<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"
@ -21,39 +21,53 @@
<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" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="waktu_lapor" caption="Tgl Lapor"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="waktu_response" caption="Tgl Response"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="waktu_recovery" caption="Tgl Recovery"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<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="120" alignment="center" data-field="status_akhir" caption="Status"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="idpel_nometer" caption="IDPEL/NO METER"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="nama_pelapor" caption="Nama Pelapor"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="alamat_pelapor" caption="Alamat Pelapor"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="no_telp_pelapor" caption="No Telp Pelapor"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="170" alignment="center" data-field="keterangan_pelapor" caption="Keterangan Pelapor"
css-class="custom-table-column" cell-template="data" />
css-class="custom-table-column" cell-template="cellLeft" />
<DxColumn :width="150" alignment="center" data-field="nama_ulp" caption="Nama ULP" css-class="custom-table-column"
cell-template="data" />
cell-template="cellLeft" />
<template #data="{ data }">
<template #cellCenter="{ data }">
<p class="cursor-pointer" @click="showData()">
{{ data.text }}
</p>
</template>
<template #cellLeft="{ data }">
<p class="text-left cursor-pointer" @click="showData()">
{{ data.text }}
</p>
</template>
<template #cellRight="{ data }">
<p class="text-right cursor-pointer" @click="showData()">
{{ isNumber(data.text) ? data.column.caption == '%' ? formatPercentage(data.text) :
formatNumber(data.text) :
data.text }}
</p>
</template>
<template #data-waktu="{ data }">
<p class="cursor-pointer" @click="showData()">
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
@ -117,7 +131,7 @@
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Alamat Pelapor:</h3>
<InputText :readonly="true" type="textarea" :value="dataDetail?.alamat_pelapor" class-name="flex-1 h-[56px]" />
<InputText :readonly="true" type="textarea" :value="dataDetail?.alamat_pelapor" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full">
@ -127,8 +141,7 @@
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Keterangan Pelapor:</h3>
<InputText :readonly="true" type="textarea" :value="dataDetail?.keterangan_pelapor"
class-name="flex-1 h-[56px]" />
<InputText :readonly="true" type="textarea" :value="dataDetail?.keterangan_pelapor" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full">
@ -150,7 +163,7 @@ import InputText from '@/components/InputText.vue'
import Filters from '@/components/Form/Filters.vue'
import Type11 from '@/components/Form/FiltersType/Type11.vue'
import { formatWaktu } from '@/components/Form/FiltersType/reference'
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import { DxDataGrid } from 'devextreme-vue'
import {
DxColumn,
@ -169,6 +182,8 @@ import { saveAs } from 'file-saver'
import { Workbook } from 'exceljs'
import { useQuery } from '@vue/apollo-composable'
import { queries } from '@/utils/api/api.graphql'
import { dummyData } from '@/utils/dummy'
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
const position = { of: '#data' }
const showIndicator = ref(true)
@ -262,4 +277,7 @@ const filterData = (params: any) => {
}
const filters = ref()
onMounted(() => {
data.value = dummyData.keluhan.daftar.daftarKeluhanResponseTime
})
</script>