function layerDashboards()

in src/router/layer.ts [22:85]


function layerDashboards() {
  const appStore = useAppStoreWithOut();
  const routes = appStore.allMenus.map((item: MenuOptions) => {
    const route: any = {
      path: "",
      name: item.name,
      component: Layout,
      meta: {
        icon: item.icon || "cloud_queue",
        title: item.title,
        hasGroup: item.hasGroup,
        activate: item.activate,
        descKey: item.descKey,
        i18nKey: item.i18nKey,
      },
      children: item.subItems && item.subItems.length ? [] : undefined,
    };
    for (const child of item.subItems || []) {
      const d = {
        name: child.name,
        path: child.path,
        meta: {
          title: child.title,
          layer: child.layer,
          icon: child.icon || "cloud_queue",
          activate: child.activate,
          descKey: child.descKey,
          i18nKey: child.i18nKey,
        },
        component: Layer,
      };
      route.children.push(d);
      const tab = {
        name: `${child.name}ActiveTabIndex`,
        path: `/${child.path}/tab/:activeTabIndex`,
        component: Layer,
        meta: {
          notShow: true,
          layer: child.layer,
        },
      };
      route.children.push(tab);
    }
    if (!item.hasGroup) {
      route.children = [
        {
          name: item.name,
          path: item.path,
          meta: {
            title: item.title,
            layer: item.layer,
            icon: item.icon,
            activate: item.activate,
            descKey: item.descKey,
            i18nKey: item.i18nKey,
          },
          component: Layer,
        },
      ];
    }
    return route;
  });
  return routes;
}