hrms-mgt/src/modules/09_leave/stores/WorkStore.ts

59 lines
1.4 KiB
TypeScript
Raw Normal View History

2023-10-06 13:32:54 +07:00
import { defineStore } from "pinia";
import { ref } from "vue";
/** import Type */
2023-10-20 16:57:32 +07:00
import type { QTableProps } from "quasar";
2023-10-06 13:32:54 +07:00
export const useWorklistDataStore = defineStore("work", () => {
/** ข้อมูล Table */
const columns = ref<QTableProps["columns"]>([]);
const visibleColumns = ref<string[]>([]);
2023-10-06 13:32:54 +07:00
/** ค้นหาวัน ข้อมูล Table */
const selectDate = ref<Date | null>(new Date());
// function filterFn(val: string, update: Function) {
// if (val == "") {
// update(() => {
// optionStatus.value = optionStatusMain.value;
// });
// } else {
// update(() => {
// optionStatus.value = optionStatusMain.value.filter(
// (e: any) => e.name.search(val) !== -1
// );
// });
// }
// }
2023-10-09 09:31:01 +07:00
// convertSatatus
/**
* function
* @param val
*/
function convertSatatus(val: string) {
switch (val) {
case "NORMAL ":
return "ปกติ";
case "LATE":
return "สาย";
case "ABSENT":
return "ขาดราชการ";
2023-10-06 13:32:54 +07:00
}
}
return {
//ข้อมูลในตาราง
columns,
visibleColumns,
// fetchListLog,
// fetchListTime,
//ค้นหาข้อมูล
selectDate,
// filterFn,
convertSatatus,
};
});