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: 'flowLayout'
  },
  children: [
    {
      path: 'flowLayout',
      name: 'flowLayout',
      component: resolve => require(['../components/flowLayout.vue'], resolve)
    },
    {
      path: 'vehicleVerificationAndRegistrationManagement',
      name: 'vehicleVerificationAndRegistrationManagement',
      component: resolve => require(['../components/vehicleVerificationAndRegistrationManagement.vue'], resolve)
    },
    {
      path: 'measurementSceneRegistrationManagement',
      name: 'measurementSceneRegistrationManagement',
      component: resolve => require(['../components/measurementSceneRegistrationManagement.vue'], resolve)
    }
  ]
}];
const router = new Router({
  routes: constantRouterMap
})

//  before
routerBefore(router, constantRouterMap);

export default router;
//  constantRouterMap
export const routes = constantRouterMap;
