From 5d05c19c50162dd7992b5b86a1d667fd21a7089c Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 26 Apr 2024 17:50:42 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=A5=E0=B8=B2=20=3D>=20=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B8=9A=20paging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/09_leave/components/2_Leave/Tab1.vue | 3 +++ src/modules/09_leave/components/2_Leave/Tab2.vue | 3 +++ src/modules/09_leave/components/2_Leave/TableList.vue | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/src/modules/09_leave/components/2_Leave/Tab1.vue b/src/modules/09_leave/components/2_Leave/Tab1.vue index 5a42d3f3d..9723b991e 100644 --- a/src/modules/09_leave/components/2_Leave/Tab1.vue +++ b/src/modules/09_leave/components/2_Leave/Tab1.vue @@ -33,6 +33,7 @@ const querySting = reactive({ keyword: leaveStore.filter.keyword, //keyword ค้นหา }); const maxPage = ref(1); +const totalList = ref(0); //** เรียกข้อมูลจาก API*/ async function fecthLeaveList() { @@ -50,6 +51,7 @@ async function fecthLeaveList() { .then((res) => { const data = res.data.result; maxPage.value = Math.ceil(data.total / querySting.pageSize); + totalList.value = data.total; leaveStore.fetchListLeave(data.data); /** ส่งข้อมูลไป stores*/ }) .catch((err) => { @@ -143,6 +145,7 @@ watch( :page="querySting.page" :rowsPerPage="querySting.pageSize" :maxPage="maxPage" + :totalList="totalList" @update:querySting="updatePaging" /> diff --git a/src/modules/09_leave/components/2_Leave/Tab2.vue b/src/modules/09_leave/components/2_Leave/Tab2.vue index 4ac1621ac..722afc7b2 100644 --- a/src/modules/09_leave/components/2_Leave/Tab2.vue +++ b/src/modules/09_leave/components/2_Leave/Tab2.vue @@ -33,6 +33,7 @@ const querySting = reactive({ keyword: leaveStore.filter.keyword, //keyword ค้นหา }); const maxPage = ref(1); +const totalList = ref(0); //** เรียกข้อมูลจาก API*/ async function fecthLeaveList() { @@ -50,6 +51,7 @@ async function fecthLeaveList() { .then((res) => { const data = res.data.result; maxPage.value = Math.ceil(data.total / querySting.pageSize); + totalList.value = data.tatol; fetchListLeaveReject(data.data); /** ส่งข้อมูลไป stores*/ }) .catch((err) => { @@ -96,6 +98,7 @@ onMounted(async () => { :page="querySting.page" :rowsPerPage="querySting.pageSize" :maxPage="maxPage" + :totalList="totalList" @update:querySting="updatePaging" /> diff --git a/src/modules/09_leave/components/2_Leave/TableList.vue b/src/modules/09_leave/components/2_Leave/TableList.vue index caf17aea7..7a20ae936 100644 --- a/src/modules/09_leave/components/2_Leave/TableList.vue +++ b/src/modules/09_leave/components/2_Leave/TableList.vue @@ -202,6 +202,10 @@ const props = defineProps({ type: Number, require: true, }, + totalList: { + type: Number, + require: true, + }, }); const emit = defineEmits(["update:querySting"]); @@ -291,6 +295,7 @@ onMounted(() => {