ปรับ paging ทะเบียนประวัติ และตำแหน่งของทะเบียนประวัติใหม่

This commit is contained in:
Warunee Tamkoo 2024-04-03 16:26:02 +07:00
parent 1958d4db7d
commit 93c4fb9139
3 changed files with 33 additions and 32 deletions

View file

@ -14,8 +14,8 @@
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
<template v-slot:pagination="scope">
งหมด {{ props.total }} รายการ
<template v-slot:pagination="scope">
งหมด {{ props.total }} รายการ
<q-pagination
v-model="currentPage"
active-color="primary"
@ -24,7 +24,8 @@
size="sm"
boundary-links
direction-links
></q-pagination>
:max-pages="5"
></q-pagination>
</template>
<template v-slot:top="props">
@ -450,7 +451,7 @@
<PopupADdEmployee v-model:modal="modalEmployee" />
</template>
<script setup lang="ts">
import { ref, useAttrs, reactive,watch } from "vue";
import { ref, useAttrs, reactive, watch } from "vue";
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
import type { DataOption } from "@/modules/04_registry/components/profileType";
import PopupHistory from "./PopupHistory.vue";
@ -461,7 +462,6 @@ const maxPage = ref<number>(1);
const page = ref<number>(1);
const rowsPerPage = ref<number>(50);
const attrs = ref<any>(useAttrs());
const table = ref<any>(null);
const filterRef = ref<any>(null);
@ -470,7 +470,7 @@ const searchPanel = ref<boolean>(true);
/**
*pagination ของตาราง
*/
const pagination = ref({
const pagination = ref({
descending: false,
page: page.value,
rowsPerPage: rowsPerPage.value,
@ -681,11 +681,14 @@ watch(
}
);
watch(()=>props.page,()=>{
if(props.page){
currentPage.value = props.page
watch(
() => props.page,
() => {
if (props.page) {
currentPage.value = props.page;
}
}
})
);
</script>
<style lang="scss">
.icon-color {