import Layout from "@/layout";

const HomeRoutes = {
  path: "/",
  component: Layout,
  redirect: "/dashboard",
  children: [
    {
      path: "dashboard",
      name: "Dashboard",
      redirect: "/homeOut",
      component: {
        render: () => h(resolveComponent("router-view")),
      },
      //using el svg icon, the elSvgIcon first when at the same time using elSvgIcon and icon
      meta: {
        title: "决策管理驾驶舱",
        elSvgIcon: "Histogram",
        roles: ["decision_management_cockpit_menu"],
      },
      children: [
        {
          path: "/homein",
          name: "Homein",
          component: () => import("@/views/dashboard/index.vue"),
          meta: { title: "国内进港", roles: ["domestic_arrival_page"] },
        },
        {
          path: "/homeOut",
          name: "HomeOut",
          component: () => import("@/views/dashboard/indexHomeOut.vue"),
          meta: {
            title: "国内出港",
            roles: ["domestic_departure_page"],
          },
        },
        {
          path: "/indexIn",
          name: "IndexIn",
          component: () => import("@/views/dashboard/indexIn.vue"),
          meta: { title: "国际进港", roles: ["international_arrival_page"] },
        },
        {
          path: "/indexOut",
          name: "IndexOut",
          component: () => import("@/views/dashboard/indexOut.vue"),
          meta: { title: "国际出港", roles: ["international_departure_page"] },
        },
      ],
    },
  ],
};

// const DemoRoutes = {
//   path: '/example',
//   component: Layout,
//   redirect: '/example/table',
//   name: 'Example',
//   meta: { title: 'Example', icon: 'example' },
//   children: [
//     {
//       path: 'table',
//       name: 'Table',
//       component: () => import('@/views/table/index.vue'),
//       meta: { title: 'Table', icon: 'table' }
//     },
//     {
//       path: 'tree',
//       name: 'Tree',
//       component: () => import('@/views/tree/index.vue'),
//       meta: { title: 'Tree', icon: 'tree' }
//     },
//     {
//       path: 'worker-Demo',
//       name: 'WorkerDemo',
//       component: () => import('@/views/example/worker'),
//       meta: { title: 'Worker Demo', icon: 'nested' }
//     }
//   ]
// }

export default [HomeRoutes];
