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: 'fixedScheduleManagement'
  },
  children: [
    {
      path: 'fixedScheduleManagement',
      name: 'fixedScheduleManagement',
      component: resolve => require(['../components/fixedScheduleManagement/fixedScheduleManagement.vue'], resolve)
    },
    {
      path: 'interimPlanManagement',
      name: 'interimPlanManagement',
      component: resolve => require(['../components/interimPlanManagement/interimPlanManagement.vue'], resolve)
    },
    {
      path: 'interimPlanReview',
      name: 'interimPlanReview',
      component: resolve => require(['../components/interimPlanReview/interimPlanReview.vue'], resolve)
    },
    {
      path: 'originalInspectionPlan',
      name: 'originalInspectionPlan',
      component: resolve => require(['../components/originalInspectionPlan/originalInspectionPlan.vue'], resolve)
    },
    {
      path: 'fixedData',
      name: 'fixedData',
      component: resolve => require(['../components/fixedData/fixedData.vue'], resolve)
    },
    {
      path: 'massiveMaterial',
      name: 'massiveMaterial',
      component: resolve => require(['../components/massiveMaterial/massiveMaterial.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}
//         ]
//     }
//   ]
// })
