diff --git a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_DispatchingTimeGangguan.vue b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_DispatchingTimeGangguan.vue index 0f07149..03e3928 100755 --- a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_DispatchingTimeGangguan.vue +++ b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_DispatchingTimeGangguan.vue @@ -24,17 +24,17 @@ + :caption="`${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column" /> + :caption="`${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column" /> + :caption="`s.d ${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column" /> + :caption="`s.d ${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column" /> @@ -66,10 +66,11 @@ import { Workbook } from 'exceljs' import { useQuery } from '@vue/apollo-composable' import gql from 'graphql-tag' import { getMonthName } from '@/utils/texts' +import { queries } from '@/utils/graphql' -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) @@ -105,81 +106,27 @@ const onExporting = (e: any) => { } } -// const monalisaDispatchingTimeGangguan = gql` -// query DaftarmonalisaDispatchingTimeGangguan( -// $regional: String -// $posko: Int -// $idUid: Int -// $idUp3: Int -// $bulan: Int -// $tahun: Int -// ) { -// monalisaDispatchingTimeGangguan( -// regional: $regional -// posko: $posko -// idUid: $idUid -// idUp3: $idUp3 -// bulan: $bulan -// tahun: $tahun -// ) { -// jumlah_bulan -// jumlah_bulan_n_1 -// jumlah_tahun -// jumlah_tahun_n_1 -// nama_posko -// persen_bulan -// persen_tahun -// } -// } -// ` - -const monalisaDispatchingTimeGangguan = gql` - query DaftarmonalisaDispatchingTimeGangguan( - $idUid: Int - $idUp3: Int - $idUlp: Int - $bulan: Int - $tahun: Int - ) { - monalisaDispatchingTimeGangguan( - idUid: $idUid - idUp3: $idUp3 - idUlp: $idUlp - bulan: $bulan - tahun: $tahun - ) { - nama_ulp - mom_bulan_ini - mom_bulan_kemarin - persen_mom - yoy_tahun_ini - yoy_tahun_kemarin - persen_yoy - } - } -` - -const { onResult, onError, loading, refetch } = useQuery(monalisaDispatchingTimeGangguan, { +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.gangguan.rekap.dispatchingTimeGangguan, { // regional: 0, idUp3: 0, idUid: 0, idUlp: 0, - bulan: bulanSekarang.value, - tahun: tahunSekarang.value + bulan: currentMonth.value, + tahun: currentYear.value }) const filterData = (params: any) => { const { regional, ulp, uid, up3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ // regional: regional, idUid: uid ? uid.id : 0, idUp3: up3 ? up3.id : 0, idUlp: ulp ? ulp.id : 0, - bulan: bulan ? bulan.id : bulanSekarang.value, - tahun: bulan ? tahun.id : tahunSekarang.value + bulan: bulan ? bulan.id : currentMonth.value, + tahun: bulan ? tahun.id : currentYear.value }) onResult((queryResult) => { if (queryResult.data != undefined) { diff --git a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ENSGangguan.vue b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ENSGangguan.vue index 297d283..a1850d0 100755 --- a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ENSGangguan.vue +++ b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ENSGangguan.vue @@ -16,25 +16,29 @@ - + - - - + + + - - - + + + + @@ -62,10 +66,11 @@ import { Workbook } from 'exceljs' import { useQuery } from '@vue/apollo-composable' import gql from 'graphql-tag' import { getMonthName } from '@/utils/texts' +import { queries } from '@/utils/graphql' -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) @@ -73,40 +78,8 @@ const showPane = ref(true) const data = ref([]) const dataDetail = ref() const showDetail = ref(false) -const monalisaRekapitulasiEnsGangguan = gql` - query DaftarmonalisaRekapitulasiEnsGangguan( - #$regional: String - $idUlp: Int - $idUid: Int - $idUp3: Int - $bulan: Int - $tahun: Int - ) { - monalisaRekapitulasiEnsGangguan( - #regional: $regional - idUlp: $idUlp - idUid: $idUid - idUp3: $idUp3 - bulan: $bulan - tahun: $tahun - ) { - nama_regional - id_uid - nama_uid - id_up3 - nama_up3 - id_ulp - nama_ulp - mom_bulan_ini - mom_bulan_kemarin - persen_mom - yoy_tahun_ini - yoy_tahun_kemarin - persen_yoy - } - } -` -const { onResult, onError, loading, refetch } = useQuery(monalisaRekapitulasiEnsGangguan, { + +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.gangguan.rekap.rekapitulasiEnsGangguan, { bulan: 10, tahun: 2023, regional: '', @@ -115,15 +88,15 @@ const { onResult, onError, loading, refetch } = useQuery(monalisaRekapitulasiEns idUp3: 0 }) const filterData = (params: any) => { - const { regional, ulp, idUid, idUp3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + const { regional, ulp, uid, up3, bulan, tahun } = params + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ regional: regional, idUlp: ulp ? ulp.id : 0, - idUid: idUid ? idUid.id : 0, - idUp3: idUp3 ? idUp3.id : 0, + idUid: uid ? uid.id : 0, + idUp3: up3 ? up3.id : 0, bulan: bulan ? bulan.id : 10, tahun: bulan ? tahun.id : 2023 }) diff --git a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanBelumSelesai.vue b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanBelumSelesai.vue index 94bdff5..633d4e1 100755 --- a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanBelumSelesai.vue +++ b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanBelumSelesai.vue @@ -16,11 +16,11 @@ - + - - @@ -51,10 +51,11 @@ import { saveAs } from 'file-saver' import { Workbook } from 'exceljs' import { useQuery } from '@vue/apollo-composable' import gql from 'graphql-tag' +import { queries } from '@/utils/graphql' -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) @@ -62,37 +63,7 @@ const showPane = ref(true) const data = ref([]) const dataDetail = ref() const showDetail = ref(false) -const monalisaGangguanBelumSelesai = gql` - query DaftarmonalisaGangguanBelumSelesai( - #$regional: String - $idUlp: Int - $idUid: Int - $idUp3: Int - $bulan: Int - $tahun: Int - ) { - monalisaGangguanBelumSelesai( - #regional: $regional - idUlp: $idUlp - idUid: $idUid - idUp3: $idUp3 - bulan: $bulan - tahun: $tahun - ) { - nama_regional - id_uid - nama_uid - id_up3 - nama_up3 - id_ulp - nama_ulp - jumlah_gangguan - jumlah_informasi - total - } - } -` -const { onResult, onError, loading, refetch } = useQuery(monalisaGangguanBelumSelesai, { +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.gangguan.rekap.gangguanBelumSelesai, { regional: '', idUlp: 0, idUid: 0, @@ -102,9 +73,9 @@ const { onResult, onError, loading, refetch } = useQuery(monalisaGangguanBelumSe }) const filterData = (params: any) => { const { regional, ulp, uid, up3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ regional: regional, idUlp: ulp ? ulp.id : 0, diff --git a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanPerJenisGangguan.vue b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanPerJenisGangguan.vue index 5bed7bd..eda4f50 100755 --- a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanPerJenisGangguan.vue +++ b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_GangguanPerJenisGangguan.vue @@ -23,10 +23,12 @@ css-class="custom-table-column" /> + data-type="number" cell-template="percent" /> - @@ -62,10 +66,11 @@ import { Workbook } from 'exceljs' import { useQuery } from '@vue/apollo-composable' import gql from 'graphql-tag' import { getMonthName } from '@/utils/texts' +import { queries } from '@/utils/graphql' -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) @@ -73,40 +78,7 @@ const showPane = ref(true) const data = ref([]) const dataDetail = ref() const showDetail = ref(false) -const monalisaRekapitulasiLaporUlangGangguan = gql` - query DaftarmonalisaRekapitulasiLaporUlangGangguan( - #$regional: String - $idUlp: Int - $idUid: Int - $idUp3: Int - $bulan: Int - $tahun: Int - ) { - monalisaRekapitulasiLaporUlangGangguan( - #regional: $regional - idUlp: $idUlp - idUid: $idUid - idUp3: $idUp3 - bulan: $bulan - tahun: $tahun - ) { - nama_regional - id_uid - nama_uid - id_up3 - nama_up3 - id_ulp - nama_ulp - mom_bulan_ini - mom_bulan_kemarin - persen_mom - yoy_tahun_ini - yoy_tahun_kemarin - persen_yoy - } - } -` -const { onResult, onError, loading, refetch } = useQuery(monalisaRekapitulasiLaporUlangGangguan, { +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.gangguan.rekap.laporUlangGangguan, { bulan: 10, tahun: 2023, regional: '', @@ -116,9 +88,9 @@ const { onResult, onError, loading, refetch } = useQuery(monalisaRekapitulasiLap }) const filterData = (params: any) => { const { regional, ulp, uid, up3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ regional: regional, idUlp: ulp ? ulp.id : 0, diff --git a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_RecoveryTimeGangguan.vue b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_RecoveryTimeGangguan.vue index ec20dcf..196dd8b 100755 --- a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_RecoveryTimeGangguan.vue +++ b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_RecoveryTimeGangguan.vue @@ -24,17 +24,17 @@ + :caption="`${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column" /> + :caption="`${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column" /> + :caption="`s.d ${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column" /> + :caption="`s.d ${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column" /> @@ -66,91 +66,38 @@ import { Workbook } from 'exceljs' import { useQuery } from '@vue/apollo-composable' import gql from 'graphql-tag' import { getMonthName } from '@/utils/texts' +import { queries } from '@/utils/graphql' -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) const showPane = ref(true) const data = ref([]) -// const monalisaRecoveryTimeGangguan = gql` -// query DaftarmonalisaRecoveryTimeGangguan( -// $regional: regional -// $posko: Int -// $idUid: Int -// $idUp3: Int -// $bulan: Int -// $tahun: Int -// ) { -// monalisaRecoveryTimeGangguan( -// regional: $regional -// posko: $posko -// idUid: $idUid -// idUp3: $idUp3 -// bulan: $bulan -// tahun: $tahun -// ) { -// jumlah_bulan -// jumlah_bulan_n_1 -// jumlah_tahun -// jumlah_tahun_n_1 -// nama_posko -// persen_bulan -// persen_tahun -// } -// } -// ` - -const monalisaRecoveryTimeGangguan = gql` - query DaftarmonalisaRecoveryTimeGangguan( - $idUid: Int - $idUp3: Int - $idUlp: Int - $bulan: Int - $tahun: Int - ) { - monalisaRecoveryTimeGangguan( - idUid: $idUid - idUp3: $idUp3 - idUlp: $idUlp - bulan: $bulan - tahun: $tahun - ) { - nama_ulp - mom_bulan_ini - mom_bulan_kemarin - persen_mom - yoy_tahun_ini - yoy_tahun_kemarin - persen_yoy - } - } -` - -const { onResult, onError, loading, refetch } = useQuery(monalisaRecoveryTimeGangguan, { +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.gangguan.rekap.recoveryTimeGangguan, { // regional: 0, idUp3: 0, idUid: 0, idUlp: 0, - bulan: bulanSekarang.value, - tahun: tahunSekarang.value + bulan: currentMonth.value, + tahun: currentYear.value }) const filterData = (params: any) => { const { regional, ulp, uid, up3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ // regional: regional, idUid: uid ? uid.id : 0, idUp3: up3 ? up3.id : 0, idUlp: ulp ? ulp.id : 0, - bulan: bulan ? bulan.id : bulanSekarang.value, - tahun: bulan ? tahun.id : tahunSekarang.value + bulan: bulan ? bulan.id : currentMonth.value, + tahun: bulan ? tahun.id : currentYear.value }) onResult((queryResult) => { if (queryResult.data != undefined) { diff --git a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ResponseTimeGangguan.vue b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ResponseTimeGangguan.vue index 809eee2..6eedd3b 100755 --- a/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ResponseTimeGangguan.vue +++ b/src/components/Pages/Monalisa/Gangguan/Rekap/MonalisaGR_ResponseTimeGangguan.vue @@ -24,17 +24,17 @@ + :caption="`${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column" /> + :caption="`${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column" /> + :caption="`s.d ${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column" /> + :caption="`s.d ${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column" /> @@ -66,95 +66,42 @@ import { Workbook } from 'exceljs' import gql from 'graphql-tag' import { useQuery } from '@vue/apollo-composable' import { getMonthName } from '@/utils/texts' +import { queries } from '@/utils/graphql' -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) const showPane = ref(true) const data = ref([]) -// const monalisaResponseTimeKeluhan = gql` -// query DaftarmonalisaResponseTimeKeluhan( -// $regional: String -// $posko: Int -// $idUid: Int -// $idUp3: Int -// $bulan: Int -// $tahun: Int -// ) { -// monalisaResponseTimeKeluhan( -// regional: $regional -// posko: $posko -// idUid: $idUid -// idUp3: $idUp3 -// bulan: $bulan -// tahun: $tahun -// ) { -// jumlah_bulan -// jumlah_bulan_n_1 -// jumlah_tahun -// jumlah_tahun_n_1 -// nama_posko -// persen_bulan -// persen_tahun -// } -// } -// ` - -const monalisaResponseTimeKeluhan = gql` - query DaftarmonalisaResponseTimeKeluhan( - $idUid: Int - $idUp3: Int - $idUlp: Int - $bulan: Int - $tahun: Int - ) { - monalisaResponseTimeKeluhan( - idUid: $idUid - idUp3: $idUp3 - idUlp: $idUlp - bulan: $bulan - tahun: $tahun - ) { - nama_ulp - mom_bulan_ini - mom_bulan_kemarin - persen_mom - yoy_tahun_ini - yoy_tahun_kemarin - persen_yoy - } - } -` - -const { onResult, onError, loading, refetch } = useQuery(monalisaResponseTimeKeluhan, { +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.gangguan.rekap.responseTimeGangguan, { // regional: 0, idUp3: 0, idUid: 0, idUlp: 0, - bulan: bulanSekarang.value, - tahun: tahunSekarang.value + bulan: currentMonth.value, + tahun: currentYear.value }) const filterData = (params: any) => { const { regional, ulp, uid, up3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ // regional: regional, idUid: uid ? uid.id : 0, idUp3: up3 ? up3.id : 0, idUlp: ulp ? ulp.id : 0, - bulan: bulan ? bulan.id : bulanSekarang.value, - tahun: bulan ? tahun.id : tahunSekarang.value + bulan: bulan ? bulan.id : currentMonth.value, + tahun: bulan ? tahun.id : currentYear.value }) onResult((queryResult) => { if (queryResult.data != undefined) { - data.value = queryResult.data.monalisaResponseTimeKeluhan + data.value = queryResult.data.monalisaResponseTimeGangguan } console.log(queryResult.data) console.log(queryResult.loading) diff --git a/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_JumlahKaliKeluhan.vue b/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_JumlahKaliKeluhan.vue index a10b889..8cdaf1a 100755 --- a/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_JumlahKaliKeluhan.vue +++ b/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_JumlahKaliKeluhan.vue @@ -3,100 +3,42 @@
- + - + - + - + - - - + + + - - - + + + +
@@ -124,6 +66,7 @@ import { Workbook } from 'exceljs' import { useQuery } from '@vue/apollo-composable' import gql from 'graphql-tag' import { getMonthName } from '@/utils/texts' +import { queries } from '@/utils/graphql' const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) @@ -158,57 +101,30 @@ const onExporting = (e: any) => { } } -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) -const MONALISAJUMLAHKALIKELUHAN = gql` - query DaftarMonalisaJumlahKaliKeluhan( - $regional: String - $posko: Int - $idUid: Int - $idUp3: Int - $bulan: Int - $tahun: Int - ) { - monalisaJumlahKaliKeluhan( - regional: $regional - posko: $posko - idUid: $idUid - idUp3: $idUp3 - bulan: $bulan - tahun: $tahun - ) { - jumlah_bulan - jumlah_bulan_n_1 - jumlah_tahun - jumlah_tahun_n_1 - nama_posko - persen_bulan - persen_tahun - } - } -` -const { onResult, onError, loading, refetch } = useQuery(MONALISAJUMLAHKALIKELUHAN, { +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.keluhan.rekap.jumlahKaliKeluhan, { regional: '', - posko: '', + idUlp: 0, idUid: 0, idUp3: 0, - bulan: bulanSekarang.value, - tahun: tahunSekarang.value + bulan: currentMonth.value, + tahun: currentYear.value }) const filterData = (params: any) => { - const { regional, posko, idUid, idUp3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + const { regional, ulp, uid, up3, bulan, tahun } = params + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ regional: regional, - posko: posko ? posko.id : 0, - idUid: idUid ? idUid.id : 0, - idUp3: idUp3 ? idUp3.id : 0, - bulan: bulan ? bulan.id : bulanSekarang.value, - tahun: bulan ? tahun.id : tahunSekarang.value + idUlp: ulp ? ulp.id : 0, + idUid: uid ? uid.id : 0, + idUp3: up3 ? up3.id : 0, + bulan: bulan ? bulan.id : currentMonth.value, + tahun: bulan ? tahun.id : currentYear.value }) onResult((queryResult) => { if (queryResult.data != undefined) { @@ -227,7 +143,7 @@ const onSelectionChanged = ({ selectedRowsData }: any) => { console.log(data) } onMounted(() => { - console.log(bulanSekarang.value) + console.log(currentMonth.value) }) const filters = ref() diff --git a/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_RecoveryTimeKeluhan.vue b/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_RecoveryTimeKeluhan.vue index c4387b7..045e94d 100755 --- a/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_RecoveryTimeKeluhan.vue +++ b/src/components/Pages/Monalisa/Keluhan/Rekap/MonalisaKR_RecoveryTimeKeluhan.vue @@ -3,104 +3,42 @@
- + - + - + - - + + - - - + + + - - - + + + +
@@ -128,14 +66,15 @@ import { Workbook } from 'exceljs' import { useQuery } from '@vue/apollo-composable' import gql from 'graphql-tag' import { getMonthName } from '@/utils/texts' +import { queries } from '@/utils/graphql' const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) const showPane = ref(true) const data = ref([]) -const tahunSekarang = ref(new Date().getFullYear()) -const bulanSekarang = ref(new Date().getMonth()) -const tahunLalu = ref(tahunSekarang.value - 1) +const currentYear = ref(new Date().getFullYear()) +const currentMonth = ref(new Date().getMonth()) +const lastYear = ref(currentYear.value - 1) const dataDetail = ref() const showDetail = ref(false) const onExporting = (e: any) => { @@ -166,64 +105,31 @@ const onExporting = (e: any) => { e.cancel = true } } -const monalisaDispatchingTimeKeluhan = gql` - query DaftarmonalisaDispatchingTimeKeluhan( - $regional: String - $posko: Int - $idUid: Int - $idUp3: Int - $bulan: Int - $tahun: Int - ) { - monalisaDispatchingTimeKeluhan( - regional: $regional - posko: $posko - idUid: $idUid - idUp3: $idUp3 - bulan: $bulan - tahun: $tahun - ) { - jumlah_bulan - jumlah_bulan_n_1 - jumlah_tahun - jumlah_tahun_n_1 - nama_posko - persen_bulan - persen_tahun - } - } -` -const { onResult, onError, loading, refetch } = useQuery(monalisaDispatchingTimeKeluhan, { + +const { onResult, onError, loading, refetch } = useQuery(queries.monalisa.keluhan.rekap.recoveryTimeKeluhan, { regional: '', - posko: '', + idUlp: 0, idUid: 0, idUp3: 0, bulan: 10, tahun: 2023 }) const filterData = (params: any) => { - const { regional, posko, idUid, idUp3, bulan, tahun } = params - bulanSekarang.value = bulan.id - tahunSekarang.value = tahun.id - tahunLalu.value = tahun.id - 1 + const { regional, ulp, uid, up3, bulan, tahun } = params + currentMonth.value = bulan.id + currentYear.value = tahun.id + lastYear.value = tahun.id - 1 refetch({ regional: regional, - posko: posko ? posko.id : 0, - idUid: idUid ? idUid.id : 0, - idUp3: idUp3 ? idUp3.id : 0, + idUlp: ulp ? ulp.id : 0, + idUid: uid ? uid.id : 0, + idUp3: up3 ? up3.id : 0, bulan: bulan ? bulan.id : 10, tahun: bulan ? tahun.id : 2023 }) onResult((queryResult) => { if (queryResult.data != undefined) { - queryResult.data.monalisaDispatchingTimeKeluhan.forEach((item: any) => { - data.value = [ - ...data.value, - { - ...item - } - ] - }) + data.value = queryResult.data.monalisaRecoveryTimeKeluhan } console.log(queryResult.data) console.log(queryResult.loading) diff --git a/src/utils/graphql.ts b/src/utils/graphql.ts index a48be7a..b67a841 100755 --- a/src/utils/graphql.ts +++ b/src/utils/graphql.ts @@ -1,5 +1,5 @@ //deploy vm -import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client/core' +import { ApolloClient, createHttpLink, gql, InMemoryCache } from '@apollo/client/core' export const apolloClient = () => { const httpLink = createHttpLink({ @@ -21,3 +21,351 @@ export const apolloClient = () => { }) return apolloClient } + +export const queries = { + monalisa: { + gangguan: { + rekap: { + dispatchingTimeGangguan: gql` + query DaftarmonalisaDispatchingTimeGangguan( + #$regional: String + $idUid: Int + $idUp3: Int + $idUlp: Int + $bulan: Int + $tahun: Int + ) { + monalisaDispatchingTimeGangguan( + #regional: $regional + idUid: $idUid + idUp3: $idUp3 + idUlp: $idUlp + bulan: $bulan + tahun: $tahun + ) { + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + `, + rekapitulasiEnsGangguan: gql` + query DaftarmonalisaRekapitulasiEnsGangguan( + #$regional: String + $idUlp: Int + $idUid: Int + $idUp3: Int + $bulan: Int + $tahun: Int + ) { + monalisaRekapitulasiEnsGangguan( + #regional: $regional + idUlp: $idUlp + idUid: $idUid + idUp3: $idUp3 + bulan: $bulan + tahun: $tahun + ) { + nama_regional + id_uid + nama_uid + id_up3 + nama_up3 + id_ulp + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + `, + gangguanBelumSelesai: gql` + query DaftarmonalisaGangguanBelumSelesai( + #$regional: String + $idUlp: Int + $idUid: Int + $idUp3: Int + $bulan: Int + $tahun: Int + ) { + monalisaGangguanBelumSelesai( + #regional: $regional + idUlp: $idUlp + idUid: $idUid + idUp3: $idUp3 + bulan: $bulan + tahun: $tahun + ) { + nama_regional + id_uid + nama_uid + id_up3 + nama_up3 + id_ulp + nama_ulp + jumlah_gangguan + jumlah_informasi + total + } + } + `, + gangguanPerJenisGangguan: gql` + query DaftarmonalisaGangguanPerJenisGangguan( + #$nama_regional: String + $idUid: Int + $idUp3: Int + $idUlp: Int + $bulan: Int + $tahun: Int + ) { + monalisaGangguanPerJenisGangguan( + #nama_regional: $regional + idUid: $idUid + idUp3: $idUp3 + idUlp: $idUlp + bulan: $bulan + tahun: $tahun + ) { + id_jenis_gangguan + nama_jenis_gangguan + jumlah + persen + } + } + `, + jumlahDurasiRptRctGangguan: gql` + query DaftarmonalisaJumlahDurasiRptRctGangguan( + #$regional: String + $idUlp: Int + $idUid: Int + $idUp3: Int + $bulan: Int + $tahun: Int + ) { + monalisaJumlahDurasiRptRctGangguan( + #regional: $regional + idUlp: $idUlp + idUid: $idUid + idUp3: $idUp3 + bulan: $bulan + tahun: $tahun + ) { + id_uid + nama_uid + id_up3 + nama_up3 + id_ulp + nama_ulp + total_durasi_response_time_bulan_ini + count_durasi_response_time_bulan_ini + avg_durasi_response_time_bulan_ini + total_durasi_recovery_time_bulan_ini + count_durasi_recovery_time_bulan_ini + avg_durasi_recovery_time_bulan_ini + total_durasi_response_time_tahun_ini + count_durasi_response_time_tahun_ini + avg_durasi_response_time_tahun_ini + total_durasi_recovery_time_tahun_ini + count_durasi_recovery_time_tahun_ini + avg_durasi_recovery_time_tahun_ini + } + } + `, + jumlahKaliGangguan: gql` + query DaftarMonalisaJumlahKaliGangguan( + #$regional: String + $idUid: Int + $idUp3: Int + $idUlp: Int + $bulan: Int + $tahun: Int + ) { + monalisaJumlahKaliGangguan( + #regional: $regional + idUid: $idUid + idUp3: $idUp3 + idUlp: $idUlp + bulan: $bulan + tahun: $tahun + ) { + nama_uid + nama_up3 + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + `, + laporUlangGangguan: gql` + query DaftarmonalisaRekapitulasiLaporUlangGangguan( + #$regional: String + $idUlp: Int + $idUid: Int + $idUp3: Int + $bulan: Int + $tahun: Int + ) { + monalisaRekapitulasiLaporUlangGangguan( + #regional: $regional + idUlp: $idUlp + idUid: $idUid + idUp3: $idUp3 + bulan: $bulan + tahun: $tahun + ) { + nama_regional + id_uid + nama_uid + id_up3 + nama_up3 + id_ulp + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + `, + recoveryTimeGangguan: gql` + query DaftarmonalisaRecoveryTimeGangguan( + #$regional: regional + $idUid: Int + $idUp3: Int + $idUlp: Int + $bulan: Int + $tahun: Int + ) { + monalisaRecoveryTimeGangguan( + #regional: $regional + idUid: $idUid + idUp3: $idUp3 + idUlp: $idUlp + bulan: $bulan + tahun: $tahun + ) { + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + `, + responseTimeGangguan: gql` + query DaftarmonalisaResponseTimeGangguan( + #regional: String + $idUid: Int + $idUp3: Int + $idUlp: Int + $bulan: Int + $tahun: Int + ) { + monalisaResponseTimeGangguan( + #regional: $regional + idUid: $idUid + idUp3: $idUp3 + idUlp: $idUlp + bulan: $bulan + tahun: $tahun + ) { + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + ` + } + }, + keluhan: { + rekap: { + jumlahKaliKeluhan: gql` + query DaftarMonalisaJumlahKaliKeluhan( + #$regional: String + $idUlp: Int + $idUid: Int + $idUp3: Int + $bulan: Int + $tahun: Int + ) { + monalisaJumlahKaliKeluhan( + #regional: $regional + idUlp: $idUlp + idUid: $idUid + idUp3: $idUp3 + bulan: $bulan + tahun: $tahun + ) { + nama_regional + id_uid + nama_uid + id_up3 + nama_up3 + id_ulp + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + `, + recoveryTimeKeluhan: gql` + query DaftarmonalisaRecoveryTimeKeluhan( + #$regional: String + $idUlp: Int + $idUid: Int + $idUp3: Int + $bulan: Int + $tahun: Int + ) { + monalisaRecoveryTimeKeluhan( + #regional: $regional + idUlp: $idUlp + idUid: $idUid + idUp3: $idUp3 + bulan: $bulan + tahun: $tahun + ) { + nama_regional + id_uid + nama_uid + id_up3 + nama_up3 + id_ulp + nama_ulp + mom_bulan_ini + mom_bulan_kemarin + persen_mom + yoy_tahun_ini + yoy_tahun_kemarin + persen_yoy + } + } + ` + } + } + }, + +}