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"
>
-
-
-
-
- {{ props.rowIndex + 1 }}
-
-
- {{ col.value }}
-
-
-
-
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 @@
@@ -115,7 +158,19 @@ function resetFilter() {
dense
:pagination-label="paginationLabel"
v-model:pagination="pagination"
+ :rows-per-page-options="[10, 25, 50, 100]"
>
+
+
+
@@ -123,8 +178,26 @@ function resetFilter() {
-
-
+
+
+
+
+ {{
+ (currentPage - 1) * Number(pagination.rowsPerPage) +
+ props.rowIndex +
+ 1
+ }}
+
+
+ {{ col.value }}
+
+
+
diff --git a/src/modules/11_discipline/components/4_Result/MainPage.vue b/src/modules/11_discipline/components/4_Result/MainPage.vue
index 65878012f..401142559 100644
--- a/src/modules/11_discipline/components/4_Result/MainPage.vue
+++ b/src/modules/11_discipline/components/4_Result/MainPage.vue
@@ -23,7 +23,7 @@ const initialPagination = ref({
});
const page = ref(1);
-const pageSize = ref(5);
+const pageSize = ref(10);
const maxPage = ref(1);
const filter = ref("");
@@ -95,24 +95,9 @@ onMounted(async () => {
:pageSize="pageSize"
:maxPage="maxPage"
@update:queryString="updateQueryString"
+ v-model:open-edit="openEdit"
>
-
-
-
-
- {{ props.rowIndex + 1 }}
-
-
- {{ col.value }}
-
-
-
-
+
diff --git a/src/modules/11_discipline/components/4_Result/Table.vue b/src/modules/11_discipline/components/4_Result/Table.vue
index ea26fb38f..c24f237d4 100644
--- a/src/modules/11_discipline/components/4_Result/Table.vue
+++ b/src/modules/11_discipline/components/4_Result/Table.vue
@@ -21,6 +21,10 @@ const props = defineProps({
type: Function,
default: () => console.log("not function"),
},
+ openEdit: {
+ type: Function,
+ default: () => console.log("not function"),
+ },
nornmalData: {
type: Boolean,
defualt: true,
@@ -156,6 +160,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
:rows-per-page-options="[10, 25, 50, 100]"
:pagination="pagination"
@update:pagination="updateRowsPerPage"
+
>
@@ -164,8 +169,26 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
-
-
+
+
+
+
+ {{
+ (currentPage - 1) * Number(pagination.rowsPerPage) +
+ props.rowIndex +
+ 1
+ }}
+
+
+ {{ col.value }}
+
+
+
currentPage.value, () => pagination.value.rowsPerPage], () => {
direction-links
>
+
diff --git a/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue b/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue
index 14cb045cf..eb70c97a6 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue
@@ -327,7 +327,11 @@ onMounted(() => {
@click="router.push(`/discipline-suspend/${props.row.id}`)"
>
- {{ props.rowIndex + 1 }}
+ {{
+ (currentPage - 1) * Number(pagination.rowsPerPage) +
+ props.rowIndex +
+ 1
+ }}
{
@click="editPage(props.row.id)"
>
- {{ props.rowIndex + 1 }}
+ {{
+ (currentPage - 1) * Number(pagination.rowsPerPage) +
+ props.rowIndex +
+ 1
+ }}
{{ col.value }}