From c0e9fb6a0f2b5613f48b97311731e3b1d35e97ee Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 18 Dec 2023 09:46:33 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=81=E0=B8=AA?= =?UTF-8?q?=E0=B8=94=E0=B8=87=20=E0=B8=A5=E0=B8=B3=E0=B8=94=E0=B8=B1?= =?UTF-8?q?=E0=B8=9A=20=E0=B8=A7=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/TableComplaint.vue | 6 +- .../2_InvestigateFacts/MainPage.vue | 6 +- .../3_InvestigateDisciplinary/MainPage.vue | 40 ++++---- .../3_InvestigateDisciplinary/Table.vue | 91 +++++++++++++++++-- .../components/4_Result/MainPage.vue | 21 +---- .../components/4_Result/Table.vue | 28 +++++- .../components/7_ListSuspend/ListsPage.vue | 6 +- .../components/8_AppealComplain/MainPage.vue | 6 +- 8 files changed, 147 insertions(+), 57 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue b/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue index 065d88597..df45db5c6 100644 --- a/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue +++ b/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue @@ -206,7 +206,11 @@ onMounted(() => { @click="OpenEdit(props.row.id)" >
- {{ props.rowIndex + 1 }} + {{ + (currentPage - 1) * Number(pagination.rowsPerPage) + + props.rowIndex + + 1 + }}
{{ col.value }} diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue index 181e1d09c..e59ee3bb8 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue @@ -200,7 +200,11 @@ onMounted(async () => { @click="editPage(props.row.id)" >
- {{ props.rowIndex + 1 }} + {{ + (currentPage - 1) * Number(pagination.rowsPerPage) + + props.rowIndex + + 1 + }}
{{ col.value }} diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue index 8f3671118..7307c6367 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue @@ -16,28 +16,26 @@ const mixin = useCounterMixin(); const dataInvestigateDis = useInvestigateDisStore(); const { showLoader, hideLoader } = mixin; const { fetchList } = dataInvestigateDis; - +const rowsPerPage = ref(10); const $q = useQuasar(); // show dialog const router = useRouter(); const filter = ref(""); //search data table const page = ref(1); const maxPage = ref(1); -const initialPagination = ref({ - rowsPerPage: 10, -}); + async function fetchListDisciplinary() { showLoader(); await http .get( config.API.disciplineDisciplinary() + - `?page=${page.value}&pageSize=${initialPagination.value.rowsPerPage}` + `?page=${page.value}&pageSize=${rowsPerPage.value}` ) .then((res) => { const data = res.data.result.data; maxPage.value = Math.ceil( - res.data.result.total / initialPagination.value.rowsPerPage + res.data.result.total / rowsPerPage.value ); fetchList(data); }) @@ -58,6 +56,12 @@ function openEdit(id: string) { router.push(`/discipline/disciplinary/${id}`); } +async function updatePagingProp(rowPerpage: number, pageCurrent: number) { + rowsPerPage.value = rowPerpage; + page.value = pageCurrent; + await fetchListDisciplinary(); +} + /**เมื่อเริ่มโหลดหน้า * ส่งข้อมูลจำลองไปยัง store */ @@ -80,28 +84,16 @@ onMounted(async () => { :visible-columns="dataInvestigateDis.visibleColumns" v-model:inputfilter="filter" v-model:inputvisible="dataInvestigateDis.visibleColumns" - :pagination="initialPagination" + :pagination="rowsPerPage" :nornmalData="true" :paging="true" :titleText="''" + :rowsPerPage="rowsPerPage" + :page="page" + :maxPage="maxPage" + @update:pagination="updatePagingProp" + v-model:open-edit="openEdit" > -
diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue index 70ed1bcd2..54a2ee914 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue @@ -1,17 +1,12 @@