พัฒนาบุคคล => แสดงรายการทั้งหมด

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-26 10:21:36 +07:00
parent 6eebb6c255
commit 9a8f414092
4 changed files with 70 additions and 31 deletions

View file

@ -98,7 +98,8 @@ const formQuery = reactive<FormQueryListProject>({
node: null,
nodeId: null,
});
const totalList = ref<number>(1); //
const totalList = ref<number>(0); //
const totalPage = ref<number>(1);
/** funciton fetch รายการโครงการ*/
function fetchListProject() {
@ -110,7 +111,8 @@ function fetchListProject() {
)
.then((res) => {
const data = res.data.result.data;
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
totalPage.value = Math.ceil(res.data.result.total / formQuery.pageSize);
totalList.value = res.data.result.total;
rows.value = data;
})
.catch((err) => {
@ -499,11 +501,12 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ totalList }} รายการ
<q-pagination
v-model="formQuery.page"
active-color="primary"
color="dark"
:max="Number(totalList)"
:max="Number(totalPage)"
size="sm"
boundary-links
direction-links