hrms-user/src/modules/14_IDP/store.ts

30 lines
1 KiB
TypeScript
Raw Normal View History

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: "", name: "ทั้งหมด" },
{ id: "PENDING", name: "รอดำเนินการ" },
{ id: "COMPLETE", name: "ดำเนินการแก้ไขแล้ว" },
{ id: "REJECT", name: "ไม่อนุมัตการแก้ไข" },
]);
function convertStatus(val: string) {
switch (val) {
case "PENDING":
return "รอดำเนินการ";
case "COMPLETE":
return "ดำเนินการแก้ไขแล้ว";
case "REJECT":
return "ไม่อนุมัตการแก้ไข";
default:
return "-";
}
}
return { convertStatus, optionStatus };
}
);