hrms-user/src/modules/14_IDP/store.ts
2024-10-04 16:17:55 +07:00

29 lines
975 B
TypeScript

import { defineStore } from "pinia";
import { ref } from "vue";
import type { DataOption } from "@/modules/10_registry/interface/index/Main";
export const useIndividualDevelopmentPlan = defineStore(
"individualDevelopmentPlan",
() => {
const optionStatus = ref<DataOption[]>([
{ id: "ALL", name: "ทั้งหมด" },
{ id: "PENDING", name: "รอดำเนินการ" },
{ id: "COMPLETE", name: "ดำเนินการแก้ไขแล้ว" },
{ id: "REJECT", name: "ไม่อนุมัตการแก้ไข" },
]);
function convertStatus(val: string) {
switch (val) {
case "PENDING":
return "รอดำเนินการ";
case "APPROVE":
return "อนุมัติ";
case "REJECT":
return "ไม่อนุมัติ";
default:
return "-";
}
}
return { convertStatus, optionStatus };
}
);