fix: move menuList To Store

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-01-30 16:03:09 +07:00
parent 85738041cf
commit 6d6ad6ef52
4 changed files with 128 additions and 128 deletions

View file

@ -30,125 +30,6 @@ const inboxList = ref<InboxDetail[]>([]); // รายการกล่อง
const idInboxActive = ref<string>(); // Id
const isLoadingInbox = ref<boolean>(true); //
//
const filteredItems = computed(() => {
const isOfficer = dataStore.officerType === "OFFICER";
const conditions: Record<string, boolean> = {
ทดลองปฏหนาทราชการ: dataStore.isProbation,
ประเมนบคคล: isOfficer,
ผลงาน: isOfficer,
ขอโอน: isOfficer,
"ผู้ขอรับการประเมิน (KPI)": isOfficer,
"ผู้ประเมิน (KPI)": isOfficer,
"ทุนการศึกษา/ฝึกอบรม": isOfficer,
การพฒนารายบคคล: isOfficer,
};
const data = items.value.filter((item) => conditions[item.title] ?? true);
positionKeycloakStore.menuData = data;
return data;
});
const items = 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,
},
]);
/**
* งกนดงขอมลกลองขอความ
* @param index หนาทโหลดขอม
@ -296,7 +177,7 @@ onMounted(async () => {
<div class="row justify-start q-col-gutter-md">
<div
class="col-xs-6 col-sm-4 col-md-4 col-lg-3 col-xl-2 row"
v-for="(item, j) in filteredItems"
v-for="(item, j) in dataStore.menuList"
:key="j"
>
<q-card v-if="dataStore.isLoadingMenu" bordered class="col-12">