ปรับ table ลงเวลา

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-20 16:57:32 +07:00
parent 9e3fb8bff7
commit 7d23bdc945
11 changed files with 309 additions and 267 deletions

View file

@ -1,15 +1,19 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { DataOption } from "@/modules/09_leave/interface/index/Main"
import type { TableRows } from "@/modules/09_leave/interface/response/work"
const mixin = useCounterMixin();
const { date2Thai } = mixin;
export const useWorklistDataStore = defineStore("work", () => {
// ข้อมูลในตาราง
const rows = ref<any>([])
const dataMain = ref<any>([])
function fetchList(data: any) {
let datalist = data.map((e: any) => ({
const rows = ref<TableRows[]>([])
const columns = ref<QTableProps["columns"]>([]);
const visibleColumns = ref<string[]>([]);
const dataMain = ref<TableRows[]>([])
function fetchList(data: TableRows[]) {
let datalist = data.map((e: TableRows) => ({
fullName: e.fullName,
timeIn: e.timeIn,
coordinatesIn: e.coordinatesIn,
@ -58,7 +62,7 @@ export const useWorklistDataStore = defineStore("work", () => {
}
}
}
function filterFn(val: string, update: any) {
function filterFn(val: string, update: Function) {
if (val == "") {
update(() => {
optionStatus.value = optionStatusMain.value;
@ -86,6 +90,8 @@ export const useWorklistDataStore = defineStore("work", () => {
return {
//ข้อมูลในตาราง
rows,
columns,
visibleColumns,
fetchList,
//ค้นหาข้อมูล
filterTable,