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: "analyzeProjectConfiguration",
    },
    children: [
      {
        path: "analyzeProjectConfiguration",
        name: "analyzeProjectConfiguration",
        component: (resolve) =>
          require([
            "../components/analyzeProjectConfiguration/analyzeProjectConfiguration.vue",
          ], resolve),
      },
      {
        path: "testProjectConfiguration",
        name: "testProjectConfiguration",
        component: (resolve) =>
          require([
            "../components/testProjectConfiguration/testProjectConfiguration.vue",
          ], resolve),
      },
      {
        path: "testMethodConfiguration",
        name: "testMethodConfiguration",
        component: (resolve) =>
          require([
            "../components/testMethodConfiguration/testMethodConfiguration.vue",
          ], resolve),
      },
      {
        path: "standardInformation",
        name: "standardInformation",
        component: (resolve) =>
          require([
            "../components/standardInformation/standardInformation.vue",
          ], resolve),
      },
      {
        path: "standardContentInformation",
        name: "standardContentInformation",
        component: (resolve) =>
          require([
            "../components/standardContentInformation/standardContentInformation.vue",
          ], resolve),
      },
      {
        path: "standardContentConfiguration",
        name: "standardContentConfiguration",
        component: (resolve) =>
          require([
            "../components/standardContentConfiguration/standardContentConfiguration.vue",
          ], resolve),
      },
      {
        path: "sampleTemplateMaintenance",
        name: "sampleTemplateMaintenance",
        component: (resolve) =>
          require([
            "../components/sampleTemplateMaintenance/sampleTemplateMaintenance.vue",
          ], resolve),
      },
      {
        path: "testTaskMaintenance",
        name: "testTaskMaintenance",
        component: (resolve) =>
          require([
            "../components/testTaskMaintenance/testTaskMaintenance.vue",
          ], resolve),
      },
      {
        path: "testIndexMaintenance",
        name: "testIndexMaintenance",
        component: (resolve) =>
          require([
            "../components/testIndexMaintenance/testIndexMaintenance.vue",
          ], resolve),
      },
      {
        // 体系文件审核
        path: "systemAudit",
        name: "systemAudit",
        component: (resolve) =>
          require(["../components/systemAudit/systemAudit.vue"], resolve),
      },
      {
        // 体系文件查看
        path: "systemFileViewing",
        name: "systemFileViewing",
        component: (resolve) =>
          require([
            "../components/systemFileViewing/systemFileViewing.vue",
          ], resolve),
      },
      {
        // 体系文件管理
        path: "systemFileManagement",
        name: "systemFileManagement",
        component: (resolve) =>
          require([
            "../components/systemFileManagement/systemFileManagement.vue",
          ], resolve),
      },
      {
        // 体系文件记录管理
        path: "systemFileManagementRecord",
        name: "systemFileManagementRecord",
        component: (resolve) =>
          require([
            "../components/systemFileManagementRecord/systemFileManagement.vue",
          ], resolve),
      },
      {
        // 体系文件记录管理
        path: "systemAuditRecord",
        name: "systemAuditRecord",
        component: (resolve) =>
          require(["../components/systemAuditRecord/systemAudit.vue"], resolve),
      },
      {
        // 体系文件记录管理
        path: "systemFileViewingRecord",
        name: "systemFileViewingRecord",
        component: (resolve) =>
          require([
            "../components/systemFileViewingRecord/systemFileViewing.vue",
          ], resolve),
      },
      {
        // 内审管理
        path: "internalAuditManagement",
        name: "internalAuditManagement",
        component: (resolve) =>
          require([
            "../components/internalAuditManagement/internalAuditManagement.vue",
          ], resolve),
      },
      {
        // 体系模板管理
        path: "systemTemplateManagement",
        name: "systemTemplateManagement",
        component: (resolve) =>
          require([
            "../components/systemTemplateManagement/systemTemplateManagement.vue",
          ], resolve),
      },
      {
        // 体系模板管理
        path: "fourFileOnlineEdit",
        name: "fourFileOnlineEdit",
        component: (resolve) =>
          require([
            "../components/systemFileManagement/fourFileOnlineEdit.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}
//         ]
//     }
//   ]
// })
