แสดงรายการ

This commit is contained in:
setthawutttty 2025-05-01 17:06:06 +07:00
parent e12da05ffe
commit 45fdb9c8b8
2 changed files with 5 additions and 1 deletions

View file

@ -35,7 +35,7 @@ const filter = ref<string>("");
const maxPage = ref<number>(1);
const page = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0)
/** function เรียกข้อมูลการลา*/
async function fetchDataTable() {
showLoader();
@ -53,6 +53,7 @@ async function fetchDataTable() {
const data = res.data.result.data;
LeaveData.fetchListLeave(data);
maxPage.value = Math.ceil(res.data.result.total / pageSize.value);
total.value = res.data.result.total;
})
.catch((err) => {
messageError($q, err);
@ -187,6 +188,7 @@ onMounted(async () => {
:maxPage="maxPage"
:pageSize="pageSize"
:leaveType="leaveType"
:total="total"
>
<template #columns="props">
<q-tr :props="props" class="cursor-pointer">

View file

@ -14,6 +14,7 @@ const props = defineProps({
count: Number,
pass: Number,
notpass: Number,
total: Number,
name: String,
icon: String,
@ -252,6 +253,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ props.total }} รายการ
<q-pagination
v-model="currentPage"
active-color="primary"