แก้ไข paginationApi รายการลงเวลาพิเศษ
This commit is contained in:
parent
e635a3be33
commit
2e904a95b8
4 changed files with 78 additions and 61 deletions
|
|
@ -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,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue