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 @@