โครงสร้าง => refactor code
This commit is contained in:
parent
007df38109
commit
1412ea630b
13 changed files with 369 additions and 408 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue