import Vue from 'vue'
import Router from 'vue-router'

import routerBefore from '@/config/routerBefore.js'

Vue.use(Router)
const constantRouterMap = [{
  path: '/',
  name: 'main',
  component: resolve => require(['@/components/main.vue'], resolve),
  redirect: {
    name: 'chemicalAnalysisReport'
  },
  children: [
    {  
      path: 'chemicalAnalysisReport',
      name: 'chemicalAnalysisReport',
      component: resolve => require(['../components/chemicalAnalysisReport.vue'], resolve)
    },
    {  
      path: 'chemicalOriginalRecord',
      name: 'chemicalOriginalRecord',
      component: resolve => require(['../components/chemicalOriginalRecord.vue'], resolve)
    },
    {  
      path: 'chemicalOriginalRecordBy',
      name: 'chemicalOriginalRecordBy',
      component: resolve => require(['../components/chemicalOriginalRecordBy.vue'], resolve)
    },
    {  
      path: 'comeToRegister',
      name: 'comeToRegister',
      component: resolve => require(['../components/comeToRegister.vue'], resolve)
    }
  ]
}];
const router = new Router({
  routes: constantRouterMap
})

routerBefore(router, constantRouterMap);

export default router;
export const routes = constantRouterMap;
