hrms-mgt/src/modules/09_leave/stores/SpecialTimeStore.ts
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 fb3902edce fix(leave):sort
2025-10-08 10:37:36 +07:00

33 lines
925 B
TypeScript

import { defineStore } from "pinia";
import { ref } from "vue";
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
const optionStatus = ref<DataOption[]>([
{ id: "NORMAL", name: "ปกติ" },
{ id: "LATE", name: "สาย" },
{ id: "ABSENT", name: "ขาดราชการ" },
{ id: "NOT_COMPLETE", name: "ปฏิบัติงานไม่ครบตามกำหนดเวลา" },
]);
// convertSatatus
function convertStatus(val: string) {
const value = val ? val.toUpperCase() : null;
switch (value) {
case "NORMAL":
return "ปกติ";
case "LATE":
return "สาย";
case "ABSENT":
return "ขาดราชการ";
default:
value;
}
}
return {
optionStatus,
convertStatus,
};
});