Refactor GraphQL queries in Keluhan Daftar components
This commit is contained in:
@ -299,7 +299,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)
|
||||
@ -351,44 +351,8 @@ const onExporting = (e: any) => {
|
||||
}
|
||||
|
||||
const data = ref<any[]>([])
|
||||
const GET_DATA = gql`
|
||||
query daftarKeluhanRecoveryTime(
|
||||
$dateFrom: Date!
|
||||
$dateTo: Date!
|
||||
$minDurasiRecoveryTime: Int!
|
||||
$maxDurasiRecoveryTime: Int!
|
||||
$idUlp: Int!
|
||||
$idUid: Int!
|
||||
$idUp3: Int!
|
||||
) {
|
||||
daftarKeluhanRecoveryTime(
|
||||
dateFrom: $dateFrom
|
||||
dateTo: $dateTo
|
||||
idUlp: $idUlp
|
||||
minDurasiRecoveryTime: $minDurasiRecoveryTime
|
||||
maxDurasiRecoveryTime: $maxDurasiRecoveryTime
|
||||
idUid: $idUid
|
||||
idUp3: $idUp3
|
||||
) {
|
||||
alamat_pelapor
|
||||
durasi_recovery_time
|
||||
durasi_response_time
|
||||
idpel_nometer
|
||||
keterangan_pelapor
|
||||
media
|
||||
nama_pelapor
|
||||
nama_ulp
|
||||
no_laporan
|
||||
no_telp_pelapor
|
||||
status_akhir
|
||||
waktu_lapor
|
||||
waktu_recovery
|
||||
waktu_response
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
|
||||
const { onResult, onError, loading, refetch } = useQuery(queries.keluhan.daftar.keluhanRecoveryTime, {
|
||||
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
minDurasiRecoveryTime: 0,
|
||||
|
Reference in New Issue
Block a user