Refactor DatePicker.vue to remove console.log statement
Refactor RGangguan_BerdasarMedia.vue to fix css-class typo Refactor RKeluhan_BerdasarMedia.vue to update display-format and css-class Refactor RGangguan_KTI.vue to remove 'Semua Unit' and 'Regional' from groupList Refactor RGangguan_CTTM.vue to remove 'Semua Unit' and 'Regional' from groupList Refactor Type11.vue to update placeholder and values in InputWithSuffix Refactor RKeluhan_PerUnit.vue to update calculateCustomSummary function
This commit is contained in:
@@ -912,7 +912,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_selesai / total)
|
||||
? 0
|
||||
: total_selesai == 0
|
||||
? 0
|
||||
: (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@@ -921,16 +925,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_inproses / total)
|
||||
? 0
|
||||
: total_inproses == 0
|
||||
? 0
|
||||
: (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,7 +954,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
|
||||
? 0
|
||||
: count_durasi_response == 0
|
||||
? 0
|
||||
: count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
@@ -980,7 +983,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
|
||||
? 0
|
||||
: count_durasi_recovery == 0
|
||||
? 0
|
||||
: count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1074,17 +1081,36 @@ const filterData = async (params: any) => {
|
||||
}
|
||||
|
||||
loadingData.value = true
|
||||
await requestGraphQl(queries.keluhan.rekap.keluhanPerTanggal, query)
|
||||
await requestGraphQl(
|
||||
isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? queries.keluhan.rekap.keluhanPerTanggalUID
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? queries.keluhan.rekap.keluhanPerTanggalUP3
|
||||
: queries.keluhan.rekap.keluhanPerTanggalULP
|
||||
: queries.keluhan.rekap.keluhanPerTanggal,
|
||||
query
|
||||
)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
if (grouping.value.length > 0 && grouping.value[0].data != '') {
|
||||
console.log([...result.data.data.rekapitulasiKeluhanPerTanggal])
|
||||
|
||||
data.value = [...result.data.data.rekapitulasiKeluhanPerTanggal].sort((a, b) =>
|
||||
a[grouping.value[0].data].localeCompare(b[grouping.value[0].data])
|
||||
)
|
||||
data.value = [
|
||||
...(isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUp3
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggalUlp
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggal)
|
||||
].sort((a, b) => a[grouping.value[0].data].localeCompare(b[grouping.value[0].data]))
|
||||
} else {
|
||||
data.value = result.data.data.rekapitulasiKeluhanPerTanggal
|
||||
data.value = isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUp3
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggalUlp
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggal
|
||||
}
|
||||
} else {
|
||||
data.value = []
|
||||
|
Reference in New Issue
Block a user