From 9ed15251f96468b3a95cc3d2e60a5726db9ee9af Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Wed, 22 Nov 2023 11:40:21 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=20max-page=20//=20page=20api=20=E0=B8=82=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *api ยังไม่ได้ส่ง total มาเลยคำนวน max-page ไม่ได้เลย setค่าไว้ 5 เพื่อรอ api --- src/components/TableHistory.vue | 34 +++++++++++++++++++++++---------- src/views/HistoryView.vue | 17 +++++++++++++---- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/components/TableHistory.vue b/src/components/TableHistory.vue index 95d0c05..2d0e8a6 100644 --- a/src/components/TableHistory.vue +++ b/src/components/TableHistory.vue @@ -9,6 +9,7 @@ import { useChekIn } from '@/stores/chekin' import Popup from '@/components/PopUp.vue' const stores = useChekIn() +const selected = ref([]) /** props from page */ const props = defineProps({ @@ -16,6 +17,10 @@ const props = defineProps({ type: Boolean, defualt: false, }, + selected: { + type: Array, + defualt: [], + }, pageSize: { type: Number, defualt: 10, @@ -84,7 +89,7 @@ const initialPagination = ref({ sortBy: null, descending: false, page: 1, - rowsPerPage: props.pageSize, + rowsPerPage: 1, }) // Pagination - update rowsPerPage @@ -157,7 +162,7 @@ const columns = ref([ field: 'checkOutStatus', headerStyle: 'font-size: 14px', style: 'font-size: 14px; width:15%;', - } + }, ]) // popup const modalPopup = ref(false) @@ -187,11 +192,6 @@ function classStatus(status: string) { } } -const pagination = ref({ - page: 1, - rowsPerPage: 2, -}) - const checkRequestEdit = (checkInStatus: string, checkOutStatus: string) => { if ( checkInStatus === 'ขาด' || @@ -212,10 +212,11 @@ const checkRequestEdit = (checkInStatus: string, checkOutStatus: string) => { :columns="columns" :rows="stores.rows" virtual-scroll + v-model:selected="selected" :virtual-scroll-sticky-size-start="48" :style="$q.screen.gt.xs ? 'max-height: 64vh' : ''" :grid="$q.screen.gt.xs ? false : true" - v-model:pagination="pagination" + :pagination="initialPagination" @update:pagination="updatePagination" > -