import Vue from "vue";
import Router from "vue-router";

import routerBefore from "@/config/routerBefore.js";

// 主要
import main from "@/components/main.vue";
// 系统配置管理
//零星物资运输预约
const sporadicTransportAppoint = () => import( "../components/sporadicMaterial/transportAppoint/transportAppoint.vue");
const addSporadicTransportAppoint = () => import( "../components/sporadicMaterial/transportAppoint/addSporadicTransportAppoint.vue");
const editSporadicTransportAppoint = () => import( "../components/sporadicMaterial/transportAppoint/editTransportAppoint.vue");
//内转零星运输计划
const addSporadicTransportPlan = () => import( "../components/sporadicMaterial/transportPlan/addTransportPlan.vue");
const sporadicTransportPlan = () => import( "../components/sporadicMaterial/transportPlan/transportPlan.vue");
//零星物资运输派单
const sporadicTransportOrder = () => import( "../components/sporadicMaterial/transportOrder/transportOrder.vue");
const addSporadicTransportOrder = () => import( "../components/sporadicMaterial/transportOrder/addTransportOrder.vue");
const editSporadicTransportOrder = () => import( "../components/sporadicMaterial/transportOrder/editTransportOrder.vue");
//零星物资进厂
const sporadicENenfactory = () => import( "../components/sporadicMaterial/sporadicEnfactory/enFactory.vue");
const sporadicENgrossWeight = () => import( "../components/sporadicMaterial/sporadicEnfactory/grossWeight.vue");
const sporadicENoutFactory = () => import( "../components/sporadicMaterial/sporadicEnfactory/outFactory.vue");
const sporadicENtareWeight = () => import( "../components/sporadicMaterial/sporadicEnfactory/tareWeight.vue");
const sporadicENunload = () => import( "../components/sporadicMaterial/sporadicEnfactory/unload.vue");
//零星物资出厂
const sporadicOUTenfactory = () => import( "../components/sporadicMaterial/sporadicOutfactory/enFactory.vue");
const sporadicOUTgrossWeight = () => import( "../components/sporadicMaterial/sporadicOutfactory/grossWeight.vue");
const sporadicOUToutFactory = () => import( "../components/sporadicMaterial/sporadicOutfactory/outFactory.vue");
const sporadicOUTtareWeight = () => import( "../components/sporadicMaterial/sporadicOutfactory/tareWeight.vue");
const sporadicOUTload = () => import( "../components/sporadicMaterial/sporadicOutfactory/load.vue");

//老区零星进出厂
//老厂零星物资运输预约
const oldSporadicAppoint = () => import( "../components/oldAreaSporadic/transportAppoint/transportAppoint.vue");
const addOldSporadicAppoint = () => import( "../components/oldAreaSporadic/transportAppoint/addSporadicTransportAppoint.vue");
//老厂零星物资运输派单
const oldSporadicOrder = () => import( "../components/oldAreaSporadic/transportOrder/transportOrder.vue");
const addOldSporadicOrder = () => import( "../components/oldAreaSporadic/transportOrder/addTransportOrder.vue");

//老厂零星物资中转
const oldSporadicInwardTenfactory = () => import( "../components/oldAreaSporadic/inwardSporadicFactory/enFactory.vue");
const oldSporadicInwardGrossWeight = () => import( "../components/oldAreaSporadic/inwardSporadicFactory/grossWeight.vue");
const oldSporadicInwardoutFactory = () => import( "../components/oldAreaSporadic/inwardSporadicFactory/LeaveFactory.vue");
const oldSporadicInwardtareWeight = () => import( "../components/oldAreaSporadic/inwardSporadicFactory/tareWeight.vue");
const oldSporadicInwardload = () => import( "../components/oldAreaSporadic/inwardSporadicFactory/Load.vue");
const oldSporadicInwardUnload = () => import( "../components/oldAreaSporadic/inwardSporadicFactory/unload.vue");

//钢材退货运输预约
const steelReturnTransportAppoint = () => import( "../components/steelReturn/transportAppoint/transportAppoint.vue");
const addSteelReturnTransportAppoint = () => import( "../components/steelReturn/transportAppoint/addSteelReturnTransportAppoint.vue");
const editSteelReturnTransportAppoint = () => import( "../components/steelReturn/transportAppoint/editTransportAppoint.vue");
//钢材退货运输派单
const steelReturnTransportOrder = () => import( "../components/steelReturn/transportOrder/transportOrder.vue");
const addSteelReturnTransportOrder = () => import( "../components/steelReturn/transportOrder/addTransportOrder.vue");
const editSteelReturnTransportOrder = () => import( "../components/steelReturn/transportOrder/editTransportOrder.vue");
//钢材退货运输执行
const steelReturnEnfactory = () => import( "../components/steelReturn/transportExcute/enFactory.vue");
const steelReturnGrossWeight = () => import( "../components/steelReturn/transportExcute/grossWeight.vue");
const steelReturnOutFactory = () => import( "../components/steelReturn/transportExcute/outFactory.vue");
const steelReturnTareWeight = () => import( "../components/steelReturn/transportExcute/tareWeight.vue");
const steelReturnUnload = () => import( "../components/steelReturn/transportExcute/unload.vue");

//一车多趟运输预约
const mornThanTransportAppoint = () => import( "../components/moreThanMaterialTruck/transportAppoint/transportAppoint.vue");
const addMornThanTransportAppoint = () => import( "../components/moreThanMaterialTruck/transportAppoint/addSporadicTransportAppoint.vue");
//一车多趟运输派单
const mornThanTransportOrder = () => import( "../components/moreThanMaterialTruck/transportOrder/transportOrder.vue");
const addMornThanTransportOrder = () => import( "../components/moreThanMaterialTruck/transportOrder/addTransportOrder.vue");
//一车多趟运输执行进厂
const mornThanENenfactory = () => import( "../components/moreThanMaterialTruck/sporadicEnfactory/enFactory.vue");
const mornThanENgrossWeight = () => import( "../components/moreThanMaterialTruck/sporadicEnfactory/grossWeight.vue");
const mornThanENoutFactory = () => import( "../components/moreThanMaterialTruck/sporadicEnfactory/outFactory.vue");
const mornThanENtareWeight = () => import( "../components/moreThanMaterialTruck/sporadicEnfactory/tareWeight.vue");
const mornThanENunload = () => import( "../components/moreThanMaterialTruck/sporadicEnfactory/unload.vue");
//一车多趟运输执行出厂
const mornThanOUTenfactory = () => import( "../components/moreThanMaterialTruck/sporadicOutfactory/enFactory.vue");
const mornThanOUTgrossWeight = () => import( "../components/moreThanMaterialTruck/sporadicOutfactory/grossWeight.vue");
const mornThanOUToutFactory = () => import( "../components/moreThanMaterialTruck/sporadicOutfactory/outFactory.vue");
const mornThanOUTtareWeight = () => import( "../components/moreThanMaterialTruck/sporadicOutfactory/tareWeight.vue");
const mornThanOUTload = () => import( "../components/moreThanMaterialTruck/sporadicOutfactory/load.vue");

// 内转零星内转进厂展示界面
const sporadicEnfactoryInward = () => import( "../components/sporadicMaterial/inwardSporadicFactory/enFactory.vue");
const sporadicgrossWeightInward = () => import( "../components/sporadicMaterial/inwardSporadicFactory/grossWeight.vue");
const sporadicLeavefactoryInward = () => import( "../components/sporadicMaterial/inwardSporadicFactory/LeaveFactory.vue");
const sporadicLoadInward = () => import( "../components/sporadicMaterial/inwardSporadicFactory/Load.vue");
const sporadicTareWeightInward = () => import( "../components/sporadicMaterial/inwardSporadicFactory/tareWeight.vue");
const sporadicUnloadInward = () => import( "../components/sporadicMaterial/inwardSporadicFactory/unload.vue");

Vue.use(Router);
const constantRouterMap = [
  {
    path: "/",
    name: "main",
    meta: { title: "首页", code: "xtpzgl" },
    component: main,
    redirect: { name: "addSporadicTransportAppoint" },
    children: [
      //零星物资运输预约
      {
        path: "addSporadicTransportAppoint",
        name: "addSporadicTransportAppoint",
        meta: { code: "xtpzgl-jggl" },
        component: addSporadicTransportAppoint
      },
      {
        path: "sporadicTransportAppoint",
        name: "sporadicTransportAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicTransportAppoint
      },
      {
        path: "editSporadicTransportAppoint",
        name: "editSporadicTransportAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: editSporadicTransportAppoint
      },
      //内转零星运输计划
      {
        path: "addSporadicTransportPlan",
        name: "addSporadicTransportPlan",
        meta: { code: "xtpzgl-jggl" },
        component: addSporadicTransportPlan
      },
      {
        path: "sporadicTransportPlan",
        name: "sporadicTransportPlan",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicTransportPlan
      },
      //零星物资运输订单
      {
        path: "addSporadicTransportOrder",
        name: "addSporadicTransportOrder",
        meta: { code: "xtpzgl-jggl" },
        component: addSporadicTransportOrder
      },
      {
        path: "sporadicTransportOrder",
        name: "sporadicTransportOrder",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicTransportOrder
      },
      {
        path: "editSporadicTransportOrder",
        name: "editSporadicTransportOrder",
        meta: { code: "xtpzgl-yhgl" },
        component: editSporadicTransportOrder
      },
      //零星物资进厂
      {
        path: "sporadicENenfactory",
        name: "sporadicENenfactory",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicENenfactory
      },
      {
        path: "sporadicENgrossWeight",
        name: "sporadicENgrossWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicENgrossWeight
      },
      {
        path: "sporadicENoutFactory",
        name: "sporadicENoutFactory",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicENoutFactory
      },
      {
        path: "sporadicENtareWeight",
        name: "sporadicENtareWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicENtareWeight
      },
      {
        path: "sporadicENunload",
        name: "sporadicENunload",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicENunload
      },
      //零星物资出厂
      {
        path: "sporadicOUTenfactory",
        name: "sporadicOUTenfactory",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicOUTenfactory
      },
      {
        path: "sporadicOUTgrossWeight",
        name: "sporadicOUTgrossWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicOUTgrossWeight
      },
      {
        path: "sporadicOUToutFactory",
        name: "sporadicOUToutFactory",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicOUToutFactory
      },
      {
        path: "sporadicOUTtareWeight",
        name: "sporadicOUTtareWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicOUTtareWeight
      },
      {
        path: "sporadicOUTload",
        name: "sporadicOUTload",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicOUTload
      },

      //钢材退货运输预约
      {
        path: "addSteelReturnTransportAppoint",
        name: "addSteelReturnTransportAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: addSteelReturnTransportAppoint
      },
      {
        path: "steelReturnTransportAppoint",
        name: "steelReturnTransportAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: steelReturnTransportAppoint
      },
      {
        path: "editSteelReturnTransportAppoint",
        name: "editSteelReturnTransportAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: editSteelReturnTransportAppoint
      },
      //钢材退货运输订单
      {
        path: "addSteelReturnTransportOrder",
        name: "addSteelReturnTransportOrder",
        meta: { code: "xtpzgl-jggl" },
        component: addSteelReturnTransportOrder
      },
      {
        path: "steelReturnTransportOrder",
        name: "steelReturnTransportOrder",
        meta: { code: "xtpzgl-yhgl" },
        component: steelReturnTransportOrder
      },
      {
        path: "editSteelReturnTransportOrder",
        name: "editSteelReturnTransportOrder",
        meta: { code: "xtpzgl-yhgl" },
        component: editSteelReturnTransportOrder
      },
      //钢材退货进厂
      {
        path: "steelReturnEnfactory",
        name: "steelReturnEnfactory",
        meta: { code: "xtpzgl-yhgl" },
        component: steelReturnEnfactory
      },
      {
        path: "steelReturnGrossWeight",
        name: "steelReturnGrossWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: steelReturnGrossWeight
      },
      {
        path: "steelReturnOutFactory",
        name: "steelReturnOutFactory",
        meta: { code: "xtpzgl-yhgl" },
        component: steelReturnOutFactory
      },
      {
        path: "steelReturnTareWeight",
        name: "steelReturnTareWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: steelReturnTareWeight
      },
      {
        path: "steelReturnUnload",
        name: "steelReturnUnload",
        meta: { code: "xtpzgl-yhgl" },
        component: steelReturnUnload
      },

      //一车多趟运输预约
      {
        path: "addMornThanTransportAppoint",
        name: "addMornThanTransportAppoint",
        meta: { code: "xtpzgl-jggl" },
        component: addMornThanTransportAppoint
      },
      {
        path: "mornThanTransportAppoint",
        name: "mornThanTransportAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanTransportAppoint
      },
      //一车多趟运输订单
      {
        path: "addMornThanTransportOrder",
        name: "addMornThanTransportOrder",
        meta: { code: "xtpzgl-jggl" },
        component: addMornThanTransportOrder
      },
      {
        path: "mornThanTransportOrder",
        name: "mornThanTransportOrder",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanTransportOrder
      },
      //一车多趟进厂
      {
        path: "mornThanENenfactory",
        name: "mornThanENenfactory",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanENenfactory
      },
      {
        path: "mornThanENgrossWeight",
        name: "mornThanENgrossWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanENgrossWeight
      },
      {
        path: "mornThanENoutFactory",
        name: "mornThanENoutFactory",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanENoutFactory
      },
      {
        path: "mornThanENtareWeight",
        name: "mornThanENtareWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanENtareWeight
      },
      {
        path: "mornThanENunload",
        name: "mornThanENunload",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanENunload
      },
      //一车多趟出厂
      {
        path: "mornThanOUTenfactory",
        name: "mornThanOUTenfactory",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanOUTenfactory
      },
      {
        path: "mornThanOUTgrossWeight",
        name: "mornThanOUTgrossWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanOUTgrossWeight
      },
      {
        path: "mornThanOUToutFactory",
        name: "sporadicOUToutFactory",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanOUToutFactory
      },
      {
        path: "mornThanOUTtareWeight",
        name: "sporadicOUTtareWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanOUTtareWeight
      },
      {
        path: "mornThanOUTload",
        name: "mornThanOUTload",
        meta: { code: "xtpzgl-yhgl" },
        component: mornThanOUTload
      },

      //内转零星内转
      {
        path: "sporadicEnfactoryInward",
        name: "sporadicEnfactoryInward",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicEnfactoryInward
      },
      {
        path: "sporadicgrossWeightInward",
        name: "sporadicgrossWeightInward",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicgrossWeightInward
      },
      {
        path: "sporadicLeavefactoryInward",
        name: "sporadicLeavefactoryInward",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicLeavefactoryInward
      },
      {
        path: "sporadicLoadInward",
        name: "sporadicLoadInward",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicLoadInward
      },
      {
        path: "sporadicTareWeightInward",
        name: "sporadicTareWeightInward",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicTareWeightInward
      },
      {
        path: "sporadicUnloadInward",
        name: "sporadicUnloadInward",
        meta: { code: "xtpzgl-yhgl" },
        component: sporadicUnloadInward
      },

      //老厂零星物资运输预约
      {
        path: "addOldSporadicAppoint",
        name: "addOldSporadicAppoint",
        meta: { code: "xtpzgl-jggl" },
        component: addOldSporadicAppoint
      },
      {
        path: "oldSporadicAppoint",
        name: "oldSporadicAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicAppoint
      },
      {
        path: "editSporadicTransportAppoint",
        name: "editSporadicTransportAppoint",
        meta: { code: "xtpzgl-yhgl" },
        component: editSporadicTransportAppoint
      },
      //零星物资运输订单
      {
        path: "addOldSporadicOrder",
        name: "addOldSporadicOrder",
        meta: { code: "xtpzgl-jggl" },
        component: addOldSporadicOrder
      },
      {
        path: "oldSporadicOrder",
        name: "oldSporadicOrder",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicOrder
      },
      //零星物资运输执行
      {
        path: "oldSporadicInwardTenfactory",
        name: "oldSporadicInwardTenfactory",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicInwardTenfactory
      },
      {
        path: "oldSporadicInwardGrossWeight",
        name: "oldSporadicInwardGrossWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicInwardGrossWeight
      },
      {
        path: "oldSporadicInwardoutFactory",
        name: "oldSporadicInwardoutFactory",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicInwardoutFactory
      },
      {
        path: "oldSporadicInwardtareWeight",
        name: "oldSporadicInwardtareWeight",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicInwardtareWeight
      },
      {
        path: "oldSporadicInwardUnload",
        name: "oldSporadicInwardUnload",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicInwardUnload
      },
      {
        path: "oldSporadicInwardload",
        name: "oldSporadicInwardload",
        meta: { code: "xtpzgl-yhgl" },
        component: oldSporadicInwardload
      }
    ]
  }
];

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

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