import Vue from 'vue'
import Router from 'vue-router'
import routerBefore from '@/config/routerBefore.js'
// 主要
import main from '@/components/main.vue'
// 系统配置管理
const addCargoResult = () => import('../components/ship/addCargoResult.vue')
const addDeliveryAttorney = () =>
  import('../components/ship/addDeliveryAttorney.vue')
const addDeliveryNotice = () =>
  import('../components/ship/addDeliveryNotice.vue')
const attorneytext = () => import('../components/ship/attorneytext.vue')
const cargoResult = () => import('../components/ship/cargoResult.vue')
const deliveryAttorney = () => import('../components/ship/deliveryAttorney.vue')
const deliveryNotice = () => import('../components/ship/deliveryNotice.vue')
const modifyCargoResult = () =>
  import('../components/ship/modifyCargoResult.vue')
const modifyDeliveryAttroney = () =>
  import('../components/ship/modifyDeliveryAttroney.vue')
const modifyDeliveryNotice = () =>
  import('../components/ship/modifyDeliveryNotice.vue')
const addBreach = () => import('../components/purchase/addBreach.vue')
const addOtherPrice = () => import('../components/purchase/addOtherPrice.vue')
const addShipPrice = () => import('../components/purchase/addShipPrice.vue')
const addTrainPrice = () => import('../components/purchase/addTrainPrice.vue')
const addTruckPrice = () => import('../components/purchase/addTruckPrice.vue')
const breach = () => import('../components/purchase/breach.vue')
const otherPrice = () => import('../components/purchase/otherPrice.vue')
const purchaseOrder = () => import('../components/purchase/purchaseOrder.vue')
const shipPrice = () => import('../components/purchase/shipPrice.vue')
const trainPrice = () => import('../components/purchase/trainPrice.vue')
const truckPrice = () => import('../components/purchase/truckPrice.vue')
const updateBreach = () => import('../components/purchase/updateBreach.vue')
const updateOtherPrice = () =>
  import('../components/purchase/updateOtherPrice.vue')
const updateShipPrice = () =>
  import('../components/purchase/updateShipPrice.vue')
const updateTrainPrice = () =>
  import('../components/purchase/updateTrainPrice.vue')
const updateTruckPrice = () =>
  import('../components/purchase/updateTruckPrice.vue')
const addSaleCokeSend = () =>
  import('../components/saleContract/addSaleCokeSend.vue')
const addSaleOrder = () => import('../components/saleContract/addSaleOrder.vue')
const addSaleOrderArrange = () =>
  import('../components/saleContract/addSaleOrderArrange.vue')
const addSaleOrderSend = () =>
  import('../components/saleContract/addSaleOrderSend.vue')
const addSaleOrderCoproductSend = () =>
  import('../components/saleContract/addSaleOrderCoproductSend.vue')
const addSaleOrderCoproductSendCarrier = () =>
  import('../components/saleContract/addSaleOrderCoproductSendCarrier.vue')
const addSaleOrderSteelSend = () =>
  import('../components/saleContract/addSaleOrderSteelSend.vue')
const addSaleOrderSteelSendCarrier = () =>
  import('../components/saleContract/addSaleOrderSteelSendCarrier.vue')
const addSalePlan = () => import('../components/saleContract/addSalePlan.vue')
const addSalePlanDetail = () =>
  import('../components/saleContract/addSalePlanDetail.vue')
const addTransportPrice = () =>
  import('../components/saleContract/addTransportPrice.vue')
const addTransportPriceNew = () =>
  import('../components/saleContract/addTransportPriceNew.vue')
const addTruckNoDetail = () =>
  import('../components/saleContract/addTruckNoDetail.vue')
const editaddress = () => import('../components/saleContract/editaddress.vue')
const editSaleOrder = () =>
  import('../components/saleContract/editSaleOrder.vue')
const editSaleOrderDetail = () =>
  import('../components/saleContract/editSaleOrderDetail.vue')
const editSalePalnDetail = () =>
  import('../components/saleContract/editSalePalnDetail.vue')
const editSalePlan = () => import('../components/saleContract/editSalePlan.vue')
const editTransportPrice = () =>
  import('../components/saleContract/editTransportPrice.vue')
const editTruckNoDetail = () =>
  import('../components/saleContract/editTruckNoDetail.vue')
const saleCokeInward = () =>
  import('../components/saleContract/saleCokeInward.vue')
const saleOrder = () => import('../components/saleContract/saleOrder.vue')
const saleOrderArrange = () =>
  import('../components/saleContract/saleOrderArrange.vue')
const saleOrderCoproduct = () =>
  import('../components/saleContract/saleOrderCoproduct.vue')
const saleOrderCoproductCarrier = () =>
  import('../components/saleContract/saleOrderCoproductCarrier.vue')
const saleOrderDetail = () =>
  import('../components/saleContract/saleOrderDetail.vue')
const saleOrderDetailApproved = () =>
  import('../components/saleContract/saleOrderDetailApproved.vue')
const saleOrderMaterial = () =>
  import('../components/saleContract/saleOrderMaterial.vue')
const dispacherSwitch = () =>
  import('../components/saleContract/dispacherSwitch.vue')
const saleOrderSteel = () =>
  import('../components/saleContract/saleOrderSteel.vue')
const saleOrderSteelCar = () =>
  import('../components/saleContract/saleOrderSteelCar.vue')
const saleOrderSteelCarrier = () =>
  import('../components/saleContract/saleOrderSteelCarrier.vue')
const saleOrderSteelEmpower = () =>
  import('../components/saleContract/saleOrderSteelEmpower.vue')
const saleOrderUpdateLog = () =>
  import('../components/saleContract/saleOrderUpdateLog.vue')
const salePlan = () => import('../components/saleContract/salePlan.vue')
const transportPrice = () =>
  import('../components/saleContract/transportPrice.vue')
const inwardTransPrice = () => import('../components/inward/transPrice.vue')
const inwardAddTransPrice = () =>
  import('../components/inward/addTransPrice.vue')
const saleOrderOODetails = () =>
  import('../components/saleContract/saleOrderOODetails.vue')
const updateSaleOrderSteel = () =>
  import('../components/saleContract/updateSaleOrderSteel.vue')
const copySteelOrder = () =>
  import('../components/saleContract/copySteelOrder.vue')
const rangeValuePoint = () => import('../components/inward/rangePoint.vue')
const updateTransPrice = () =>
  import('../components/inward/updateTransPrice.vue')
Vue.use(Router)

const constantRouterMap = [
  {
    path: '/',
    name: 'main',
    meta: { title: '首页', code: 'xtpzgl' },
    component: main,
    redirect: { name: 'cargoResult' },
    children: [
      {
        path: 'addCargoResult',
        name: 'addCargoResult',
        meta: { code: 'xtpzgl-jggl' },
        component: addCargoResult
      },
      {
        path: 'addDeliveryAttorney',
        name: 'addDeliveryAttorney',
        meta: { code: 'xtpzgl-yhgl' },
        component: addDeliveryAttorney
      },
      {
        path: 'addDeliveryNotice',
        name: 'addDeliveryNotice',
        meta: { code: 'xtpzgl-yhgl' },
        component: addDeliveryNotice
      },
      {
        path: 'attorneytext/:test',
        name: 'attorneytext',
        meta: { code: 'xtpzgl-yhgl' },
        component: attorneytext
      },
      {
        path: 'cargoResult',
        name: 'cargoResult',
        meta: { code: 'xtpzgl-yhgl' },
        component: cargoResult
      },
      {
        path: 'deliveryAttorney',
        name: 'deliveryAttorney',
        meta: { code: 'xtpzgl-yhgl' },
        component: deliveryAttorney
      },
      {
        path: 'deliveryNotice',
        name: 'deliveryNotice',
        meta: { code: 'xtpzgl-yhgl' },
        component: deliveryNotice
      },
      {
        path: 'modifyCargoResult/:cargoTransferResultId',
        name: 'modifyCargoResult',
        meta: { code: 'xtpzgl-yhgl' },
        component: modifyCargoResult
      },
      {
        path: 'modifyDeliveryAttroney/:attorneyId',
        name: 'modifyDeliveryAttroney',
        meta: { code: 'xtpzgl-yhgl' },
        component: modifyDeliveryAttroney
      },
      {
        path: 'modifyDeliveryNotice/:noticeId',
        name: 'modifyDeliveryNotice',
        meta: { code: 'xtpzgl-yhgl' },
        component: modifyDeliveryNotice
      },
      {
        path: 'addBreach',
        name: 'addBreach',
        meta: { code: 'xtpzgl-jggl' },
        component: addBreach
      },
      {
        path: 'addOtherPrice',
        name: 'addOtherPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: addOtherPrice
      },
      {
        path: 'addShipPrice',
        name: 'addShipPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: addShipPrice
      },
      {
        path: 'addTrainPrice',
        name: 'addTrainPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: addTrainPrice
      },
      {
        path: 'addTruckPrice',
        name: 'addTruckPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: addTruckPrice
      },
      {
        path: 'breach',
        name: 'breach',
        meta: { code: 'xtpzgl-yhgl' },
        component: breach
      },
      {
        path: 'otherPrice',
        name: 'otherPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: otherPrice
      },
      {
        path: 'purchaseOrder',
        name: 'purchaseOrder',
        meta: { code: 'xtpzgl-yhgl' },
        component: purchaseOrder
      },
      {
        path: 'shipPrice',
        name: 'shipPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: shipPrice
      },
      {
        path: 'trainPrice',
        name: 'trainPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: trainPrice
      },
      {
        path: 'truckPrice',
        name: 'truckPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: truckPrice
      },
      {
        path: 'updateBreach/:breachId',
        name: 'updateBreach',
        meta: { code: 'xtpzgl-yhgl' },
        component: updateBreach
      },
      {
        path: 'updateOtherPrice/:priceId',
        name: 'updateOtherPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: updateOtherPrice
      },
      {
        path: 'updateShipPrice/:priceId',
        name: 'updateShipPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: updateShipPrice
      },
      {
        path: 'updateTrainPrice/:priceId',
        name: 'updateTrainPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: updateTrainPrice
      },
      {
        path: 'updateTruckPrice/:priceId',
        name: 'updateTruckPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: updateTruckPrice
      },
      {
        path: 'addSaleCokeSend/:saleOrderId',
        name: 'addSaleCokeSend',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleCokeSend
      },
      {
        path: 'addSaleOrder',
        name: 'addSaleOrder',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleOrder
      },
      {
        path: 'addSaleOrderArrange/:saleOrderId',
        name: 'addSaleOrderArrange',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleOrderArrange
      },
      {
        path: 'addSaleOrderCoproductSend/:saleOrderId',
        name: 'addSaleOrderCoproductSend',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleOrderCoproductSend
      },
      {
        path: 'addSaleOrderCoproductSendCarrier/:saleOrderId',
        name: 'addSaleOrderCoproductSendCarrier',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleOrderCoproductSendCarrier
      },
      {
        path: 'addSaleOrderSend/:saleOrderId',
        name: 'addSaleOrderSend',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleOrderSend
      },
      {
        path: 'addSaleOrderSteelSend/:saleOrderMaterialId',
        name: 'addSaleOrderSteelSend',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleOrderSteelSend
      },
      {
        path: 'dispacherSwitch',
        name: 'dispacherSwitch',
        meta: { code: 'xtpzgl-jggl' },
        component: dispacherSwitch
      },
      {
        path: 'addSaleOrderSteelSendCarrier/:saleOrderId',
        name: 'addSaleOrderSteelSendCarrier',
        meta: { code: 'xtpzgl-jggl' },
        component: addSaleOrderSteelSendCarrier
      },
      {
        path: 'addSalePlan',
        name: 'addSalePlan',
        meta: { code: 'xtpzgl-yhgl' },
        component: addSalePlan
      },
      {
        path: 'addSalePlanDetail/:planId',
        name: 'addSalePlanDetail',
        meta: { code: 'xtpzgl-yhgl' },
        component: addSalePlanDetail
      },
      {
        path: 'saleOrderMaterial/:saleOrderId',
        name: 'saleOrderMaterial',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderMaterial
      },
      {
        path: 'addTransportPrice',
        name: 'addTransportPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: addTransportPrice
      },
      {
        path: 'addTransportPriceNew',
        name: 'addTransportPriceNew',
        meta: { code: 'xtpzgl-yhgl' },
        component: addTransportPriceNew
      },
      {
        path: 'addTruckNoDetail/:saleOrderMaterialId',
        name: 'addTruckNoDetail',
        meta: { code: 'xtpzgl-yhgl' },
        component: addTruckNoDetail
      },
      {
        path: 'editaddress/:saleOrderMaterialId',
        name: 'editaddress',
        meta: { code: 'xtpzgl-yhgl' },
        component: editaddress
      },
      {
        path: 'editSaleOrder/:saleOrderId',
        name: 'editSaleOrder',
        meta: { code: 'xtpzgl-yhgl' },
        component: editSaleOrder
      },
      {
        path: 'editSaleOrderDetail/:saleOrderMaterialId',
        name: 'editSaleOrderDetail',
        meta: { code: 'xtpzgl-yhgl' },
        component: editSaleOrderDetail
      },
      {
        path: 'editSalePalnDetail/:planMaterialId',
        name: 'editSalePalnDetail',
        meta: { code: 'xtpzgl-yhgl' },
        component: editSalePalnDetail
      },
      {
        path: 'editSalePlan/:planId',
        name: 'editSalePlan',
        meta: { code: 'xtpzgl-yhgl' },
        component: editSalePlan
      },
      {
        path: 'editTransportPrice/:priceId',
        name: 'editTransportPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: editTransportPrice
      },
      {
        path: 'editTruckNoDetail/:trucknoMaterialId',
        name: 'editTruckNoDetail',
        meta: { code: 'xtpzgl-yhgl' },
        component: editTruckNoDetail
      },
      {
        path: 'saleCokeInward',
        name: 'saleCokeInward',
        meta: { code: 'xtpzgl-yhgl', keepAlive: true },
        component: saleCokeInward
      },
      {
        path: 'saleOrder',
        name: 'saleOrder',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrder
      },
      {
        path: 'saleOrderArrange',
        name: 'saleOrderArrange',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderArrange
      },
      {
        path: 'saleOrderCoproduct',
        name: 'saleOrderCoproduct',
        meta: { code: 'xtpzgl-yhgl', keepAlive: true },
        component: saleOrderCoproduct
      },
      {
        path: 'saleOrderCoproductCarrier',
        name: 'saleOrderCoproductCarrier',
        meta: { code: 'xtpzgl-yhgl', keepAlive: true },
        component: saleOrderCoproductCarrier
      },
      {
        path: 'saleOrderSteel',
        name: 'saleOrderSteel',
        meta: { code: 'xtpzgl-yhgl', keepAlive: true },
        component: saleOrderSteel
      },
      {
        path: 'saleOrderSteelCar',
        name: 'saleOrderSteelCar',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderSteelCar
      },
      {
        path: 'saleOrderSteelCarrier',
        name: 'saleOrderSteelCarrier',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderSteelCarrier
      },
      {
        path: 'saleOrderSteelEmpower/:saleOrderMaterialId',
        name: 'saleOrderSteelEmpower',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderSteelEmpower
      },
      {
        path: 'saleOrderDetail/:saleOrderId',
        name: 'saleOrderDetail',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderDetail
      },
      {
        path: 'saleOrderDetailApproved/:saleOrderId',
        name: 'saleOrderDetailApproved',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderDetailApproved
      },
      {
        path: 'saleOrderUpdateLog/:saleOrderId',
        name: 'saleOrderUpdateLog',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderUpdateLog
      },
      {
        path: 'salePlan',
        name: 'salePlan',
        meta: { code: 'xtpzgl-yhgl' },
        component: salePlan
      },
      {
        path: 'transportPrice',
        name: 'transportPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: transportPrice
      },
      {
        path: 'inwardTransPrice',
        name: 'inwardTransPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: inwardTransPrice
      },
      {
        path: 'inwardAddTransPrice',
        name: 'inwardAddTransPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: inwardAddTransPrice
      },
      {
        path: 'saleOrderOODetails/:saleOrderId',
        name: 'saleOrderOODetails',
        meta: { code: 'xtpzgl-yhgl' },
        component: saleOrderOODetails
      },
      {
        path: 'updateSaleOrderSteel/:saleOrderId/:deleted',
        name: 'updateSaleOrderSteel',
        meta: { code: 'xtpzgl-yhgl' },
        component: updateSaleOrderSteel
      },
      {
        path: 'copySteelOrder/:saleOrderId',
        name: 'copySteelOrder',
        meta: { code: 'xtpzgl-yhgl' },
        component: copySteelOrder
      },
      {
        path: 'rangeValuePoint',
        name: 'rangeValuePoint',
        meta: { code: 'xtpzgl-yhgl' },
        component: rangeValuePoint
      },
      {
        path: 'updateTransPrice',
        name: 'updateTransPrice',
        meta: { code: 'xtpzgl-yhgl' },
        component: updateTransPrice
      }
    ]
  }
]
const router = new Router({
  routes: constantRouterMap
})
//  before
routerBefore(router, constantRouterMap)

export default router
//  constantRouterMap
export const routes = constantRouterMap
