export const constantRoute: any = [
  {
    path: "/home",
    name: "首页",
    component: () => import("@/views/home/index.vue"),
    title: "home",
    icon: "icon-shouye1",
  },
  {
    path: "/screen",
    name: "数据大屏",
    component: () => import("@/views/screen/index.vue"),
    title: "screen",
    icon: "icon-shujudaping2",
  },
  {
    title: "userManagement",
    name: "系统管理",
    path: "/userManagement",
    icon: "icon-quanxianguanli",
    children: [
      {
        title: "bgManagement",
        name: "用户管理",
        path: "/userManagement/bgManagement",
        icon: "icon-yonghuguanli",
        component: () => import("@/views/userManagement/bgManagement/index.vue"),
      },
      {
        title: "role",
        name: "角色管理",
        path: "/userManagement/role",
        icon: "icon-jiaoseguanli2",
        component: () => import("@/views/userManagement/role/index.vue"),
      },
      {
        title: "permission",
        name: "菜单管理",
        path: "/userManagement/permission",
        icon: "icon-caidanguanli2",
        component: () => import("@/views/userManagement/permission/index.vue"),
      },
      {
        title: "log",
        name: "日志管理",
        path: "/userManagement/log",
        icon: "icon-caidanguanli2",
        component: () => import("@/views/userManagement/log/index.vue"),
      }
    ],
  },
  {
    title: "product",
    name: "菜谱管理",
    path: "/product",
    icon: "icon-shangpinguanli3",
    children: [
      {
        title: "food",
        name: "食材管理",
        path: "/product/food",
        icon: "icon-shuxingguanli2",
        component: () => import("@/views/product/food/index.vue"),
      },
      {
        title: "dishes",
        name: "菜品管理",
        path: "/product/dishes",
        icon: "icon-shuxingguanli2",
        component: () => import("@/views/product/dishes/index.vue"),
      },
      {
        title: "trademark",
        name: "菜单",
        path: "/product/trademark",
        icon: "icon-pinpaiguanli2",
        component: () => import("@/views/product/trademark/index.vue"),
      },
    ],
  },
  {
    title: "foodprocurement",
    name: "食品采购管理",
    path: "/foodprocurement",
    icon: "icon-shangpinguanli3",
    children: [
      {
        title: "directory",
        name: "采购名录",
        path: "/foodprocurement/directory",
        icon: "icon-shuxingguanli2",
        component: () => import("@/views/foodprocurement/directory/index.vue"),
      },
      {
        title: "plan",
        name: "采购计划",
        path: "/foodprocurement/plan",
        icon: "icon-shuxingguanli2",
        component: () => import("@/views/foodprocurement/plan/index.vue"),
      },
      {
        title: "orders",
        name: "采购订单",
        path: "/foodprocurement/orders",
        icon: "icon-shuxingguanli2",
        component: () => import("@/views/foodprocurement/orders/index.vue"),
      },
      {
        title: "inventory",
        name: "库存管理",
        path: "/foodprocurement/inventory",
        icon: "icon-shuxingguanli2",
        component: () => import("@/views/foodprocurement/inventory/index.vue"),
      },
      {
        title: "dataStatistics",
        name: "采购数据统计",
        path: "/foodprocurement/dataStatistics",
        icon: "icon-shuxingguanli2",
        component: () => import("@/views/foodprocurement/dataStatistics/index.vue"),
      }
    ],
  },
  {
    path: "/foodSampleManagement",
    name: "食品留样管理",
    component: () => import("@/views/foodSampleManagement/index.vue"),
    title: "foodSampleManagement",
    icon: "icon-shujudaping2",
  },
  {
    path: "/workAccounts",
    name: "工作台账管理",
    component: () => import("@/views/workAccounts/index.vue"),
    title: "workAccounts",
    icon: "icon-shujudaping2",
  },
  {
    path: "/smart",
    name: "智能分析统计",
    component: () => import("@/views/smart/index.vue"),
    title: "smart",
    icon: "icon-shujudaping2",
  },
  {
    path: "/foodAafetyEducation",
    name: "食安教育",
    component: () => import("@/views/foodAafetyEducation/index.vue"),
    title: "foodAafetyEducation",
    icon: "icon-shujudaping2",
  },
  {
    path: "/hardwareData",
    name: "硬件数据集成",
    component: () => import("@/views/hardwareData/index.vue"),
    title: "hardwareData",
    icon: "icon-shujudaping2",
  },
  {
    path: "/earlyWarning",
    name: "智能预警中心",
    component: () => import("@/views/earlyWarning/index.vue"),
    title: "earlyWarning",
    icon: "icon-shujudaping2",
  }
];

export const errorRoute: any = [
  {
    path: "/login",
    name: "登录",
    component: () => import("@/views/login/login.vue"),
    title: "login",
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/components/errorMessage/404.vue"),
    title: "404",
  },
  {
    path: "/",
    name: "",
    title: "",
    component: () => import("@/components/layout/index.vue"),
    children: constantRoute,
  },
  {
    path: "/500",
    name: "500",
    title: "500",
    component: () => import("@/components/errorMessage/500.vue"),
  },
  {
    path: "/:pathMatch(.*)*",
    redirect: "/404",
    component: () => import("@/components/errorMessage/404.vue"),
  },
];
