โครงสร้าง => refactor code

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-25 11:06:43 +07:00
parent 007df38109
commit 1412ea630b
13 changed files with 369 additions and 408 deletions

View file

@ -1,13 +1,13 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type {
ListMenu,
ChildLevelTree,
ChildConfig,
} from "@/interface/response/main";
/**
* importType
*/
import type { ListMenu, ChildLevelTree } from "@/interface/response/main";
export const useMenuDataStore = defineStore("menuUse", () => {
/** รายการเมนู*/
const menuList = ref<ListMenu[]>([
{
id: "dashboard",
@ -21,6 +21,7 @@ export const useMenuDataStore = defineStore("menuUse", () => {
},
]);
/** ข้อมูล Level3*/
const childLevelTree = ref<ChildLevelTree>({
SYS_EVA_INDICATOR: [
{
@ -90,6 +91,10 @@ export const useMenuDataStore = defineStore("menuUse", () => {
],
});
/**
* function
* @param data
*/
function fetchListMenu(data: ListMenu[]) {
data.forEach((item) => {
if (item.children && item.children.length !== 0) {