import Vue from 'vue'
import Router from 'vue-router'
import routerBefore from '@/config/routerBefore.js'
// 主要
import main from '@/components/main.vue'
// 系统配置管理
import addCargoResult from '../components/ship/addCargoResult.vue'
import addDeliveryAttorney from '../components/ship/addDeliveryAttorney.vue'
import addDeliveryNotice from '../components/ship/addDeliveryNotice.vue'
import cargoResult from '../components/ship/cargoResult.vue'
import deliveryAttorney from '../components/ship/deliveryAttorney.vue'
import deliveryNotice from '../components/ship/deliveryNotice.vue'
import modifyCargoResult from '../components/ship/modifyCargoResult.vue'
import modifyDeliveryAttroney from '../components/ship/modifyDeliveryAttroney.vue'
import modifyDeliveryNotice from '../components/ship/modifyDeliveryNotice.vue'
import addBreach from '../components/purchase/addBreach.vue'
import addOtherPrice from '../components/purchase/addOtherPrice.vue'
import addShipPrice from '../components/purchase/addShipPrice.vue'
import addTrainPrice from '../components/purchase/addTrainPrice.vue'
import addTruckPrice from '../components/purchase/addTruckPrice.vue'
import breach from '../components/purchase/breach.vue'
import otherPrice from '../components/purchase/otherPrice.vue'
import purchaseOrder from '../components/purchase/purchaseOrder.vue'
import shipPrice from '../components/purchase/shipPrice.vue'
import trainPrice from '../components/purchase/trainPrice.vue'
import truckPrice from '../components/purchase/truckPrice.vue'
import updateBreach from '../components/purchase/updateBreach.vue'
import updateOtherPrice from '../components/purchase/updateOtherPrice.vue'
import updateShipPrice from '../components/purchase/updateShipPrice.vue'
import updateTrainPrice from '../components/purchase/updateTrainPrice.vue'
import updateTruckPrice from '../components/purchase/updateTruckPrice.vue'
import addSaleCokeSend from '../components/saleContract/addSaleCokeSend.vue'
import addSaleOrder from '../components/saleContract/addSaleOrder.vue'
import addSaleOrderArrange from '../components/saleContract/addSaleOrderArrange.vue'
import addSaleOrderSend from '../components/saleContract/addSaleOrderSend.vue'
import addSaleOrderCoproductSend from '../components/saleContract/addSaleOrderCoproductSend.vue'
import addSalePlan from '../components/saleContract/addSalePlan.vue'
import addSalePlanDetail from '../components/saleContract/addSalePlanDetail.vue'
import addTransportPrice from '../components/saleContract/addTransportPrice.vue'
import addTruckNoDetail from '../components/saleContract/addTruckNoDetail.vue'
import editaddress from '../components/saleContract/editaddress.vue'
import editSaleOrder from '../components/saleContract/editSaleOrder.vue'
import editSaleOrderDetail from '../components/saleContract/editSaleOrderDetail.vue'
import editSalePalnDetail from '../components/saleContract/editSalePalnDetail.vue'
import editSalePlan from '../components/saleContract/editSalePlan.vue'
import editTransportPrice from '../components/saleContract/editTransportPrice.vue'
import editTruckNoDetail from '../components/saleContract/editTruckNoDetail.vue'
import saleCokeInward from '../components/saleContract/saleCokeInward.vue'
import saleOrder from '../components/saleContract/saleOrder.vue'
import saleOrderArrange from '../components/saleContract/saleOrderArrange.vue'
import saleOrderCoproduct from '../components/saleContract/saleOrderCoproduct.vue'
import saleOrderDetail from '../components/saleContract/saleOrderDetail.vue'
import saleOrderDetailApproved from '../components/saleContract/saleOrderDetailApproved.vue'
import saleOrderMaterial from '../components/saleContract/saleOrderMaterial.vue'
import saleOrderUpdateLog from '../components/saleContract/saleOrderUpdateLog.vue'
import salePlan from '../components/saleContract/salePlan.vue'
import transportPrice from '../components/saleContract/transportPrice.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: '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: 'addSaleOrderSend/:saleOrderId', name: 'addSaleOrderSend', meta: {code: 'xtpzgl-jggl'}, component: addSaleOrderSend},
      {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: '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'}, 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'}, component: saleOrderCoproduct},
      {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},
    ]
  }
];

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

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