Refactor filter components in Keluhan tables
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<Filters @run-search="() => filterData(filters)" class="mb-4">
|
||||
<Type13 @update:filters="(value) => {
|
||||
filters = value
|
||||
}
|
||||
" />
|
||||
<Type13 @update:filters="(value) => filters = value" />
|
||||
</Filters>
|
||||
<div id="data">
|
||||
<DxDataGrid class="max-h-[calc(100vh-140px)]" :data-source="data" :show-column-lines="true" :show-row-lines="false"
|
||||
@@ -13,8 +10,8 @@
|
||||
<DxSelection mode="single" />
|
||||
<DxPaging :enabled="false" />
|
||||
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
||||
<DxLoadPanel :position="position" :show-indicator="showIndicator" :show-pane="showPane" :shading="shading"
|
||||
v-if="loading" v-model:visible="loading" :enabled="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" />
|
||||
@@ -83,7 +80,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type13 from '@/components/Form/FiltersType/Type13.vue'
|
||||
import { ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import { DxColumn, DxColumnFixing, DxExport, DxLoadPanel, DxPaging, DxScrolling, DxSearchPanel, DxSelection } from 'devextreme-vue/data-grid'
|
||||
import { jsPDF } from 'jspdf'
|
||||
@@ -173,7 +170,7 @@ query rekapitulasiKeluhanPerKelompokKeluhan
|
||||
total_selesai
|
||||
}
|
||||
}`;
|
||||
const { onResult, onError ,loading,refetch} = useQuery(GET_DATA, {
|
||||
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: 0,
|
||||
@@ -184,20 +181,21 @@ const filters = ref();
|
||||
|
||||
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 : 0,
|
||||
idUid: uid ? uid.id :0,
|
||||
idUp3: up3? up3.id:0})
|
||||
idUid: uid ? uid.id : 0,
|
||||
idUp3: up3 ? up3.id : 0
|
||||
})
|
||||
|
||||
|
||||
onResult(queryResult => {
|
||||
if (queryResult.data != undefined) {
|
||||
data.value = queryResult.data.rekapitulasiKeluhanPerKelompokKeluhan
|
||||
;
|
||||
|
||||
|
||||
}
|
||||
console.log(queryResult.data)
|
||||
console.log(queryResult.loading)
|
||||
|
Reference in New Issue
Block a user