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: 'aMeasurementDataQuery'
  },
  children: [
    {
      path: 'aMeasurementDataQuery',
      name: 'aMeasurementDataQuery',
      component: resolve => require(['../components/dataManagementOfTruckScale/aMeasurementDataQuery.vue'], resolve)
    },
    {
      path: 'primaryMeasurementaDataMaintenance',
      name: 'primaryMeasurementaDataMaintenance',
      component: resolve => require(['../components/dataManagementOfTruckScale/primaryMeasurementaDataMaintenance.vue'], resolve)
    },
    {
      path: 'matchingOfPrimaryMeasurementData',
      name: 'matchingOfPrimaryMeasurementData',
      component: resolve => require(['../components/dataManagementOfTruckScale/matchingOfPrimaryMeasurementData.vue'], resolve)
    },
    {
      path: 'aMeasurementDataAudit',
      name: 'aMeasurementDataAudit',
      component: resolve => require(['../components/dataManagementOfTruckScale/aMeasurementDataAudit.vue'], resolve)
    },
    {
      path: 'measurementSceneRestoration',
      name: 'measurementSceneRestoration',
      component: resolve => require(['../components/dataManagementOfTruckScale/measurementSceneRestoration.vue'], resolve)
    },
    {
      path: 'cleanMeasurementDataQuery',
      name: 'cleanMeasurementDataQuery',
      component: resolve => require(['../components/dataManagementOfTruckScale/cleanMeasurementDataQuery.vue'], resolve)
    },
    {
      path: 'cleanMeasurementDataMaintenance',
      name: 'cleanMeasurementDataMaintenance',
      component: resolve => require(['../components/dataManagementOfTruckScale/cleanMeasurementDataMaintenance.vue'], resolve)
    },
    {
      path: 'auditOfNetSettlementMeasurementData',
      name: 'auditOfNetSettlementMeasurementData',
      component: resolve => require(['../components/dataManagementOfTruckScale/auditOfNetSettlementMeasurementData.vue'], resolve)
    },
    {
      path: 'queryOfCalibrationAndMeasurementData',
      name: 'queryOfCalibrationAndMeasurementData',
      component: resolve => require(['../components/dataManagementOfTruckScale/queryOfCalibrationAndMeasurementData.vue'], resolve)
    },
    {
      path: 'statisticalManagementOfAbnormalWeighing',
      name: 'statisticalManagementOfAbnormalWeighing',
      component: resolve => require(['../components/dataManagementOfTruckScale/statisticalManagementOfAbnormalWeighing.vue'], resolve)
    },
    {
      path: 'terminalOperationLogManagement',
      name: 'terminalOperationLogManagement',
      component: resolve => require(['../components/dataManagementOfTruckScale/terminalOperationLogManagement.vue'], resolve)
    },
    {
      path: 'managementOfMeteringOperationLog',
      name: 'managementOfMeteringOperationLog',
      component: resolve => require(['../components/dataManagementOfTruckScale/managementOfMeteringOperationLog.vue'], resolve)
    },
    {
      path: 'measurersMperformanceAnalysisManagement',
      name: 'measurersMperformanceAnalysisManagement',
      component: resolve => require(['../components/dataManagementOfTruckScale/measurersMperformanceAnalysisManagement.vue'], resolve)
    },
    {
      path: 'analysisAndManagementOfWeighingInstrumentUtilizationRate',
      name: 'analysisAndManagementOfWeighingInstrumentUtilizationRate',
      component: resolve => require(['../components/dataManagementOfTruckScale/analysisAndManagementOfWeighingInstrumentUtilizationRate.vue'], resolve)
    },
    {
      path: 'measurementEfficiencyAnalysisAndManagement',
      name: 'measurementEfficiencyAnalysisAndManagement',
      component: resolve => require(['../components/dataManagementOfTruckScale/measurementEfficiencyAnalysisAndManagement.vue'], resolve)
    },
    { // 结净数据access导出
      path: 'cleanMeasurementDataExport',
      name: 'cleanMeasurementDataExport',
      component: resolve => require(['../components/dataManagementOfTruckScale/cleanMeasurementDataExport.vue'], resolve)
    },
    {
      path: 'actualPerformanceDataQuery',
      name: 'actualPerformanceDataQuery',
      component: resolve => require(['../components/storageScaleDataManagement/actualPerformanceDataQuery.vue'], resolve)
    },
    {
      path: 'verificationAndQueryOfMeasurementPerformanceData',
      name: 'verificationAndQueryOfMeasurementPerformanceData',
      component: resolve => require(['../components/storageScaleDataManagement/verificationAndQueryOfMeasurementPerformanceData.vue'], resolve)
    },
    {
      path: 'meteringTerminalOperationLog',
      name: 'meteringTerminalOperationLog',
      component: resolve => require(['../components/storageScaleDataManagement/meteringTerminalOperationLog.vue'], resolve)
    },
    {
      path: 'measurementStaffPerformanceAnalysisManagement',
      name: 'measurementStaffPerformanceAnalysisManagement',
      component: resolve => require(['../components/storageScaleDataManagement/measurementStaffPerformanceAnalysisManagement.vue'], resolve)
    },
    {
      path: 'queryOfCalibration',
      name: 'queryOfCalibration',
      component: resolve => require(['../components/storageScaleDataManagement/queryOfCalibration.vue'], resolve)
    },
    {
      path: 'OneDataQuery',
      name: 'OneDataQuery',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/OneDataQuery.vue'], resolve)
    },
    {
      path: 'OneDataMaintain',
      name: 'OneDataMaintain',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/OneDataMaintain.vue'], resolve)
    },
    {
      path: 'OneDataAudit',
      name: 'OneDataAudit',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/OneDataAudit.vue'], resolve)
    },
    {
      path: 'OneDataMatch',
      name: 'OneDataMatch',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/OneDataMatch.vue'], resolve)
    },
    {
      path: 'netDataQuery',
      name: 'netDataQuery',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/netDataQuery.vue'], resolve)
    },
    {
      path: 'netDataMaintain',
      name: 'netDataMaintain',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/netDataMaintain.vue'], resolve)
    },
    {
      path: 'netDataAudit',
      name: 'netDataAudit',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/netDataAudit.vue'], resolve)
    },
    {
      path: 'measurementDataQuery',
      name: 'measurementDataQuery',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/measurementDataQuery.vue'], resolve)
    },
    {
      path: 'measurementDataMaintenance',
      name: 'measurementDataMaintenance',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/measurementDataMaintenance.vue'], resolve)
    },
    {
      path: 'measurementDataAudit',
      name: 'measurementDataAudit',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/measurementDataAudit.vue'], resolve)
    },
    {
      path: 'measurementDataMatching',
      name: 'measurementDataMatching',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/measurementDataMatching.vue'], resolve)
    },
    {
      path: 'queryOfNetSettlementMeasurementData',
      name: 'queryOfNetSettlementMeasurementData',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/queryOfNetSettlementMeasurementData.vue'], resolve)
    },
    {
      path: 'maintenanceOfNettingMeasurementData',
      name: 'maintenanceOfNettingMeasurementData',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/maintenanceOfNettingMeasurementData.vue'], resolve)
    },
    {
      path: 'auditOfNetSettlementMeasurement',
      name: 'auditOfNetSettlementMeasurement',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/auditOfNetSettlementMeasurement.vue'], resolve)
    },
    {
      path: 'meteringOperationLogManagement',
      name: 'meteringOperationLogManagement',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/meteringOperationLogManagement.vue'], resolve)
    },
    {
      path: 'measurementStaffPerformanceAnalysis',
      name: 'measurementStaffPerformanceAnalysis',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/measurementStaffPerformanceAnalysis.vue'], resolve)
    },
    {
      path: 'measurementEfficiencyAnalysis',
      name: 'measurementEfficiencyAnalysis',
      component: resolve => require(['../components/trackDataManagement/staticTrackScale/measurementEfficiencyAnalysis.vue'], resolve)
    },
    { // 抓斗秤数据维护页面
      path: 'productScaleDataMaintain',
      name: 'productScaleDataMaintain',
      component: resolve => require(['../components/productScaleMangement/productScaleDataMaintain.vue'], resolve)
    },
    { // 成品车间日填报
      path: 'productReportData',
      name: 'productReportData',
      component: resolve => require(['../components/storageScaleDataManagement/productReportData.vue'], resolve)
    },
    { // 单包计量预报管理
      path: 'singleProductForecastMaintain',
      name: 'singleProductForecastMaintain',
      component: resolve => require(['../components/singleProductMangement/singleProductForecastMaintain.vue'], resolve)
    },
    { // 单包计量实绩管理
      path: 'singleProductDataMaintain',
      name: 'singleProductDataMaintain',
      component: resolve => require(['../components/singleProductMangement/singleProductDataMaintain.vue'], resolve)
    },
    { // 驻外检测计量实绩管理
      path: 'outsideProductDataMaintain',
      name: 'outsideProductDataMaintain',
      component: resolve => require(['../components/outsideProductMangement/outsideProductDataMaintain.vue'], resolve)
    },
    { // 到厂检测计量实绩管理
      path: 'enterFactoryProductDataMaintain',
      name: 'enterFactoryProductDataMaintain',
      component: resolve => require(['../components/enterFactoryProductMangement/enterFactoryProductDataMaintain.vue'], resolve)
    },
    { // 动轨手动录数
      path: 'manualRecordData',
      name: 'manualRecordData',
      component: resolve => require(['../components/trackDataManagement/dynamicTrack/manualRecordData.vue'], resolve)
    },
    { // 卸货时间卡控
      path: 'unloadTimeLimit',
      name: 'unloadTimeLimit',
      component: resolve => require(['../components/dataManagementOfTruckScale/unloadTimeLimit.vue'], resolve)
    },
    { // 成品秤实绩维护
      path: 'actualPerformanceDataMaintain',
      name: 'actualPerformanceDataMaintain',
      component: resolve => require(['../components/storageScaleDataManagement/actualPerformanceDataMaintain.vue'], resolve)
    },
    { // 金银计量数据维护
      path: 'rareProductDataMaintain',
      name: 'rareProductDataMaintain',
      component: resolve => require(['../components/storageScaleDataManagement/rareProductDataMaintain.vue'], resolve)
    },
    { // 粗硒日填报
      path: 'rareProductReportData',
      name: 'rareProductReportData',
      component: resolve => require(['../components/storageScaleDataManagement/rareProductReportData.vue'], resolve)
    },
    { // 钴月汇总填报
      path: 'cobaltDataMonthGroup',
      name: 'cobaltDataMonthGroup',
      component: resolve => require(['../components/storageScaleDataManagement/cobaltDataMonthGroup.vue'], resolve)
    },
    { // 洁净数据扣重界面
      path: 'cleanMeasurementDataReduce',
      name: 'cleanMeasurementDataReduce',
      component: resolve => require(['../components/dataManagementOfTruckScale/cleanMeasurementDataReduce.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}
//         ]
//     }
//   ]
// })
