2024-04-04 14:14:25 +07:00
|
|
|
import { defineStore } from "pinia";
|
2024-04-09 15:22:23 +07:00
|
|
|
import { ref } from "vue";
|
2024-04-22 18:14:48 +07:00
|
|
|
import type { DataOptions } from "./interface/index/Main";
|
2024-04-04 14:14:25 +07:00
|
|
|
|
|
|
|
|
export const useKpiDataStore = defineStore("KPIDate", () => {
|
2024-04-09 15:22:23 +07:00
|
|
|
const tabMain = ref<string>("1");
|
2024-04-22 17:26:12 +07:00
|
|
|
const dataProfile = ref<any>();
|
|
|
|
|
const dataEvaluation = ref<any>();
|
2024-04-22 18:14:48 +07:00
|
|
|
const competencyType = ref<DataOptions[]>([
|
|
|
|
|
{
|
|
|
|
|
id: "HEAD",
|
|
|
|
|
name: "สมรรถนะหลัก",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "GROUP",
|
|
|
|
|
name: "สมรรถนะประจำกลุ่มงาน",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "EXECUTIVE",
|
|
|
|
|
name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "DIRECTOR",
|
|
|
|
|
name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "INSPECTOR",
|
|
|
|
|
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
|
|
|
|
|
},
|
|
|
|
|
]);
|
2024-04-22 17:26:12 +07:00
|
|
|
|
2024-04-22 18:14:48 +07:00
|
|
|
function convertCompetencyType(val: string) {
|
|
|
|
|
const competency = competencyType.value.find(
|
|
|
|
|
(x: DataOptions) => x.id == "val"
|
|
|
|
|
);
|
|
|
|
|
return competency?.name;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-22 18:11:24 +07:00
|
|
|
function convertStatus(val: string) {
|
|
|
|
|
switch (val) {
|
|
|
|
|
case "PENDING":
|
|
|
|
|
return "รอดำเนินการ";
|
|
|
|
|
case "INPROGRESS":
|
|
|
|
|
return "กําลังดำเนินการ";
|
|
|
|
|
case "DONE":
|
|
|
|
|
return "ประเมินเสร็จสิ้น";
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertResults(val: string) {
|
|
|
|
|
switch (val) {
|
|
|
|
|
case "PENDING":
|
|
|
|
|
return "รอดำเนินการ";
|
|
|
|
|
case "PASSED":
|
|
|
|
|
return "ผ่านการประเมิน";
|
|
|
|
|
case "NOTPASSED":
|
|
|
|
|
return "ไม่ผ่านการประเมิน";
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-22 18:14:48 +07:00
|
|
|
return {
|
|
|
|
|
tabMain,
|
|
|
|
|
dataProfile,
|
|
|
|
|
dataEvaluation,
|
|
|
|
|
competencyType,
|
|
|
|
|
convertCompetencyType,
|
2024-04-22 18:11:24 +07:00
|
|
|
convertStatus,
|
|
|
|
|
convertResults,
|
2024-04-22 18:14:48 +07:00
|
|
|
};
|
2024-04-04 14:14:25 +07:00
|
|
|
});
|