แสดงรายการ
This commit is contained in:
parent
e12da05ffe
commit
45fdb9c8b8
2 changed files with 5 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ const filter = ref<string>("");
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
const page = ref<number>(1);
|
const page = ref<number>(1);
|
||||||
const pageSize = ref<number>(10);
|
const pageSize = ref<number>(10);
|
||||||
|
const total = ref<number>(0)
|
||||||
/** function เรียกข้อมูลการลา*/
|
/** function เรียกข้อมูลการลา*/
|
||||||
async function fetchDataTable() {
|
async function fetchDataTable() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -53,6 +53,7 @@ async function fetchDataTable() {
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
LeaveData.fetchListLeave(data);
|
LeaveData.fetchListLeave(data);
|
||||||
maxPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
maxPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
||||||
|
total.value = res.data.result.total;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -187,6 +188,7 @@ onMounted(async () => {
|
||||||
:maxPage="maxPage"
|
:maxPage="maxPage"
|
||||||
:pageSize="pageSize"
|
:pageSize="pageSize"
|
||||||
:leaveType="leaveType"
|
:leaveType="leaveType"
|
||||||
|
:total="total"
|
||||||
>
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ const props = defineProps({
|
||||||
count: Number,
|
count: Number,
|
||||||
pass: Number,
|
pass: Number,
|
||||||
notpass: Number,
|
notpass: Number,
|
||||||
|
total: Number,
|
||||||
|
|
||||||
name: String,
|
name: String,
|
||||||
icon: String,
|
icon: String,
|
||||||
|
|
@ -252,6 +253,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
ทั้งหมด {{ props.total }} รายการ
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="currentPage"
|
v-model="currentPage"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue