Refactor GraphQL queries in Gangguan components
This commit is contained in:
@ -319,7 +319,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { useFiltersStore } from '@/stores/filters'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
@ -338,7 +338,7 @@ import { exportDataGrid as exportToExcel } from 'devextreme/excel_exporter'
|
||||
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 position = { of: '#data' }
|
||||
const showIndicator = ref(true)
|
||||
const shading = ref(true)
|
||||
@ -377,49 +377,8 @@ const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
console.log(data)
|
||||
}
|
||||
const data = ref<any[]>([])
|
||||
const GET_REKAPITULASI_GANGGUAN_DISELESAIKAN_MOBILE_APKT = gql`
|
||||
query rekapitulasiGangguanDiselesaikanMobileAPKT(
|
||||
$dateFrom: Date!
|
||||
$dateTo: Date!
|
||||
$posko: Int!
|
||||
$idUid: Int!
|
||||
$idUp3: Int!
|
||||
) {
|
||||
rekapitulasiGangguanDiselesaikanMobileAPKT(
|
||||
dateFrom: $dateFrom
|
||||
dateTo: $dateTo
|
||||
posko: $posko
|
||||
idUid: $idUid
|
||||
idUp3: $idUp3
|
||||
) {
|
||||
avg_waktu_recovery_mobile_marking
|
||||
avg_waktu_recovery_mobile_nonmarking
|
||||
avg_waktu_recovery_nonmobile_marking
|
||||
avg_waktu_recovery_nonmobile_nonmarking
|
||||
avg_waktu_response_mobile_marking
|
||||
avg_waktu_response_mobile_nonmarking
|
||||
avg_waktu_response_nonmobile_marking
|
||||
avg_waktu_response_nonmobile_nonmarking
|
||||
kode_regu
|
||||
persen_belum_selesai
|
||||
persen_laporan_mobile_marking
|
||||
persen_laporan_mobile_nonmarking
|
||||
persen_laporan_nonmobile_marking
|
||||
persen_laporan_nonmobile_nonmarking
|
||||
persen_selesai
|
||||
regu
|
||||
total_belum_selesai
|
||||
total_laporan
|
||||
total_laporan_mobile_marking
|
||||
total_laporan_mobile_nonmarking
|
||||
total_laporan_nonmobile_marking
|
||||
total_laporan_nonmobile_nonmarking
|
||||
total_selesai
|
||||
}
|
||||
}
|
||||
`
|
||||
const { onResult, onError, loading, refetch } = useQuery(
|
||||
GET_REKAPITULASI_GANGGUAN_DISELESAIKAN_MOBILE_APKT,
|
||||
queries.gangguan.rekap.gangguanDiselesaikanMobileAPKT,
|
||||
{
|
||||
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
|
Reference in New Issue
Block a user