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: 'meteringConfiguration'
  },
  children: [
    {
      path: 'meteringConfiguration',
      name: 'meteringConfiguration',
      component: resolve => require(['../components/meteringConfiguration.vue'], resolve)
    },
    {
      path: 'baseDataManage',
      name: 'baseDataManage',
      component: resolve => require(['../components/baseDataManage.vue'], resolve)
    },
    {
      path: 'sourceConfigManage',
      name: 'sourceConfigManage',
      component: resolve => require(['../components/sourceConfigManage.vue'], resolve)
    },
    {
      path: 'materialConfig',
      name: 'materialConfig',
      component: resolve => require(['../components/materialConfig.vue'], resolve)
    },
    {
      path: 'materialMeteringConfig',
      name: 'materialMeteringConfig',
      component: resolve => require(['../components/materialMeteringConfig.vue'], resolve)
    },
    {
      path: 'merchantsMaintain',
      name: 'merchantsMaintain',
      component: resolve => require(['../components/merchantsMaintain.vue'], resolve)
    },
    {
      path: 'merchantCarManage',
      name: 'merchantCarManage',
      component: resolve => require(['../components/merchantCarManage.vue'], resolve)
    },
    {
      path: 'meterBaseCarrierUnits',
      name: 'meterBaseCarrierUnits',
      component: resolve => require(['../components/meterBaseCarrierUnits.vue'], resolve)
    },
    {
      path: 'meterBaseCarrierUnitCars',
      name: 'meterBaseCarrierUnitCars',
      component: resolve => require(['../components/meterBaseCarrierUnitCars.vue'], resolve)
    },
    {
      path: 'meteringVoiceConfig',
      name: 'meteringVoiceConfig',
      component: resolve => require(['../components/meteringVoiceConfig.vue'], resolve)
    },
    {
      path: 'checkTimeConfig',
      name: 'checkTimeConfig',
      component: resolve => require(['../components/checkTimeConfig.vue'], resolve)
    },
    {
      path: 'instrumentConfig',
      name: 'instrumentConfig',
      component: resolve => require(['../components/instrumentConfig.vue'], resolve)
    },
    {
      path: 'scaleConfig',
      name: 'scaleConfig',
      component: resolve => require(['../components/scaleConfig.vue'], resolve)
    },
    {
      path: 'timeInterval',
      name: 'timeInterval',
      component: resolve => require(['../components/timeInterval.vue'], resolve)
    },
    {
      path: 'carHoldTimeManage',
      name: 'carHoldTimeManage',
      component: resolve => require(['../components/carHoldTimeManage.vue'], resolve)
    },
    {
      path: 'unloadTimeManage',
      name: 'unloadTimeManage',
      component: resolve => require(['../components/unloadTimeManage.vue'], resolve)
    },
    {
      path: 'skinBackTimeManage',
      name: 'skinBackTimeManage',
      component: resolve => require(['../components/skinBackTimeManage.vue'], resolve)
    },
    {
      path: 'paperPrintManage',
      name: 'paperPrintManage',
      component: resolve => require(['../components/paperPrintManage.vue'], resolve)
    },
    {
      path: 'cardManage',
      name: 'cardManage',
      component: resolve => require(['../components/cardManage.vue'], resolve)
    },
    {
      path: 'carConfig',
      name: 'carConfig',
      component: resolve => require(['../components/carConfig.vue'], resolve)
    },
    {
      path: 'carBlacklistManage',
      name: 'carBlacklistManage',
      component: resolve => require(['../components/carBlacklistManage.vue'], resolve)
    },
    {
      path: 'subWeightConfig',
      name: 'subWeightConfig',
      component: resolve => require(['../components/subWeightConfig.vue'], resolve)
    },
    {
      path: 'dateSkinWeightCarConfig',
      name: 'dateSkinWeightCarConfig',
      component: resolve => require(['../components/dateSkinWeightCarConfig.vue'], resolve)
    },
    {
      path: 'dateSkinWeightDataConfig',
      name: 'dateSkinWeightDataConfig',
      component: resolve => require(['../components/dateSkinWeightDataConfig.vue'], resolve)
    },
    {
      path: 'dateSkinWeightCountConfig',
      name: 'dateSkinWeightCountConfig',
      component: resolve => require(['../components/dateSkinWeightCountConfig.vue'], resolve)
    }, {
      path: 'dateSkinWeightTimeConfig',
      name: 'dateSkinWeightTimeConfig',
      component: resolve => require(['../components/dateSkinWeightTimeConfig.vue'], resolve)
    },
    {
      path: 'forecastConfig',
      name: 'forecastConfig',
      component: resolve => require(['../components/forecastConfig.vue'], resolve)
    },
    {
      path: 'balanceDifferentConfig',
      name: 'balanceDifferentConfig',
      component: resolve => require(['../components/balanceDifferentConfig.vue'], resolve)
    },
    {
      path: 'mutualInspectionConfig',
      name: 'mutualInspectionConfig',
      component: resolve => require(['../components/mutualInspectionConfig.vue'], resolve)
    },
    {
      path: 'dangerManage',
      name: 'dangerManage',
      component: resolve => require(['../components/dangerManage.vue'], resolve)
    },
    {
      path: 'functionMaintain',
      name: 'functionMaintain',
      component: resolve => require(['../components/functionMaintain.vue'], resolve)
    },
    {
      path: 'componentsManage',
      name: 'componentsManage',
      component: resolve => require(['../components/componentsManage.vue'], resolve)
    },
    {
      path: 'pluginManage',
      name: 'pluginManage',
      component: resolve => require(['../components/pluginManage.vue'], resolve)
    },
    {
      path: 'threadManage',
      name: 'threadManage',
      component: resolve => require(['../components/threadManage.vue'], resolve)
    },
    {
      path: 'maintenanceOfHistoricalTareData',
      name: 'maintenanceOfHistoricalTareData',
      component: resolve => require(['../components/maintenanceOfHistoricalTareData.vue'], resolve)
    },
    {
      path: 'historicalTareConfiguration',
      name: 'historicalTareConfiguration',
      component: resolve => require(['../components/historicalTareConfiguration.vue'], resolve)
    },
    {
      path: 'dataMigrationConfiguration',
      name: 'dataMigrationConfiguration',
      component: resolve => require(['../components/dataMigrationConfiguration.vue'], resolve)
    },
    {
      path: 'calibrationScaleMeteringConfiguration',
      name: 'calibrationScaleMeteringConfiguration',
      component: resolve => require(['../components/calibrationScaleMeteringConfiguration.vue'], resolve)
    },
    {
      path: 'videoFrequency',
      name: 'videoFrequency',
      component: resolve => require(['../components/videoFrequency.vue'], resolve)
    },
    {
      path: 'fixedWeightConfigurationOfTrainCarriage',
      name: 'fixedWeightConfigurationOfTrainCarriage',
      component: resolve => require(['../components/fixedWeightConfigurationOfTrainCarriage.vue'], resolve)
    },
    {
      path: 'businessQRCodeGeneration',
      name: 'businessQRCodeGeneration',
      component: resolve => require(['../components/businessQRCodeGeneration.vue'], resolve)
    },
    {
      path: 'carrierConfiguration',
      name: 'carrierConfiguration',
      component: resolve => require(['../components/carrierConfiguration.vue'], resolve)
    },
    { // 卸货权限配置
      path: 'unloadLink',
      name: 'unloadLink',
      component: resolve => require(['../components/unloadLink.vue'], resolve)
    },
    { // 新老物资对应
      path: 'materialOldLinkNew',
      name: 'materialOldLinkNew',
      component: resolve => require(['../components/materialOldLinkNew.vue'], resolve)
    },
    { // 动轨期限皮重录入
      path: 'dynamicDateTareInput',
      name: 'dynamicDateTareInput',
      component: resolve => require(['../components/dynamicDateTareInput.vue'], resolve)
    },
    { // 计量数据操作日志查询
      path: 'operationLogSearch',
      name: 'operationLogSearch',
      component: resolve => require(['../components/operationLogSearch.vue'], resolve)
    },
    { // 汽车衡汇总报表
      path: 'dataGroupReport',
      name: 'dataGroupReport',
      component: resolve => require(['../components/dataGroupReport.vue'], resolve)
    },
    { // 汽车衡明细报表
      path: 'dataDetailReport',
      name: 'dataDetailReport',
      component: resolve => require(['../components/dataDetailReport.vue'], resolve)
    },
    { // 采购汇总报表
      path: 'purchaseDataGroupReport',
      name: 'purchaseDataGroupReport',
      component: resolve => require(['../components/purchaseDataGroupReport.vue'], resolve)
    },
    { // 电子台账报表
      path: 'dataStatisticalReport',
      name: 'dataStatisticalReport',
      component: resolve => require(['../components/dataStatisticalReport.vue'], resolve)
    },
    { // 动轨物资配置
      path: 'dynamicMaterialConfig',
      name: 'dynamicMaterialConfig',
      component: resolve => require(['../components/dynamicMaterialConfig.vue'], resolve)
    },
    { // 动轨单位配置
      path: 'dynamicUnitMaintain',
      name: 'dynamicUnitMaintain',
      component: resolve => require(['../components/dynamicUnitMaintain.vue'], resolve)
    },
    { // 临时委托维护页面
      path: 'temporaryAppointmentInput',
      name: 'temporaryAppointmentInput',
      component: resolve => require(['../components/temporaryAppointmentInput.vue'], resolve)
    },
    { // 复磅配置页面
      path: 'recovereightConfig',
      name: 'recovereightConfig',
      component: resolve => require(['../components/recovereightConfig.vue'], resolve)
    },
    { // 计量数据废除配置
      path: 'firstWeightabolish',
      name: 'firstWeightabolish',
      component: resolve => require(['../components/firstWeightabolish.vue'], resolve)
    },
    { // 历史皮重类型和物料名称关联配置页面
      path: 'materialRelationConfig',
      name: 'materialRelationConfig',
      component: resolve => require(['../components/materialRelationConfig.vue'], resolve)
    },
    { // 物资单价配置页面
      path: 'materialPriceConfig',
      name: 'materialPriceConfig',
      component: resolve => require(['../components/materialPriceConfig.vue'], resolve)
    },
    { //产品名称配置页面
      path: 'productDataConfig',
      name: 'productDataConfig',
      component: resolve => require(['../components/productDataConfig.vue'], resolve)
    },
    { //铂钯信息配置页面
      path: 'bobaDataConfig',
      name: 'bobaDataConfig',
      component: resolve => require(['../components/bobaDataConfig.vue'], resolve)
    }
  ]
}];
const router = new Router({
  routes: constantRouterMap
})

//  before
routerBefore(router, constantRouterMap);

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