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

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

// 主要
import main from '@/components/main.vue'
// 系统配置管理
import ShipDynamicTable from '../components/Ship_dynamic_table.vue'
import purchaseAccessoriesMonitor from '../components/purchaseAccessoriesMonitor.vue'
import purchasFuelOldMonitor from '../components/purchasFuelMonitor/purchasFuelOldMonitor.vue'
import purchasFuelNewMonitor from '../components/purchasFuelMonitor/purchasFuelNewMonitor.vue'
import sporadicReportEnterFactory from '../components/sporadicReport/sporadicReportEnterFactory.vue'
import sporadicReportExFactory from '../components/sporadicReport/sporadicReportExFactory.vue'
import transportationPerformance from '../components/salesLogisticsStatistics/transportationPerformance.vue'
import purchaseChemicalMaterialsNew from '../components/purchaseChemicalMaterials/purchaseChemicalMaterialsNew.vue'
import purchaseChemicalMaterialsOld from '../components/purchaseChemicalMaterials/purchaseChemicalMaterialsOld.vue'
import purInwardReport from '../components/inwardReport/putInwardReport.vue'


Vue.use(Router)

const constantRouterMap = [
  {
    path: '/',
    name: 'main',
    meta: {title: '首页', code: 'xtpzgl'},
    component: main,
    redirect: {name: 'cargoResult'},
    children: [
      {path: 'purchaseChemicalMaterialsNew', name: 'purchaseChemicalMaterialsNew', meta: {code: 'xtpzgl-yhgl'}, component: purchaseChemicalMaterialsNew},
      {path: 'purchaseChemicalMaterialsOld', name: 'purchaseChemicalMaterialsOld', meta: {code: 'xtpzgl-yhgl'}, component: purchaseChemicalMaterialsOld},
      {path: 'ShipDynamicTable', name: 'ShipDynamicTable', meta: {code: 'xtpzgl-yhgl'}, component: ShipDynamicTable},
      {path: 'purchaseAccessoriesMonitor', name: 'purchaseAccessoriesMonitor', meta: {code: 'xtpzgl-yhgl'}, component: purchaseAccessoriesMonitor},
      {path: 'purchasFuelOldMonitor', name: 'purchasFuelOldMonitor', meta: {code: 'xtpzgl-yhgl'}, component: purchasFuelOldMonitor},
      {path: 'purchasFuelNewMonitor', name: 'purchasFuelNewMonitor', meta: {code: 'xtpzgl-yhgl'}, component: purchasFuelNewMonitor},
      {path: 'sporadicReportEnterFactory',name:'sporadicReportEnterFactory',meta:{code:'xtpzgl-yhgl'},component:sporadicReportEnterFactory},
      {path: 'sporadicReportExFactory',name:'sporadicReportExFactory',meta:{code:'xtpzgl-yhgl'},component:sporadicReportExFactory},
      {path: 'transportationPerformance', name: 'transportationPerformance', meta: {code: 'xtpzgl-yhgl'}, component: transportationPerformance},
      {path: 'purInwardReport', name: 'purInwardReport', meta: {code: 'xtpzgl-yhgl'}, component: purInwardReport}

    ]
  }
];

const router = new Router({
  routes: constantRouterMap
})
//  before
routerBefore(router, constantRouterMap);

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