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

34 lines
925 B
TypeScript
Raw Normal View History

import { defineStore } from "pinia";
2024-09-18 17:26:53 +07:00
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: "ปฏิบัติงานไม่ครบตามกำหนดเวลา" },
]);
2023-11-03 12:43:50 +07:00
// 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,
};
});