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

import routerBefore from '@/config/routerBefore.js'
// 主要
import main from '@/components/main.vue'
// 系统配置管理
import addCapacity from '../components/addCapacity.vue'
import addCarDriver from '../components/addCarDriver.vue'
import addCarrier from '../components/addCarrier.vue'
import addConsignee from '../components/addConsignee.vue'
import addGatepost from '../components/addGatepost.vue'
import addMaterial from '../components/addMaterial.vue'
import addOilPrice from '../components/addOilPrice.vue'
import addPersonnel from '../components/addPersonnel.vue'
import addPier from '../components/addPier.vue'
import addPort from '../components/addPort.vue'
import addPortStorageYard from '../components/addPortStorageYard.vue'
import addRawMaterialManufacturer from '../components/addRawMaterialManufacturer.vue'
import addRawWarehouse from '../components/addRawWarehouse.vue'
import addRmsShipper from '../components/addRmsShipper.vue'
import addSupplier from '../components/addSupplier.vue'
import addTruckCalculate from '../components/addTruckCalculate.vue'
import capacity from '../components/capacity.vue'
import carDriver from '../components/carDriver.vue'
import carrier from '../components/carrier.vue'

import editCapacity from '../components/editCapacity.vue'
import editCarDriver from '../components/editCarDriver.vue'
import editCarrier from '../components/editCarrier.vue'
import editConsignee from '../components/editConsignee.vue'
import editGatepost from '../components/editGatepost.vue'
import editMaterial from '../components/editMaterial.vue'
import editOilPrice from '../components/editOilPrice.vue'
import editPersonnel from '../components/editPersonnel.vue'
import editPier from '../components/editPier.vue'
import editPortStorageYard from '../components/editPortStorageYard.vue'
import editRawMaterialManufacturer from '../components/editRawMaterialManufacturer.vue'
import editRawWarehouse from '../components/editRawWarehouse.vue'
import editRmsShipper from '../components/editRmsShipper.vue'
import editSupplier from '../components/editSupplier.vue'
import editTruckCalculate from '../components/editTruckCalculate.vue'
import gatepost from '../components/gatepost.vue'
import material from '../components/material.vue'
import oilPrice from '../components/oilPrice.vue'
import personnel from '../components/personnel.vue'
import pier from '../components/pier.vue'
import port from '../components/port.vue'
import portStorageYard from '../components/portStorageYard.vue'
import rawMaterialManufacturer from '../components/rawMaterialManufacturer.vue'
import rawWarehouse from '../components/rawWarehouse.vue'
import rmsShipper from '../components/rmsShipper.vue'
import supplier from '../components/supplier.vue'
import transitRoute from '../components/transitRoute.vue'
import transitRouteAdd from '../components/transitRouteAdd.vue'
import truckCalculate from '../components/truckCalculate.vue'
import consignee from '../components/consignee.vue'
Vue.use(Router)
const constantRouterMap = [
	{
	  path: '/',
	  name: 'main',
	  meta: {title: '首页', code: 'xtpzgl'},
	  component: main,
	  redirect: {name: 'addCapacity'},
	  children: [
		{path: 'addCapacity', name: 'addCapacity', meta: {code: 'xtpzgl-jggl'}, component: addCapacity},
		{path: 'addCarDriver', name: 'addCarDriver', meta: {code: 'xtpzgl-yhgl'}, component: addCarDriver},
		{path: 'addCarrier', name: 'addCarrier', meta: {code: 'xtpzgl-yhgl'}, component: addCarrier},
		{path: 'addConsignee',name: 'addConsignee',meta: {code:'xtpzgl-yhgl'},component: addConsignee},
		{path: 'addGatepost', name: 'addGatepost', meta: {code: 'xtpzgl-yhgl'}, component: addGatepost},
		{path: 'addMaterial', name: 'addMaterial', meta: {code: 'xtpzgl-yhgl'}, component: addMaterial},
		{path: 'addOilPrice', name: 'addOilPrice', meta: {code: 'xtpzgl-yhgl'}, component: addOilPrice},
		{path: 'addPersonnel', name: 'addPersonnel', meta: {code: 'xtpzgl-yhgl'}, component: addPersonnel},
		{path: 'addPier', name: 'addPier', meta: {code: 'xtpzgl-yhgl'}, component: addPier},
		{path: 'addPort', name: 'addPort', meta: {code: 'xtpzgl-yhgl'}, component: addPort},
		{path: 'addPortStorageYard', name: 'addPortStorageYard', meta: {code: 'xtpzgl-yhgl'}, component: addPortStorageYard},
		{path: 'addRawMaterialManufacturer', name: 'addRawMaterialManufacturer', meta: {code: 'xtpzgl-yhgl'}, component: addRawMaterialManufacturer},
		{path: 'addRawWarehouse', name: 'addRawWarehouse', meta: {code: 'xtpzgl-yhgl'}, component: addRawWarehouse},
		{path: 'addRmsShipper', name: 'addRmsShipper', meta: {code: 'xtpzgl-yhgl'}, component: addRmsShipper},
		{path: 'addSupplier', name: 'addSupplier', meta: {code: 'xtpzgl-yhgl'}, component: addSupplier},
		{path: 'addTruckCalculate', name: 'addTruckCalculate', meta: {code: 'xtpzgl-yhgl'}, component: addTruckCalculate},
		{path: 'capacity', name: 'capacity', meta: {code: 'xtpzgl-yhgl'}, component: capacity},
		{path: 'carDriver', name: 'carDriver', meta: {code: 'xtpzgl-yhgl'}, component: carDriver},
		{path: 'carrier', name: 'carrier', meta: {code: 'xtpzgl-yhgl'}, component: carrier},
		{path: 'editCapacity/:capacityId', name: 'editCapacity', meta: {code: 'xtpzgl-yhgl'}, component: editCapacity},
		{path: 'editCarDriver/:driverId', name: 'editCarDriver', meta: {code: 'xtpzgl-yhgl'}, component: editCarDriver},
		{path: 'editCarrier/:carrierId', name: 'editCarrier', meta: {code: 'xtpzgl-yhgl'}, component: editCarrier},
		{path: 'editConsignee/:consigneeId',name: 'editConsignee',meta:{code: 'xtpzgl-yhgl'},component: editConsignee},
		{path: 'editGatepost/:gatepostId', name: 'editGatepost', meta: {code: 'xtpzgl-yhgl'}, component: editGatepost},
		{path: 'editMaterial/:materialId', name: 'editMaterial', meta: {code: 'xtpzgl-yhgl'}, component: editMaterial},
		{path: 'editOilPrice/:priceId', name: 'editOilPrice', meta: {code: 'xtpzgl-yhgl'}, component: editOilPrice},
		{path: 'editPersonnel/:personnelId', name: 'editPersonnel', meta: {code: 'xtpzgl-yhgl'}, component: editPersonnel},
		{path: 'editPier', name: 'editPier', meta: {code: 'xtpzgl-yhgl'}, component: editPier},
		{path: 'editPortStorageYard', name: 'editPortStorageYard', meta: {code: 'xtpzgl-yhgl'}, component: editPortStorageYard},
		{path: 'editRawMaterialManufacturer', name: 'editRawMaterialManufacturer', meta: {code: 'xtpzgl-yhgl'}, component: editRawMaterialManufacturer},
		{path: 'editRawWarehouse/:warehouseId', name: 'editRawWarehouse', meta: {code: 'xtpzgl-yhgl'}, component: editRawWarehouse},
		{path: 'editRmsShipper/:shipperId', name: 'editRmsShipper', meta: {code: 'xtpzgl-yhgl'}, component: editRmsShipper},
		{path: 'editSupplier/:supplierId', name: 'editSupplier', meta: {code: 'xtpzgl-yhgl'}, component: editSupplier},
		{path: 'editTruckCalculate/:truckCalculateId', name: 'editTruckCalculate', meta: {code: 'xtpzgl-yhgl'}, component: editTruckCalculate},
		{path: 'gatepost', name: 'gatepost', meta: {code: 'xtpzgl-yhgl'}, component: gatepost},
		{path: 'material', name: 'material', meta: {code: 'xtpzgl-yhgl'}, component: material},
		{path: 'oilPrice', name: 'oilPrice', meta: {code: 'xtpzgl-yhgl'}, component: oilPrice},
		{path: 'personnel', name: 'personnel', meta: {code: 'xtpzgl-yhgl'}, component: personnel},
		{path: 'pier', name: 'pier', meta: {code: 'xtpzgl-yhgl'}, component: pier},
		{path: 'port', name: 'port', meta: {code: 'xtpzgl-yhgl'}, component: port},
		{path: 'portStorageYard', name: 'portStorageYard', meta: {code: 'xtpzgl-yhgl'}, component: portStorageYard},
		{path: 'rawMaterialManufacturer', name: 'rawMaterialManufacturer', meta: {code: 'xtpzgl-yhgl'}, component: rawMaterialManufacturer},
		{path: 'rawWarehouse', name: 'rawWarehouse', meta: {code: 'xtpzgl-yhgl'}, component: rawWarehouse},
		{path: 'rmsShipper', name: 'rmsShipper', meta: {code: 'xtpzgl-yhgl'}, component: rmsShipper},
		{path: 'supplier', name: 'supplier', meta: {code: 'xtpzgl-yhgl'}, component: supplier},
		{path: 'transitRoute', name: 'transitRoute', meta: {code: 'xtpzgl-yhgl'}, component: transitRoute},
		{path: 'transitRouteAdd/:addup', name: 'transitRouteAdd', meta: {code: 'xtpzgl-yhgl'}, component: transitRouteAdd},
		{path: 'truckCalculate', name: 'truckCalculate', meta: {code: 'xtpzgl-yhgl'}, component: truckCalculate},
		{path: 'consignee', name: 'consignee', meta: {code: 'xtpzgl-yhgl'}, component: consignee}
	  ]
	}
  ];
  
  const router = new Router({
	routes: constantRouterMap
  })
  //  before
  routerBefore(router, constantRouterMap);
  
  export default router;
  //  constantRouterMap
  export const routes = constantRouterMap;
  