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

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

// 主要
import main from '@/components/main.vue'
// 系统配置管理
const ShipDynamicTable = () => import('../components/Ship_dynamic_table.vue')
const ShipWorkReport = () => import('../components/ShipWorkReport.vue')
const dowmShipDynamicTable = () =>
  import('../components/dowmShipDynamicTable.vue')
const controlLines = () => import('../components/controlLines.vue')
const purchaseAccessoriesMonitor = () =>
  import('../components/purchaseAccessoriesMonitor.vue')
const purchasFuelOldMonitor = () =>
  import('../components/purchasFuelMonitor/purchasFuelOldMonitor.vue')
const purchasFuelNewMonitor = () =>
  import('../components/purchasFuelMonitor/purchasFuelNewMonitor.vue')
const sporadicReportEnterFactory = () =>
  import('../components/sporadicReport/sporadicReportEnterFactory.vue')
const sporadicReportExFactory = () =>
  import('../components/sporadicReport/sporadicReportExFactory.vue')
const saleChemicalCokeForm = () =>
  import('../components/salesLogisticsStatistics/saleChemicalCokeForm.vue')
const saleCoproductForm = () =>
  import('../components/salesLogisticsStatistics/saleCoproductForm.vue')
const saleSteelForm = () =>
  import('../components/salesLogisticsStatistics/saleSteelForm.vue')
const transportationPerformance = () =>
  import('../components/salesLogisticsStatistics/transportationPerformance.vue')
const purchaseChemicalMaterialsNew = () =>
  import(
    '../components/purchaseChemicalMaterials/purchaseChemicalMaterialsNew.vue'
  )
const purchaseChemicalMaterialsOld = () =>
  import(
    '../components/purchaseChemicalMaterials/purchaseChemicalMaterialsOld.vue'
  )
const purInwardReport = () =>
  import('../components/inwardReport/putInwardReport.vue')
const inwardFactory = () =>
  import('../components/inwardReport/inwardFactory.vue')
const getLoading = () => import('../components/inwardReport/getLoading.vue')
const getUnLoading = () => import('../components/inwardReport/getUnLoading.vue')
const purchaseMineral = () => import('../components/purachaseMineral.vue')
const inwardSporadicReport = () =>
  import('../components/sporadicReport/inwardSporadicReport.vue')
const getInstall = () => import('../components/inwardReport/getInstall.vue')

const getCapacityByDefend = () =>
  import('../components/defendCapacity/getCapacityByDefend.vue')
const inwardAssemble = () =>
  import('../components/inwardAssemble/inwardAssemble.vue')
const loadCapacityDetail = () =>
  import('../components/loadCapacityDetail/loadCapacityDetail.vue')
const allInwardReport = () =>
  import('../components/inwardReport/allInwardReport.vue')
const saleSteelAllReport = () =>
  import('../components/salesLogisticsStatistics/saleSteelAllReport.vue')
const loadWagonWorkReport = () =>
  import('../components/wanzhouReport/loadWagonWorkReport.vue')
const unloadShipWorkReport = () =>
  import('../components/wanzhouReport/unloadShipWorkReport.vue')
const wagonWorkReport = () =>
  import('../components/wanzhouReport/wagonWorkReport.vue')
const saleSteelCarrierReport = () =>
  import(
    '@/views/statisticalReport/components/salesLogisticsStatistics/saleSteelCarrierReport.vue'
  )
const saleSteelReports = () =>
  import(
    '@/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue'
  )
const saleSteelReportsFD = () =>
  import(
    '@/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReportsFD.vue'
  )
const saleSpelling = () =>
  import(
    '@/views/statisticalReport/components/salesLogisticsStatistics/saleSpelling.vue'
  )
const mapTest = () =>
  import('../components/salesLogisticsStatistics/mapTest.vue')
const saleSteelReportForFinance = () =>
  import('../components/salesLogisticsStatistics/saleSteelReportForFinance.vue')
const unloadingSteelReports = () =>
  import(
    '@/views/statisticalReport/components/salesLogisticsStatistics/unloadingSteelReports.vue'
  )
const steelTransportReport = () =>
  import('../components/salesLogisticsStatistics/steelTransportReport.vue')
const yawnReport = () =>
  import('../components/salesLogisticsStatistics/yawnReport.vue')

const saleCoproductFormMonitor = () =>
  import(
    '@/views/statisticalReport/components/salesLogisticsStatistics/saleCoproductFormMonitor.vue'
  )

const saleChemicalCokeFormMonitor = () =>
  import(
    '@/views/statisticalReport/components/salesLogisticsStatistics/saleChemicalCokeFormMonitor.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: 'ShipWorkReport',
        name: 'ShipWorkReport',
        meta: { code: 'xtpzgl-yhgl' },
        component: ShipWorkReport
      },
      {
        path: 'dowmShipDynamicTable',
        name: 'dowmShipDynamicTable',
        meta: { code: 'xtpzgl-yhgl' },
        component: dowmShipDynamicTable
      },
      {
        path: 'controlLines',
        name: 'controlLines',
        meta: { code: 'xtpzgl-yhgl' },
        component: controlLines
      },
      {
        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: 'saleChemicalCokeForm',
        name: 'saleChemicalCokeForm',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleChemicalCokeForm
      },
      {
        path: 'saleCoproductForm',
        name: 'saleCoproductForm',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleCoproductForm
      },
      {
        path: 'saleSteelForm',
        name: 'saleSteelForm',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleSteelForm
      },
      {
        path: 'transportationPerformance',
        name: 'transportationPerformance',
        meta: { code: 'xtpzgl-yhgl' },
        component: transportationPerformance
      },
      {
        path: 'purInwardReport',
        name: 'purInwardReport',
        meta: { code: 'xtpzgl-yhgl' },
        component: purInwardReport
      },
      {
        path: 'inwardFactory',
        name: 'inwardFactory',
        meta: { code: 'xtpzgl-yhgl' },
        component: inwardFactory
      },
      {
        path: 'getLoading',
        name: 'getLoading',
        meta: { code: 'xtpzgl-yhgl' },
        component: getLoading
      },
      {
        path: 'getUnLoading',
        name: 'getUnLoading',
        meta: { code: 'xtpzgl-yhgl' },
        component: getUnLoading
      },
      {
        path: 'purchaseMineral',
        name: 'purchaseMineral',
        meta: { code: 'xtpzgl-yhgl' },
        component: purchaseMineral
      },
      {
        path: 'inwardSporadicReport',
        name: 'inwardSporadicReport',
        meta: { code: 'xtpzgl-yhgl' },
        component: inwardSporadicReport
      },
      {
        path: 'getInstall',
        name: 'getInstall',
        meta: { code: 'xtpzgl-yhgl' },
        component: getInstall
      },
      {
        path: 'getCapacityByDefend',
        name: 'getCapacityByDefend',
        meta: { code: 'xtpzgl-yhgl' },
        component: getCapacityByDefend
      },
      {
        path: 'inwardAssemble',
        name: 'inwardAssemble',
        meta: { code: 'xtpzgl-yhgl' },
        component: inwardAssemble
      },
      {
        path: 'loadCapacityDetail',
        name: 'loadCapacityDetail',
        meta: { code: 'xtpzgl-yhgl' },
        component: loadCapacityDetail
      },
      {
        path: 'allInwardReport',
        name: 'allInwardReport',
        meta: { code: 'xtpzgl-yhgl' },
        component: allInwardReport
      },
      {
        path: 'saleSteelAllReport',
        name: 'saleSteelAllReport',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: saleSteelAllReport
      },
      {
        path: 'loadWagonWorkReport',
        name: 'loadWagonWorkReport',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: loadWagonWorkReport
      },
      {
        path: 'unloadShipWorkReport',
        name: 'unloadShipWorkReport',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: unloadShipWorkReport
      },
      {
        path: 'wagonWorkReport',
        name: 'wagonWorkReport',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: wagonWorkReport
      },
      {
        path: 'saleSteelCarrierReport',
        name: 'saleSteelCarrierReport',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: saleSteelCarrierReport
      },
      {
        path: 'saleSteelReports',
        name: 'saleSteelReports',
        meta: {
          code: 'xtpzgl-yhgl',
          keepAlive: true,
          title: '销售钢材报表'
        },
        component: saleSteelReports
      },
      {
        path: 'saleSteelReportsFD',
        name: 'saleSteelReportsFD',
        meta: {
          code: 'xtpzgl-yhgl',
          keepAlive: true,
          title: '销售钢材报表'
        },
        component: saleSteelReportsFD
      },
      {
        path: 'saleSpelling',
        name: 'saleSpelling',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: saleSpelling
      },
      {
        path: 'mapTest',
        name: 'mapTest',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: mapTest
      },
      {
        path: 'unloadingSteelReports',
        name: 'unloadingSteelReports',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: unloadingSteelReports
      },
      {
        path: 'saleSteelReportForFinance',
        name: 'saleSteelReportForFinance',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: saleSteelReportForFinance
      },
      {
        path: 'steelTransportReport',
        name: 'steelTransportReport',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: steelTransportReport
      },
      {
        path: 'yawnReport',
        name: 'yawnReport',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: yawnReport
      },
      {
        path: 'saleChemicalCokeFormMonitor',
        name: 'saleChemicalCokeFormMonitor',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: saleChemicalCokeFormMonitor
      },
      {
        path: 'saleCoproductFormMonitor',
        name: 'saleCoproductFormMonitor',
        meta: {
          code: 'xtpzgl-yhgl'
        },
        component: saleCoproductFormMonitor
      }
    ]
  }
]
const router = new Router({
  routes: constantRouterMap
})
//  before
routerBefore(router, constantRouterMap)

export default router
//  constantRouterMap
export const routes = constantRouterMap
