Fix idUlp type in filterData function

This commit is contained in:
Eko Haryadi
2024-02-23 17:07:59 +07:00
parent 29fff0c8a4
commit 81d77fc101
21 changed files with 213 additions and 202 deletions

View File

@ -24,12 +24,9 @@
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1" data-type="number" caption="No" />
<DxColumn :width="170" alignment="center" data-field="no_laporan" caption="No Laporan"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="pembuat_laporan" caption="Pembuat Laporan"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_lapor" caption="Tgl Lapor"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_dialihkan" caption="Tgl Dialihkan"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_response" caption="Tgl Response"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_recovery" caption="Tgl Recovery"
@ -50,7 +47,7 @@
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="keterangan_pelapor" caption="Keterangan Pelapor"
css-class="custom-table-column" />
<DxColumn :width="150" alignment="center" data-field="idUlp" caption="Nama ULP"
<DxColumn :width="150" alignment="center" data-field="nama_unit" caption="Nama ULP"
css-class="custom-table-column" />
</DxDataGrid>
</div>
@ -138,20 +135,20 @@ const GET_DATA = gql`
idUid: $idUid
idUp3: $idUp3
) {
alamat_pelapor
durasi_recovery_time
durasi_response_time
id_keluhan
idpel_nometer
keterangan_pelapor
media
nama_pelapor
no_laporan
no_telp_pelapor
idUlp
status_akhir
waktu_recovery
waktu_response
alamat_pelapor
durasi_recovery_time
durasi_response_time
idpel_nometer
keterangan_pelapor
media
nama_pelapor
nama_unit
no_laporan
no_telp_pelapor
status_akhir
waktu_lapor
waktu_recovery
waktu_response
}
}
`
@ -160,21 +157,19 @@ const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
minDurasiResponseTime: 0,
maxDurasiResponseTime: 0,
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
const filterData = (params: any) => {
const dateValue = params.periode.split(' s/d ')
const { idUlp, uid, up3 } = params
const minDurasiResponseTime = params.minDurasiResponseTime ? params.minDurasiResponseTime : 0
const maxDurasiResponseTime = params.maxDurasiResponseTime ? params.maxDurasiResponseTime : 0
const { ulp, uid, up3,maxTime,minTime } = params
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
minDurasiResponseTime: minDurasiResponseTime,
maxDurasiResponseTime: maxDurasiResponseTime,
idUlp: idUlp ? idUlp.id : "",
minDurasiResponseTime: minTime,
maxDurasiResponseTime:maxTime,
idUlp: ulp ? ulp.id :0,
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})

View File

@ -12,10 +12,10 @@
:allow-column-resizing="true" column-resizing-mode="widget" :word-wrap-enabled="true">
<DxSelection mode="single" />
<DxPaging :page-size="5" :enabled="true" />
<DxPager :visible="true" :allowed-page-sizes="[5, 10, 20]" display-mode="full"
:show-page-size-selector="true" :show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxPager :visible="true" :allowed-page-sizes="[5, 10, 20]" display-mode="full" :show-page-size-selector="true"
:show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
<DxColumnFixing :enabled="true" />
@ -24,18 +24,13 @@
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1" data-type="number" caption="No" />
<DxColumn :width="170" alignment="center" data-field="no_laporan" caption="No Laporan"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="pembuat_laporan" caption="Pembuat Laporan"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_lapor" caption="Tgl Lapor"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_dialihkan" caption="Tgl Dialihkan"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_response" caption="Tgl Response"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="waktu_recovery" caption="Tgl Recovery"
css-class="custom-table-column" />
<DxColumn :width="120" alignment="center" data-field="jumlah_lapor" caption="Jml Lapor"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="durasi_response_time" caption="Durasi Response Time"
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="durasi_recovery_time" caption="Durasi Recovery Time"
@ -52,7 +47,7 @@
css-class="custom-table-column" />
<DxColumn :width="170" alignment="center" data-field="keterangan_pelapor" caption="Keterangan Pelapor"
css-class="custom-table-column" />
<DxColumn :width="150" alignment="center" data-field="idUlp" caption="Nama ULP"
<DxColumn :width="150" alignment="center" data-field="nama_unit" caption="Nama ULP"
css-class="custom-table-column" />
</DxDataGrid>
</div>
@ -140,20 +135,20 @@ const GET_DATA = gql`
idUid: $idUid
idUp3: $idUp3
) {
alamat_pelapor
durasi_recovery_time
durasi_response_time
id_keluhan
idpel_nometer
keterangan_pelapor
media
nama_pelapor
no_laporan
no_telp_pelapor
idUlp
status_akhir
waktu_recovery
waktu_response
alamat_pelapor
durasi_recovery_time
durasi_response_time
idpel_nometer
keterangan_pelapor
media
nama_pelapor
nama_unit
no_laporan
no_telp_pelapor
status_akhir
waktu_lapor
waktu_recovery
waktu_response
}
}
`
@ -163,28 +158,27 @@ const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
minDurasiRecoveryTime: 0,
maxDurasiRecoveryTime: 0,
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
const filterData = (params: any) => {
const dateValue = params.periode.split(' s/d ')
const { idUlp, uid, up3 } = params
const minDurasiRecoveryTime = params.minDurasiRecoveryTime ? params.minDurasiRecoveryTime : 0
const maxDurasiRecoveryTime = params.maxDurasiRecoveryTime ? params.maxDurasiRecoveryTime : 0
const { ulp, uid, up3,minTime,maxTime } = params
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
minDurasiRecoveryTime: minDurasiRecoveryTime,
maxDurasiRecoveryTime: maxDurasiRecoveryTime,
idUlp: idUlp ? idUlp.id : "",
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})
minDurasiRecoveryTime: minTime,
maxDurasiRecoveryTime: maxTime,
idUlp: ulp ? ulp.id : 0,
idUid: uid ? uid.id : 0,
idUp3: up3 ? up3.id : 0
})
onResult((queryResult) => {
if (queryResult.data != undefined) {
data.value = queryResult.data.daftarKeluhanRecoveryTime
}
console.log(queryResult.data)
console.log(queryResult.loading)
@ -193,7 +187,7 @@ const filterData = (params: any) => {
onError((error) => {
console.log(error)
})
}
const filters = ref();
</script>

View File

@ -159,7 +159,7 @@ const GET_DATA = gql`
const { onResult, onError,loading,refetch } = useQuery(GET_DATA, {
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
@ -170,7 +170,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})

View File

@ -6,16 +6,16 @@
" />
</Filters>
<div id="data">
<DxDataGrid class="max-h-[calc(100vh-140px)]" :show-column-lines="true" :show-row-lines="false" :show-borders="true"
<DxDataGrid class="max-h-[calc(100vh-140px)]" :data-source="data" :show-column-lines="true" :show-row-lines="false" :show-borders="true"
:row-alternation-enabled="true" :hover-state-enabled="true" @selection-changed="onSelectionChanged"
:column-width="100" @exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget"
:word-wrap-enabled="true">
<DxSelection mode="single" />
<DxPaging :page-size="5" :enabled="true" />
<DxPager :visible="true" :allowed-page-sizes="[5, 10, 20]" display-mode="full"
:show-page-size-selector="true" :show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxPager :visible="true" :allowed-page-sizes="[5, 10, 20]" display-mode="full" :show-page-size-selector="true"
:show-info="true" :show-navigation-buttons="true" />
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
v-if="loading" v-model:visible="loading" :enabled="true" />
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
<DxColumnFixing :enabled="true" />
@ -157,25 +157,26 @@ const GET_DATA = gql`
const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
const filterData = (params: any) => {
const dateValue = params.periode.split(' s/d ')
const { idUlp, uid, up3 } = params
const { idUlp, uid, up3 } = params
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id : 0,
idUp3: up3 ? up3.id : 0
})
onResult((queryResult) => {
if (queryResult.data != undefined) {
data.value = queryResult.data.daftarKeluhanBerdasarkanMedia
}
console.log(queryResult.data)
console.log(queryResult.loading)

View File

@ -154,7 +154,7 @@ const GET_DATA = gql`
const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0,
media: 'Twitter'
@ -168,7 +168,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id : 0,
idUp3: up3 ? up3.id : 0,
media: media

View File

@ -167,7 +167,7 @@ query rekapitulasiKeluhanAll
const { onResult, onError,loading,refetch } = useQuery(GET_DATA, {
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
@ -179,7 +179,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})

View File

@ -182,7 +182,7 @@ const GET_DATA = gql`
const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
@ -194,7 +194,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})

View File

@ -188,7 +188,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})

View File

@ -188,7 +188,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id :0,
idUp3: up3? up3.id:0})

View File

@ -197,7 +197,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id : 0,
idUp3: up3 ? up3.id : 0
})

View File

@ -184,7 +184,7 @@ const GET_DATA = gql`
const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
@ -196,7 +196,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id : 0,
idUp3: up3 ? up3.id : 0
})

View File

@ -145,7 +145,7 @@ const GET_DATA = gql`
const { onResult, onError, loading, refetch } = useQuery(GET_DATA, {
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
idUlp: '',
idUlp: 0,
idUid: 0,
idUp3: 0
})
@ -157,7 +157,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id : 0,
idUp3: up3 ? up3.id : 0
})

View File

@ -177,7 +177,7 @@ const filterData = (params: any) => {
refetch({
dateFrom: dateValue[0] ? dateValue[0].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
dateTo: dateValue[1] ? dateValue[1].split('-').reverse().join('-') : new Date().toISOString().slice(0, 10),
idUlp: idUlp ? idUlp.id : "",
idUlp: idUlp ? idUlp.id : 0,
idUid: uid ? uid.id : 0,
idUp3: up3 ? up3.id : 0
})