update Pagination สรรหา

This commit is contained in:
Warunee Tamkoo 2023-10-25 00:07:58 +07:00
parent 4ead339be2
commit a916ce797f
2 changed files with 139 additions and 277 deletions

View file

@ -1,51 +1,19 @@
<template> <template>
<div class="q-px-md q-pb-md"> <div class="q-px-md q-pb-md">
<q-card <q-card bordered flat class="col-12 row q-py-sm items-center bg-grey-1" v-show="statusPayment">
bordered
flat
class="col-12 row q-py-sm items-center bg-grey-1"
v-show="statusPayment"
>
<div class="col-12 row q-col-gutter-sm"> <div class="col-12 row q-col-gutter-sm">
<span class="text-subtitle1">{{ titleText }}</span> <span class="text-subtitle1">{{ titleText }}</span>
<q-select <q-select dense outlined :model-value="inputvisibleFilter" :options="optionsFilter" option-value="id"
dense option-label="name" map-options class="col-xs-12 col-sm-3" label="สถานะ" emit-value
outlined @update:model-value="updateVisibleFilter" v-if="optionsFilter != undefined && optionsFilter.length > 0" />
:model-value="inputvisibleFilter" <q-file v-model="files" dense :label="setSeat == false ? 'อัปโหลดที่นั่งสอบ' : 'อัปโหลดคะแนนสอบ'" outlined
:options="optionsFilter" use-chips multiple class="col-xs-12 col-sm-4" v-if="statusPayment">
option-value="id"
option-label="name"
map-options
class="col-xs-12 col-sm-3"
label="สถานะ"
emit-value
@update:model-value="updateVisibleFilter"
v-if="optionsFilter != undefined && optionsFilter.length > 0"
/>
<q-file
v-model="files"
dense
:label="setSeat == false ? 'อัปโหลดที่นั่งสอบ' : 'อัปโหลดคะแนนสอบ'"
outlined
use-chips
multiple
class="col-xs-12 col-sm-4"
v-if="statusPayment"
>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="blue" /> <q-icon name="attach_file" color="blue" />
</template> </template>
</q-file> </q-file>
<div> <div>
<q-btn <q-btn size="md" icon="mdi-upload" round flat color="blue" v-if="statusPayment" @click="uploadFile">
size="md"
icon="mdi-upload"
round
flat
color="blue"
v-if="statusPayment"
@click="uploadFile"
>
<q-tooltip v-if="setSeat == false">อัปโหลดที่นั่งสอบ</q-tooltip> <q-tooltip v-if="setSeat == false">อัปโหลดที่นั่งสอบ</q-tooltip>
<q-tooltip v-if="setSeat == true">อัปโหลดคะแนนสอบ</q-tooltip> <q-tooltip v-if="setSeat == true">อัปโหลดคะแนนสอบ</q-tooltip>
</q-btn> </q-btn>
@ -54,34 +22,15 @@
</q-card> </q-card>
<div class="col-12 row q-py-sm items-center q-col-gutter-sm"> <div class="col-12 row q-py-sm items-center q-col-gutter-sm">
<div class="col-xs-12 col-sm-3" v-show="!statusPayment"> <div class="col-xs-12 col-sm-3" v-show="!statusPayment">
<q-select <q-select dense outlined :model-value="inputvisibleFilter" :options="optionsFilter" option-value="id"
dense option-label="name" map-options class="" label="สถานะ" emit-value @update:model-value="updateVisibleFilter"
outlined v-if="optionsFilter != undefined && optionsFilter.length > 0" />
:model-value="inputvisibleFilter"
:options="optionsFilter"
option-value="id"
option-label="name"
map-options
class=""
label="สถานะ"
emit-value
@update:model-value="updateVisibleFilter"
v-if="optionsFilter != undefined && optionsFilter.length > 0"
/>
</div> </div>
<div> <div>
<q-btn <q-btn size="md" icon="mdi-playlist-check" round flat color="primary" @click="candidateCheckProfileDialog"
size="md" :disabled="attrs.rows.filter((r: any) => r.status == 'checkRegister').length == 0 ||
icon="mdi-playlist-check"
round
flat
color="primary"
@click="candidateCheckProfileDialog"
:disabled="
attrs.rows.filter((r) => r.status == 'checkRegister').length == 0 ||
selected.length == 0 selected.length == 0
" ">
>
<q-tooltip>ตรวจสอบขอม/ไดบใบสมครแล</q-tooltip> <q-tooltip>ตรวจสอบขอม/ไดบใบสมครแล</q-tooltip>
</q-btn> </q-btn>
</div> </div>
@ -93,21 +42,11 @@
<q-item clickable v-close-popup @click="downloadFileDashboard"> <q-item clickable v-close-popup @click="downloadFileDashboard">
<q-item-section>ดาวนโหลดสรปขอมลสมครสอบ</q-item-section> <q-item-section>ดาวนโหลดสรปขอมลสมครสอบ</q-item-section>
</q-item> </q-item>
<q-item <q-item clickable v-close-popup @click.stop.prevent="clickCandidateList()">
clickable
v-close-popup
@click.stop.prevent="clickCandidateList()"
>
<q-item-section>ดาวนโหลดรายชอผทธสอบ</q-item-section> <q-item-section>ดาวนโหลดรายชอผทธสอบ</q-item-section>
</q-item> </q-item>
<q-item <q-item clickable v-close-popup @click.stop.prevent="clickPassExam()">
clickable <q-item-section>ดาวนโหลดรายชอผสอบคดเลอกได</q-item-section>
v-close-popup
@click.stop.prevent="clickPassExam()"
>
<q-item-section
>ดาวนโหลดรายชอผสอบคดเลอกได</q-item-section
>
</q-item> </q-item>
<q-item clickable v-close-popup @click="downloadFile()"> <q-item clickable v-close-popup @click="downloadFile()">
<q-item-section>ดาวนโหลดจดการรายชอผสมคร</q-item-section> <q-item-section>ดาวนโหลดจดการรายชอผสมคร</q-item-section>
@ -120,88 +59,35 @@
</q-btn> </q-btn>
</div> </div>
<div> <div>
<q-btn <q-btn size="md" icon="mdi-content-save-move-outline" round flat color="indigo"
size="md" v-if="statusPayment && setSeat == true" @click="candidateToPlacement">
icon="mdi-content-save-move-outline"
round
flat
color="indigo"
v-if="statusPayment && setSeat == true"
@click="candidateToPlacement"
>
<q-tooltip>บรรจานการคดเลอก</q-tooltip> <q-tooltip>บรรจานการคดเลอก</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<q-space /> <q-space />
<div class="items-center gt-xs" style="display: flex"> <div class="items-center gt-xs" style="display: flex">
<!-- นหาขอความใน table --> <!-- นหาขอความใน table -->
<q-input <q-input standout dense :model-value="inputfilter" ref="filterRef" @update:model-value="updateInput" outlined
standout debounce="300" placeholder="ค้นหา" style="max-width: 200px" class="q-ml-sm">
dense
:model-value="inputfilter"
ref="filterRef"
@update:model-value="updateInput"
outlined
debounce="300"
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
>
<template v-slot:append> <template v-slot:append>
<q-icon v-if="inputfilter == ''" name="search" /> <q-icon v-if="inputfilter == ''" name="search" />
<q-icon <q-icon v-if="inputfilter !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
v-if="inputfilter !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<!-- แสดงคอลมนใน table --> <!-- แสดงคอลมนใน table -->
<q-select <q-select :model-value="inputvisible" @update:model-value="updateVisible" :display-value="$q.lang.table.columns"
:model-value="inputvisible" multiple outlined dense :options="attrs.columns" options-dense option-value="name" map-options emit-value
@update:model-value="updateVisible" style="min-width: 150px" class="q-ml-sm" />
:display-value="$q.lang.table.columns"
multiple
outlined
dense
:options="attrs.columns"
options-dense
option-value="name"
map-options
emit-value
style="min-width: 150px"
class="q-ml-sm"
/>
</div> </div>
</div> </div>
<q-table
ref="table" <q-table ref="table" flat bordered class="custom-header-table" v-bind="attrs" virtual-scroll
flat :virtual-scroll-sticky-size-start="48" dense :pagination="initialPagination"
bordered :rows-per-page-options="paging == true ? [25, 50, 100, 500] : []" row-key="id" selection="multiple"
class="custom-header-table" v-model:selected="selected" @update:pagination="updatePagination">
v-bind="attrs"
virtual-scroll
:virtual-scroll-sticky-size-start="48"
dense
:pagination-label="paginationLabel"
:pagination="initialPagination"
:rows-per-page-options="paging == true ? [25, 50, 100, 500] : []"
row-key="id"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:pagination="scope"> <template v-slot:pagination="scope">
<q-pagination งหมด {{ props.total }} รายการ
v-model="pagination.page" <q-pagination v-model="currentPage" active-color="primary" color="dark" :max-pages="5" size="sm" boundary-links direction-links :max="props.maxPage < 1 ? 1 : props.maxPage"></q-pagination>
active-color="primary"
color="dark"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template> </template>
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
@ -212,12 +98,8 @@
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
<q-th <q-th auto-width v-if="editvisible == true || nextPageVisible == true || history == true
auto-width " />
v-if="
editvisible == true || nextPageVisible == true || history == true
"
/>
</q-tr> </q-tr>
</template> </template>
<template #body="props"> <template #body="props">
@ -227,7 +109,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, useAttrs } from "vue"; import { ref, useAttrs, watch, watchEffect } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -251,12 +133,6 @@ const selected = ref<string[]>([]);
const { messageError, showLoader, hideLoader } = mixin; const { messageError, showLoader, hideLoader } = mixin;
const dateFilter = ref<[Date, Date]>([new Date(), new Date()]); // const dateFilter = ref<[Date, Date]>([new Date(), new Date()]); //
const pagination = ref({
// sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
const props = defineProps({ const props = defineProps({
inputfilter: String, inputfilter: String,
inputvisible: Array, inputvisible: Array,
@ -287,6 +163,22 @@ const props = defineProps({
type: Boolean, type: Boolean,
defualt: false, defualt: false,
}, },
pageSize: {
type: Number,
defualt: 25
},
page: {
type: Number,
defualt: 1
},
maxPage: {
type: Number,
defualt: 1
},
total: {
type: Number,
defualt: 0
},
nornmalData: { nornmalData: {
type: Boolean, type: Boolean,
defualt: false, defualt: false,
@ -337,11 +229,32 @@ const props = defineProps({
type: Function, type: Function,
default: () => console.log("not function"), default: () => console.log("not function"),
}, },
changePage: {
type: Function,
default: () => console.log("not function"),
}
}); });
// Pagination - page & change page & get new data
const currentPage = ref<number>(1)
watch(currentPage, () => {
props.changePage(currentPage.value, props.pageSize, true);
});
// Pagination - initial pagination
const initialPagination = ref<any>({ const initialPagination = ref<any>({
rowsPerPage: props.paging == true ? 25 : 0, sortBy: null,
descending: false,
page: 1,
rowsPerPage: props.pageSize,
}); });
// Pagination - update rowsPerPage
async function updatePagination(newPagination: any) {
props.changePage(1, newPagination.rowsPerPage, true);
initialPagination.value = newPagination
}
const emit = defineEmits([ const emit = defineEmits([
"update:inputfilter", "update:inputfilter",
"update:inputvisible", "update:inputvisible",
@ -350,8 +263,14 @@ const emit = defineEmits([
"update:inputvisibleFilter", "update:inputvisibleFilter",
]); ]);
const updateInput = (value: any) => { const updateInput = async (value: any) => {
emit("update:inputfilter", value); await emit("update:inputfilter", value);
// search & get new data by keyword
if (value.length > 3) {
props.changePage(1, props.pageSize);
currentPage.value = 1
}
}; };
const updateVisible = (value: any) => { const updateVisible = (value: any) => {
emit("update:inputvisible", value); emit("update:inputvisible", value);
@ -360,12 +279,6 @@ const updateVisibleFilter = (value: any) => {
emit("update:inputvisibleFilter", value); emit("update:inputvisibleFilter", value);
}; };
const paginationLabel = (start: string, end: string, total: string) => {
if (props.paging == true)
return " " + start + " ถึง " + end + " จากจำนวน " + total + " รายการ";
else return start + "-" + end + " ใน " + total;
};
const uploadFile = async () => { const uploadFile = async () => {
if (files.value.length > 0) { if (files.value.length > 0) {
if (props.setSeat == false) { if (props.setSeat == false) {
@ -406,8 +319,8 @@ const candidateToPlacement = async () => {
router.go(-1); router.go(-1);
}); });
}) })
.onCancel(() => {}) .onCancel(() => { })
.onDismiss(() => {}); .onDismiss(() => { });
}; };
const uploadDataSeat = async () => { const uploadDataSeat = async () => {
@ -486,7 +399,7 @@ const downloadFileDetail = async () => {
}; };
const checkCandidates = async () => { const checkCandidates = async () => {
var _selected = []; var _selected: any[] = [];
selected.value.map((r: any) => { selected.value.map((r: any) => {
_selected.push(r.id.toString()); _selected.push(r.id.toString());
}); });
@ -568,6 +481,10 @@ const resetFilter = () => {
// reset X // reset X
emit("update:inputfilter", ""); emit("update:inputfilter", "");
filterRef.value.focus(); filterRef.value.focus();
// clear keyword & get new data
props.changePage(1, props.pageSize);
currentPage.value = 1
}; };
const downloadFileDashboard = async () => { const downloadFileDashboard = async () => {
@ -633,11 +550,14 @@ const clickCandidateList = async () => {
.icon-color { .icon-color {
color: #4154b3; color: #4154b3;
} }
.custom-header-table { .custom-header-table {
max-height: 64vh; max-height: 64vh;
.q-table tr:nth-child(odd) td { .q-table tr:nth-child(odd) td {
background: white; background: white;
} }
.q-table tr:nth-child(even) td { .q-table tr:nth-child(even) td {
background: #f8f8f8; background: #f8f8f8;
} }
@ -650,11 +570,13 @@ const clickCandidateList = async () => {
position: sticky; position: sticky;
z-index: 1; z-index: 1;
} }
/* this will be the loading indicator */ /* this will be the loading indicator */
.q-table thead tr:last-child th { .q-table thead tr:last-child th {
/* height of all previous header rows */ /* height of all previous header rows */
top: 48px; top: 48px;
} }
.q-table thead tr:first-child th { .q-table thead tr:first-child th {
top: 0; top: 0;
} }

View file

@ -1,35 +1,16 @@
<template> <template>
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
<q-btn <q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="router.go(-1)" />
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="router.go(-1)"
/>
{{ name }} {{ name }}
{{ {{
`ครั้งที่${round == null ? "" : round}/${ `ครั้งที่${round == null ? "" : round}/${yearly == null ? "" : yearly + 543
yearly == null ? "" : yearly + 543 }`
}`
}} }}
<q-space /> <q-space />
<q-btn <q-btn @click="visible = !visible" dense round size="13px" :style="visible == false
@click="visible = !visible"
dense
round
size="13px"
:style="
visible == false
? 'transform: rotate(90deg);transition-duration: 0.8s;' ? 'transform: rotate(90deg);transition-duration: 0.8s;'
: 'transform: rotate(0);transition-duration: 0.8s;' : 'transform: rotate(0);transition-duration: 0.8s;'
" " icon="mdi-pin" flat></q-btn>
icon="mdi-pin"
flat
></q-btn>
</div> </div>
<q-slide-transition> <q-slide-transition>
<q-card class="row col-12 q-mb-sm" v-show="visible"> <q-card class="row col-12 q-mb-sm" v-show="visible">
@ -39,23 +20,16 @@
<div class="col-12 row"> <div class="col-12 row">
<div class="col-12"> <div class="col-12">
<div class="row col-12 q-col-gutter-sm fit"> <div class="row col-12 q-col-gutter-sm fit">
<div <div style="width: 25%" v-for="(num, index) in dataNum" :key="index">
style="width: 25%"
v-for="(num, index) in dataNum"
:key="index"
>
<q-card bordered flat class="row fit cardNum items-center"> <q-card bordered flat class="row fit cardNum items-center">
<div class="col-12 row items-center q-pa-sm"> <div class="col-12 row items-center q-pa-sm">
<div <div :class="'col-12 text-h5 text-weight-bold text-' +
:class=" `${num.color}`
'col-12 text-h5 text-weight-bold text-' + ">
`${num.color}`
"
>
{{ {{
num.count != null num.count != null
? num.count.toLocaleString("en-US") ? num.count.toLocaleString("en-US")
: "" : ""
}} }}
</div> </div>
<div class="col-12 text-dark ellipsis"> <div class="col-12 text-dark ellipsis">
@ -72,53 +46,27 @@
</q-card> </q-card>
</q-slide-transition> </q-slide-transition>
<q-card flat bordered class="col-12 q-pt-sm"> <q-card flat bordered class="col-12 q-pt-sm">
<TableCandidate <TableCandidate style="max-height: 80vh" :rows="rows" :columns="columns" :filter="filter"
style="max-height: 80vh" :visible-columns="visibleColumns" v-model:inputfilter="filter" v-model:inputvisible="visibleColumns"
:rows="rows" v-model:inputvisibleFilter="status" v-model:optionsFilter="optionsStatus"
:columns="columns" :nornmalData="true" :paging="true" :titleText="''" :statusPayment="statusPayment" :setSeat="setSeat"
:filter="filter" :fetchData="fetchDataCom" :history="true" :page-size="page_size" :total="total" :page="page" :changePage="changePage" :max-page="maxPage">
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
v-model:inputvisibleFilter="status"
v-model:optionsFilter="optionsStatus"
:pagination="initialPagination"
:nornmalData="true"
:paging="true"
:titleText="''"
:statusPayment="statusPayment"
:setSeat="setSeat"
:fetchData="fetchDataCom"
:history="true"
>
<template #columns="props"> <template #columns="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td auto-width> <q-td auto-width>
<q-checkbox v-model="props.selected" /> <q-checkbox v-model="props.selected" />
</q-td> </q-td>
<q-td <q-td v-for="col in props.cols" :key="col.name" :props="props"
v-for="col in props.cols" @click="viewDetail(props.row.id, props.row.status)">
:key="col.name"
:props="props"
@click="viewDetail(props.row.id, props.row.status)"
>
<div v-if="col.name == 'no'" class="table_ellipsis"> <div v-if="col.name == 'no'" class="table_ellipsis">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</div> </div>
<div v-else-if="col.name == 'fullname'"> <div v-else-if="col.name == 'fullname'">
<div class="row col-12 items-center"> <div class="row col-12 items-center">
<img <img v-if="props.row.avatar == ''" src="@/assets/avatar_user.jpg" class="q-mr-sm col-4"
v-if="props.row.avatar == ''" style="width: 28px; height: 28px; border-radius: 50%" />
src="@/assets/avatar_user.jpg" <img v-else :src="props.row.avatar" class="q-mr-sm col-4"
class="q-mr-sm col-4" style="width: 28px; height: 28px; border-radius: 50%" />
style="width: 28px; height: 28px; border-radius: 50%"
/>
<img
v-else
:src="props.row.avatar"
class="q-mr-sm col-4"
style="width: 28px; height: 28px; border-radius: 50%"
/>
<div class="col-4"> <div class="col-4">
<div class="text-weight-medium"> <div class="text-weight-medium">
{{ props.row.fullname }} {{ props.row.fullname }}
@ -151,17 +99,13 @@
</div> </div>
</div> </div>
</div> </div>
<div <div v-else-if="col.name == 'status'" :class="props.row.status == 'checkRegister' ||
v-else-if="col.name == 'status'"
:class="
props.row.status == 'checkRegister' ||
props.row.status == 'checkPayment' || props.row.status == 'checkPayment' ||
props.row.status == 'checkSeat' || props.row.status == 'checkSeat' ||
props.row.status == 'checkPoint' props.row.status == 'checkPoint'
? 'text-blue' ? 'text-blue'
: '' : ''
" ">
>
{{ statusCandidate(props.row.status) }} {{ statusCandidate(props.row.status) }}
</div> </div>
<div v-else-if="col.name == 'registerDate'" class="table_ellipsis"> <div v-else-if="col.name == 'registerDate'" class="table_ellipsis">
@ -172,16 +116,8 @@
</div> </div>
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn <q-btn color="primary" flat dense round size="14px" icon="mdi-file-chart-outline"
color="primary" v-if="props.row.status == 'done'" @click="clickPointRow(props.row)">
flat
dense
round
size="14px"
icon="mdi-file-chart-outline"
v-if="props.row.status == 'done'"
@click="clickPointRow(props.row)"
>
<q-tooltip>ผลสอบ</q-tooltip> <q-tooltip>ผลสอบ</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>
@ -194,14 +130,7 @@
<q-card-section class="row items-center q-py-sm"> <q-card-section class="row items-center q-py-sm">
<div class="text-bold">ใบทานสอบขอม</div> <div class="text-bold">ใบทานสอบขอม</div>
<q-space /> <q-space />
<q-btn <q-btn icon="close" unelevated round dense v-close-popup style="color: #ff8080; background-color: #ffdede" />
icon="close"
unelevated
round
dense
v-close-popup
style="color: #ff8080; background-color: #ffdede"
/>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-section class="row items-center"> <q-card-section class="row items-center">
@ -253,9 +182,6 @@ const visible = ref(true); //เปิดปิด card สรุปข้อม
const dataNum = ref<DataNumObject[]>([]); // const dataNum = ref<DataNumObject[]>([]); //
const rows = ref<any>([]); const rows = ref<any>([]);
const checkProfile = ref<any>([]); const checkProfile = ref<any>([]);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
});
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([
// "check", // "check",
"no", "no",
@ -467,12 +393,26 @@ const fetchDataCom = async () => {
await fetchData(); await fetchData();
}; };
const fetchData = async () => { // paging
showLoader(); const page = ref<number>(1)
const page_size = ref<number>(5)
const total = ref<number>(0)
const maxPage = ref<number>(1)
async function changePage(pageVal: number, pageSizeVal: number, loading: boolean = false) {
page.value = await pageVal
page_size.value = await pageSizeVal
fetchData(loading)
}
const fetchData = async (loading: boolean = true) => {
loading === true ?? showLoader()
await http await http
.get(config.API.candidateOfPeriodExam(status.value, examId.value)) .get(config.API.candidateOfPeriodExam(status.value, examId.value) + `?page=${page.value}&pageSize=${page_size.value}&keyword=${filter.value}`)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
total.value = data.total
maxPage.value = Math.ceil(data.total / page_size.value)
rows.value = []; rows.value = [];
data.data.map((r: any) => { data.data.map((r: any) => {
rows.value.push({ rows.value.push({
@ -499,7 +439,7 @@ const fetchData = async () => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); loading === true ?? hideLoader();
}); });
}; };