แก้ไข paginationApi รายการลงเวลาพิเศษ

This commit is contained in:
AnandaTon 2023-11-30 17:11:03 +07:00
parent e635a3be33
commit 2e904a95b8
4 changed files with 78 additions and 61 deletions

View file

@ -2,12 +2,14 @@ import { defineStore } from "pinia";
import { ref, watch, defineEmits } from "vue";
import type { QTableProps } from "quasar";
import type { DataRows } from "@/modules/09_leave/interface/response/specialTime";
import type { ListData } from "@/modules/09_leave/interface/request/specialTime";
import type { DataDateMonthObject } from "@/modules/09_leave/interface/request/specialTime";
import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
import { mount } from "@vue/test-utils";
const $q = useQuasar();
const mixin = useCounterMixin();
@ -45,32 +47,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
const pageSize = ref<number>(10);
const filter = ref<string>(""); //search data table
const maxPage = ref<number>(0);
// Pagination - update rowsPerPage
// async function updatePagination(newPagination: any) {
// initialPagination.value = newPagination;
// // currentPage.value = 1;
// console.log("updatePagination");
// }
// Pagination - initial pagination
const initialPagination = ref<any>({
sortBy: null,
descending: false,
page: 1,
// rowsPerPage: pageSize,
});
/**
* api
* @param pageVal page
* @param pageSizeVal pagesize
*/
async function changePage(pageVal: number, pageSizeVal: number) {
page.value = await pageVal;
pageSize.value = await pageSizeVal;
console.log("changePage");
fetchData();
}
/**
*
@ -126,6 +102,19 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
});
};
/**
* api
* @param pageVal page
* @param pageSizeVal pagesize
*/
async function changePage(pageVal: number, pageSizeVal: number) {
page.value = await pageVal;
pageSize.value = await pageSizeVal;
console.log(pageSize.value);
fetchData();
}
//--------------|ฟิลเตอร์|--------------------------------------//
const searchFilterTable = async (searchDate: any) => {
rows.value = [];
@ -268,5 +257,7 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
page,
pageSize,
month,
filter,
// changeMonth,
};
});