fix: move menuList To Store
This commit is contained in:
parent
85738041cf
commit
6d6ad6ef52
4 changed files with 128 additions and 128 deletions
|
|
@ -7,6 +7,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
|
||||
import { useCounterMixin } from "./mixin";
|
||||
import type { ProfileData, DataProfile } from "@/interface/Main";
|
||||
import type { MenuMainList } from "@/modules/01_dashboard/interface/Main";
|
||||
|
||||
export const useDataStore = defineStore("dataMain", () => {
|
||||
const isLoadingMenu = ref<boolean>(false);
|
||||
|
|
@ -154,6 +155,127 @@ export const useDataStore = defineStore("dataMain", () => {
|
|||
return convertEmType(officerType.value);
|
||||
}
|
||||
|
||||
// รายการเมนูหลักของระบบ
|
||||
const menuDataMain = ref<MenuMainList[]>([
|
||||
{
|
||||
icon: "mdi-account-group-outline",
|
||||
title: "แผนผังองค์กร",
|
||||
sub: "ดูแผนผังองค์กร",
|
||||
// color: "blue-3",
|
||||
color: "grey-3",
|
||||
path: "/organization-chart",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-clipboard-account-outline",
|
||||
title: "ทะเบียนประวัติ",
|
||||
sub: "ข้อมูลทะเบียนประวัติ",
|
||||
color: "blue-4",
|
||||
path: "/registry",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-clipboard-account-outline",
|
||||
title: "ประเมินบุคคล",
|
||||
sub: "ข้อมูลการประเมินบุคคล",
|
||||
color: "lime-4",
|
||||
path: "/evaluate",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-calendar-account-outline",
|
||||
title: "การลา",
|
||||
sub: "ดู/ลงเวลา ทำเรื่องลา",
|
||||
color: "cyan-3",
|
||||
path: "/leave",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-folder-account-outline",
|
||||
title: "ผลงาน",
|
||||
sub: "ดูผลงาน",
|
||||
color: "light-green-3",
|
||||
path: "/portfolio",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-account-arrow-right-outline",
|
||||
title: "ขอโอน",
|
||||
sub: "ทำเรื่องขอโอนย้าย",
|
||||
color: "deep-purple-3",
|
||||
path: "/transfer",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-scale-balance",
|
||||
title: "อุทธรณ์/ร้องทุกข์",
|
||||
sub: "ทำเรื่องขออุทธรณ์ หรือร้องทุกข์",
|
||||
color: "green-3",
|
||||
path: "/appeal-complain",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-account-box-outline",
|
||||
title: "ผู้ขอรับการประเมิน (KPI)",
|
||||
sub: "ประเมินผลการปฏิบัติหน้าที่ราชการ",
|
||||
color: "red-2",
|
||||
path: "/KPI",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-elevator",
|
||||
title: "ผู้ประเมิน (KPI)",
|
||||
sub: "ประเมินผลการปฏิบัติหน้าที่ราชการ",
|
||||
color: "red-2",
|
||||
path: "/KPI-evaluator",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-school",
|
||||
title: "ทุนการศึกษา/ฝึกอบรม",
|
||||
sub: "รายการทุนการศึกษา/ฝึกอบรม",
|
||||
color: "teal-2",
|
||||
path: "/scholarship",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-human-handsup",
|
||||
title: "การพัฒนารายบุคคล",
|
||||
sub: "Individual Development Plan",
|
||||
color: "orange-3",
|
||||
path: "/IDP",
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
icon: "mdi-poll",
|
||||
title: "ทดลองปฏิบัติหน้าที่ราชการ",
|
||||
sub: "ผลการทดลองปฏิบัติหน้าที่ราชการและแบบสำรวจความคิดเห็น",
|
||||
color: "yellow-3",
|
||||
path: "/probation-report",
|
||||
active: false,
|
||||
},
|
||||
]);
|
||||
|
||||
// กรองเมนู ตามประเภทบุคลากร
|
||||
const menuList = computed(() => {
|
||||
const isOfficer = officerType.value === "OFFICER";
|
||||
const conditions: Record<string, boolean> = {
|
||||
ทดลองปฏิบัติหน้าที่ราชการ: isProbation.value,
|
||||
ประเมินบุคคล: isOfficer,
|
||||
ผลงาน: isOfficer,
|
||||
ขอโอน: isOfficer,
|
||||
"ผู้ขอรับการประเมิน (KPI)": isOfficer,
|
||||
"ผู้ประเมิน (KPI)": isOfficer,
|
||||
"ทุนการศึกษา/ฝึกอบรม": isOfficer,
|
||||
การพัฒนารายบุคคล: isOfficer,
|
||||
};
|
||||
|
||||
const data = menuDataMain.value.filter(
|
||||
(item: MenuMainList) => conditions[item.title] ?? true,
|
||||
);
|
||||
return data;
|
||||
});
|
||||
|
||||
return {
|
||||
count,
|
||||
doubleCount,
|
||||
|
|
@ -181,6 +303,8 @@ export const useDataStore = defineStore("dataMain", () => {
|
|||
dataprofilePosition,
|
||||
isLoadingMenu,
|
||||
isLoadingProfile,
|
||||
|
||||
menuList,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
import { ref } from "vue";
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const usePositionKeycloakStore = defineStore("positionKeycloak", () => {
|
||||
const menuData = ref<any[]>([]);
|
||||
|
||||
function findOrgName(obj: any) {
|
||||
if (obj) {
|
||||
let name =
|
||||
|
|
@ -52,5 +49,5 @@ export const usePositionKeycloakStore = defineStore("positionKeycloak", () => {
|
|||
}
|
||||
}
|
||||
|
||||
return { findOrgName, menuData };
|
||||
return { findOrgName };
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue