import Vue from "vue";
import Router from "vue-router";

import routerBefore from "@/config/routerBefore.js";
// 主要
// import main from '@/components/main.vue'
// 页面示例
// import mypage from '../components/myPage.vue'
Vue.use(Router);
const constantRouterMap = [
  {
    path: "/",
    name: "main",
    component: (resolve) => require(["@/components/main.vue"], resolve),
    redirect: {
      name: "rulesForRounding",
    },
    children: [
      {
        path: "rulesForRounding",
        name: "rulesForRounding",
        component: (resolve) =>
          require([
            "../components/rulesForRounding/rulesForRounding.vue",
          ], resolve),
      },
      {
        path: "samplingPointInformation",
        name: "samplingPointInformation",
        component: (resolve) =>
          require([
            "../components/samplingPointInformation/samplingPointInformation.vue",
          ], resolve),
      },
      {
        path: "samplePointInformation",
        name: "samplePointInformation",
        component: (resolve) =>
          require([
            "../components/samplePointInformation/samplePointInformation.vue",
          ], resolve),
      },
      {
        path: "laboratoryInformation",
        name: "laboratoryInformation",
        component: (resolve) =>
          require([
            "../components/laboratoryInformation/laboratoryInformation.vue",
          ], resolve),
      },
      {
        path: "limsbaseRules",
        name: "limsbaseRules",
        component: (resolve) =>
          require(["../components/limsbaseRules/limsbaseRules.vue"], resolve),
      },
      {
        path: "analysisProjectEarlyWarning",
        name: "analysisProjectEarlyWarning",
        component: (resolve) =>
          require([
            "../components/analysisProjectEarlyWarning/analysisProjectEarlyWarning.vue",
          ], resolve),
      },
      {
        path: "surpass",
        name: "surpass",
        component: (resolve) =>
          require(["../components/surpass/surpass.vue"], resolve),
      },
      {
        path: "metricUnitConfiguration",
        name: "metricUnitConfiguration",
        component: (resolve) =>
          require([
            "../components/metricUnitConfiguration/metricUnitConfiguration.vue",
          ], resolve),
      },
      {
        path: "lineBalancing",
        name: "lineBalancing",
        component: (resolve) =>
          require(["../components/lineBalancing/lineBalancing.vue"], resolve),
      },
      {
        path: "qrCodeConfig",
        name: "qrCodeConfig",
        component: (resolve) =>
          require(["../components/qrCodeConfig/qrCodeConfig.vue"], resolve),
      },
      {
        path: "brandGradeConfiguration",
        name: "brandGradeConfiguration",
        component: (resolve) =>
          require([
            "../components/brandGradeConfiguration/brandGradeConfiguration.vue",
          ], resolve),
      },
      {
        path: "computationalFormula",
        name: "computationalFormula",
        component: (resolve) =>
          require([
            "../components/computationalFormula/computationalFormula.vue",
          ], resolve),
      },
      {
        path: "systemThreadManagement",
        name: "systemThreadManagement",
        component: (resolve) =>
          require([
            "../components/systemThreadManagement/systemThreadManagement.vue",
          ], resolve),
      },
      {
        path: "projectCpostAllocation",
        name: "projectCpostAllocation",
        component: (resolve) =>
          require([
            "../components/projectCpostAllocation/projectCpostAllocation.vue",
          ], resolve),
      },
      {
        path: "materialConfiguration",
        name: "materialConfiguration",
        component: (resolve) =>
          require([
            "../components/materialConfiguration/materialConfiguration.vue",
          ], resolve),
      },
      {
        path: "analysisProjectComparison",
        name: "analysisProjectComparison",
        component: (resolve) =>
          require([
            "../components/analysisProjectComparison/analysisProjectComparison.vue",
          ], resolve),
      },
      {
        path: "warehouseInformationConfiguration",
        name: "warehouseInformationConfiguration",
        component: (resolve) =>
          require([
            "../components/warehouseInformationConfiguration/warehouseInformationConfiguration.vue",
          ], resolve),
      },
      {
        path: "commonCodeManagement",
        name: "commonCodeManagement",
        component: (resolve) =>
          require([
            "../components/commonCodeManagement/commonCodeManagement.vue",
          ], resolve),
      },
      {
        path: "workOutside",
        name: "workOutside",
        component: (resolve) =>
          require(["../components/workOutside/workOutside.vue"], resolve),
      },
      {
        path: "shiftHandoverProjectConfiguration",
        name: "shiftHandoverProjectConfiguration",
        component: (resolve) =>
          require([
            "../components/shiftHandoverProjectConfiguration/shiftHandoverProjectConfiguration.vue",
          ], resolve),
      },
      {
        path: "lnterfaceMaintenance",
        name: "lnterfaceMaintenance",
        component: (resolve) =>
          require([
            "../components/lnterfaceMaintenance/lnterfaceMaintenance.vue",
          ], resolve),
      },
      {
        path: "appConfiguration",
        name: "appConfiguration",
        component: (resolve) =>
          require([
            "../components/appConfiguration/appConfiguration.vue",
          ], resolve),
      },
      // 岗位物料配置
      {
        path: "postMaterials",
        name: "postMaterials",
        component: (resolve) =>
          require(["../components/postMaterials/postMaterials.vue"], resolve),
      },
      // 质保书
      {
        path: "zhibaoshu",
        name: "zhibaoshu",
        component: (resolve) =>
          require(["../components/zhibaoshu/zhibaoshu.vue"], resolve),
      },
      // 全分析报表
      {
        path: "quanfenxibaobiao",
        name: "quanfenxibaobiao",
        component: (resolve) =>
          require([
            "../components/quanfenxibaobiao/quanfenxibaobiao.vue",
          ], resolve),
      },
    ],
  },
];
const router = new Router({
  routes: constantRouterMap,
});

//  before
routerBefore(router, constantRouterMap);

export default router;
//  constantRouterMap
export const routes = constantRouterMap;
// export default new Router({
//   routes: [
//     {
//       path: '/',
//       name: 'main',
//       component: main,
//       redirect: {name: 'mypage'},
//       children: [
//         {path: 'mypage', name: 'mypage', component: mypage}
//         ]
//     }
//   ]
// })
