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: 'deviceInfo'
  },
  children: [
    {
      path: 'deviceInfo',
      name: 'deviceInfo',
      component: resolve => require(['../components/deviceInfo/deviceInfo.vue'], resolve)
    },
    {
      path: 'personMangement',
      name: 'personMangement',
      component: resolve => require(['../components/personMangement/personMangement.vue'], resolve)
    },
    {
      path: 'goodsMangement',
      name: 'goodsMangement',
      component: resolve => require(['../components/goodsMangement/goodsMangement.vue'], resolve)
    },
    {
      path: 'goodsMangementruku',
      name: 'goodsMangementruku',
      component: resolve => require(['../components/goodsMangement/goodsMangementruku.vue'], resolve)
    },
    {
      path: 'goodsMangementchuku',
      name: 'goodsMangementchuku',
      component: resolve => require(['../components/goodsMangement/goodsMangementchuku.vue'], resolve)
    },
    {
      path: 'fileMangement',
      name: 'fileMangement',
      component: resolve => require(['../components/fileMangement/fileMangement.vue'], resolve)
    },
    {
      path: 'exa',
      name: 'exa',
      component: resolve => require(['../components/exa.vue'], resolve)
    },
    {
      path: 'stuffManagement',
      name: 'stuffManagement',
      component: resolve => require(['../components/stuffManagement/stuffManagement.vue'], resolve)
    },
    //标样查看
    {
      path: 'prototypeToSee',
      name: 'prototypeToSee',
      component: resolve => require(['../components/prototypeToSee/prototypeToSee.vue'], resolve)
    },
    {
      path: 'standardFluidManagementAudit',
      name: 'standardFluidManagementAudit',
      component: resolve => require(['../components/standardFluidManagementAudit/standardFluidManagementAudit.vue'], resolve)
    },
    {
      path: 'standardFluidManagement',
      name: 'standardFluidManagement',
      component: resolve => require(['../components/standardFluidManagement/standardFluidManagement.vue'], resolve)
    }
    // ,
    // {
    //   path: 'batchApproveOutbound',
    //   name: 'batchApproveOutbound',
    //   component: resolve => require(['../components/goodsMangement/batchApproveOutbound.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}
//         ]
//     }
//   ]
// })
