Refactor detail dialog in Gangguan pages

This commit is contained in:
Dede Fuji Abdul 2024-03-30 13:37:06 +07:00
parent bd137bcc9b
commit f671f423dc
3 changed files with 119 additions and 142 deletions

View File

@ -182,17 +182,38 @@
</DxDataGrid> </DxDataGrid>
</div> </div>
<DetailDialog <DetailDialog :open="dialogDetail" title="Detail Gangguan" @on-close="closeDialog">
:open="dialogDetail"
title="Daftar Gangguan Berdasarkan Media"
@on-close="closeDialog"
>
<div class="w-full p-4 space-y-2 bg-white rounded-xl"> <div class="w-full p-4 space-y-2 bg-white rounded-xl">
<div class="flex flex-row items-center justify-between w-full"> <div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">No Laporan:</h3> <h3 class="text-sm font-medium w-[170px] text-gray-800">No Laporan:</h3>
<InputText :readonly="true" :value="dataSelected.no_laporan" class-name="flex-1" /> <InputText :readonly="true" :value="dataSelected.no_laporan" class-name="flex-1" />
</div> </div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Nama Pelapor:</h3>
<InputText :readonly="true" :value="dataSelected?.nama_pelapor" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">No Telp Pelapor:</h3>
<InputText :readonly="true" :value="dataSelected?.no_telp_pelapor" class-name="flex-1" />
</div>
<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" :value="dataSelected?.alamat_pelapor" class-name="flex-1" />
</div>
<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" :value="dataSelected?.keterangan_pelapor" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Status :</h3>
<InputText :readonly="true" :value="dataSelected?.status_akhir" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full"> <div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tgl Lapor:</h3> <h3 class="text-sm font-medium w-[170px] text-gray-800">Tgl Lapor:</h3>
<InputText :readonly="true" :value="dataSelected?.waktu_lapor" class-name="flex-1" /> <InputText :readonly="true" :value="dataSelected?.waktu_lapor" class-name="flex-1" />
@ -234,36 +255,6 @@
/> />
</div> </div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Status :</h3>
<InputText :readonly="true" :value="dataSelected?.status_akhir" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">IDPEL/NOMETER:</h3>
<InputText :readonly="true" :value="dataSelected?.idpel_nometer" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Nama Pelapor:</h3>
<InputText :readonly="true" :value="dataSelected?.nama_pelapor" class-name="flex-1" />
</div>
<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" :value="dataSelected?.alamat_pelapor" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">No Telp Pelapor:</h3>
<InputText :readonly="true" :value="dataSelected?.no_telp_pelapor" class-name="flex-1" />
</div>
<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" :value="dataSelected?.keterangan_pelapor" class-name="flex-1" />
</div>
<div class="flex flex-row items-center justify-between w-full"> <div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Sumper Lapor:</h3> <h3 class="text-sm font-medium w-[170px] text-gray-800">Sumper Lapor:</h3>
<InputText :readonly="true" :value="dataSelected?.media" class-name="flex-1" /> <InputText :readonly="true" :value="dataSelected?.media" class-name="flex-1" />

View File

@ -182,11 +182,7 @@
</DxDataGrid> </DxDataGrid>
</div> </div>
<DetailDialog <DetailDialog :open="dialogDetail" title="Detail Gangguan" @on-close="closeDialog">
:open="dialogDetail"
title="Daftar Gangguan Diselesaikan Mobile APKT"
@on-close="closeDialog"
>
<div class="w-full p-4 space-y-2 bg-white rounded-xl"> <div class="w-full p-4 space-y-2 bg-white rounded-xl">
<div class="flex flex-row items-center justify-between w-full"> <div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">No Laporan:</h3> <h3 class="text-sm font-medium w-[170px] text-gray-800">No Laporan:</h3>
@ -278,26 +274,6 @@
class-name="flex-1" class-name="flex-1"
/> />
</div> </div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Penyebab:</h3>
<InputText
:readonly="true"
type="textarea"
:value="dataSelected?.penyebab"
class-name="flex-1"
/>
</div>
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tindakan:</h3>
<InputText
:readonly="true"
type="textarea"
:value="dataSelected?.tindakan"
class-name="flex-1"
/>
</div>
</div> </div>
</DetailDialog> </DetailDialog>
</template> </template>

View File

@ -69,10 +69,13 @@
:width="120" :width="120"
alignment="center" alignment="center"
data-field="sub_kelompok" data-field="sub_kelompok"
caption="Kelompok"
css-class="custom-table-column" css-class="custom-table-column"
group-index="0" :group-index="0"
caption=""
cell-template="formatText" cell-template="formatText"
:calculate-group-value="
(rowData: any) => `${rowData.sub_kelompok} (${rowData.nama_sub_kelompok})`
"
/> />
<DxColumn <DxColumn
:width="150" :width="150"
@ -562,6 +565,7 @@ const filterData = async (params: any) => {
return { return {
no: ++index, no: ++index,
sub_kelompok: item.sub_kelompok, sub_kelompok: item.sub_kelompok,
nama_sub_kelompok: item.nama_sub_kelompok,
kode: item.kode, kode: item.kode,
jenisGangguan: item.tipe_permasalahan, jenisGangguan: item.tipe_permasalahan,
laporan: { laporan: {
@ -620,119 +624,125 @@ onMounted(() => {
if (import.meta.env.DEV) { if (import.meta.env.DEV) {
data.value = [ data.value = [
{ {
id: 0, nama_sub_kelompok: 'Kelompok sambungan tenaga listrik dan APP ',
kode: '01a', sub_kelompok: '00',
avg_durasi_recovery: 0.0,
avg_durasi_response: 0.0,
max_durasi_recovery: 0,
max_durasi_response: 0,
min_durasi_recovery: 0,
min_durasi_response: 0,
persen_inproses: 0.0,
persen_selesai: 0.0,
tipe_permasalahan: 'Pelebur pembatas putus/rusak', tipe_permasalahan: 'Pelebur pembatas putus/rusak',
total: 0, total: 0,
total_selesai: 0, kode: '01a',
persen_selesai: 0,
total_inproses: 0,
persen_inproses: 0,
total_durasi_response: 0,
avg_durasi_response: 0,
min_durasi_response: 0,
max_durasi_response: 0,
total_dibawah_sla_response: 0,
total_diatas_sla_response: 0,
total_durasi_recovery: 0, total_durasi_recovery: 0,
avg_durasi_recovery: 0, total_durasi_response: 0,
min_durasi_recovery: 0, total_diatas_sla_recovery: 0,
max_durasi_recovery: 0, total_diatas_sla_response: 0,
total_dibawah_sla_recovery: 0, total_dibawah_sla_recovery: 0,
total_diatas_sla_recovery: 0 total_dibawah_sla_response: 0,
total_inproses: 0,
total_selesai: 0
}, },
{ {
id: 1, nama_sub_kelompok: 'Kelompok sambungan tenaga listrik dan APP ',
kode: '01b', sub_kelompok: '00',
avg_durasi_recovery: 0.0,
avg_durasi_response: 0.0,
max_durasi_recovery: 0,
max_durasi_response: 0,
min_durasi_recovery: 0,
min_durasi_response: 0,
persen_inproses: 0.0,
persen_selesai: 0.0,
tipe_permasalahan: 'MCB pembatas rusak', tipe_permasalahan: 'MCB pembatas rusak',
total: 0, total: 0,
total_selesai: 0, kode: '01b',
persen_selesai: 0,
total_inproses: 0,
persen_inproses: 0,
total_durasi_response: 0,
avg_durasi_response: 0,
min_durasi_response: 0,
max_durasi_response: 0,
total_dibawah_sla_response: 0,
total_diatas_sla_response: 0,
total_durasi_recovery: 0, total_durasi_recovery: 0,
avg_durasi_recovery: 0, total_durasi_response: 0,
min_durasi_recovery: 0, total_diatas_sla_recovery: 0,
max_durasi_recovery: 0, total_diatas_sla_response: 0,
total_dibawah_sla_recovery: 0, total_dibawah_sla_recovery: 0,
total_diatas_sla_recovery: 0 total_dibawah_sla_response: 0,
total_inproses: 0,
total_selesai: 0
}, },
{ {
id: 2, nama_sub_kelompok: 'Kelompok sambungan tenaga listrik dan APP ',
kode: '01c', sub_kelompok: '00',
avg_durasi_recovery: 0.0,
avg_durasi_response: 0.0,
max_durasi_recovery: 0,
max_durasi_response: 0,
min_durasi_recovery: 0,
min_durasi_response: 0,
persen_inproses: 0.0,
persen_selesai: 0.0,
tipe_permasalahan: 'RELAY dan / atau CB rusak', tipe_permasalahan: 'RELAY dan / atau CB rusak',
total: 0, total: 0,
total_selesai: 0, kode: '01c',
persen_selesai: 0,
total_inproses: 0,
persen_inproses: 0,
total_durasi_response: 0,
avg_durasi_response: 0,
min_durasi_response: 0,
max_durasi_response: 0,
total_dibawah_sla_response: 0,
total_diatas_sla_response: 0,
total_durasi_recovery: 0, total_durasi_recovery: 0,
avg_durasi_recovery: 0, total_durasi_response: 0,
min_durasi_recovery: 0, total_diatas_sla_recovery: 0,
max_durasi_recovery: 0, total_diatas_sla_response: 0,
total_dibawah_sla_recovery: 0, total_dibawah_sla_recovery: 0,
total_diatas_sla_recovery: 0 total_dibawah_sla_response: 0,
total_inproses: 0,
total_selesai: 0
}, },
{ {
id: 3, nama_sub_kelompok: 'Kelompok sambungan tenaga listrik dan APP ',
kode: '01d', sub_kelompok: '00',
avg_durasi_recovery: 0.0,
avg_durasi_response: 0.0,
max_durasi_recovery: 0,
max_durasi_response: 0,
min_durasi_recovery: 0,
min_durasi_response: 0,
persen_inproses: 0.0,
persen_selesai: 0.0,
tipe_permasalahan: 'Pelebur putus dan LBS jatuh atau rusak', tipe_permasalahan: 'Pelebur putus dan LBS jatuh atau rusak',
total: 0, total: 0,
total_selesai: 0, kode: '01d',
persen_selesai: 0,
total_inproses: 0,
persen_inproses: 0,
total_durasi_response: 0,
avg_durasi_response: 0,
min_durasi_response: 0,
max_durasi_response: 0,
total_dibawah_sla_response: 0,
total_diatas_sla_response: 0,
total_durasi_recovery: 0, total_durasi_recovery: 0,
avg_durasi_recovery: 0, total_durasi_response: 0,
min_durasi_recovery: 0, total_diatas_sla_recovery: 0,
max_durasi_recovery: 0, total_diatas_sla_response: 0,
total_dibawah_sla_recovery: 0, total_dibawah_sla_recovery: 0,
total_diatas_sla_recovery: 0 total_dibawah_sla_response: 0,
total_inproses: 0,
total_selesai: 0
}, },
{ {
id: 4, nama_sub_kelompok: 'Kelompok sambungan tenaga listrik dan APP ',
kode: '06a', sub_kelompok: '00',
avg_durasi_recovery: 0.0,
avg_durasi_response: 0.0,
max_durasi_recovery: 0,
max_durasi_response: 0,
min_durasi_recovery: 0,
min_durasi_response: 0,
persen_inproses: 0.0,
persen_selesai: 0.0,
tipe_permasalahan: 'Kubikel APP/komponennya rusak atau gagal bekerja', tipe_permasalahan: 'Kubikel APP/komponennya rusak atau gagal bekerja',
total: 0, total: 0,
total_selesai: 0, kode: '06a',
persen_selesai: 0,
total_inproses: 0,
persen_inproses: 0,
total_durasi_response: 0,
avg_durasi_response: 0,
min_durasi_response: 0,
max_durasi_response: 0,
total_dibawah_sla_response: 0,
total_diatas_sla_response: 0,
total_durasi_recovery: 0, total_durasi_recovery: 0,
avg_durasi_recovery: 0, total_durasi_response: 0,
min_durasi_recovery: 0, total_diatas_sla_recovery: 0,
max_durasi_recovery: 0, total_diatas_sla_response: 0,
total_dibawah_sla_recovery: 0, total_dibawah_sla_recovery: 0,
total_diatas_sla_recovery: 0 total_dibawah_sla_response: 0,
total_inproses: 0,
total_selesai: 0
} }
].map((item: any, index: number) => { ].map((item: any, index: number) => {
return { return {
no: ++index, no: ++index,
sub_kelompok: item.sub_kelompok, sub_kelompok: item.sub_kelompok,
nama_sub_kelompok: item.nama_sub_kelompok,
kode: item.kode, kode: item.kode,
jenisGangguan: item.tipe_permasalahan, jenisGangguan: item.tipe_permasalahan,
laporan: { laporan: {