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

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

// 主要
import main from "@/components/main.vue";
// 系统配置管理
import ShipDynamicTable from "../components/Ship_dynamic_table.vue";
import purchaseAccessoriesMonitor from "../components/purchaseAccessoriesMonitor.vue";
import purchasFuelOldMonitor from "../components/purchasFuelMonitor/purchasFuelOldMonitor.vue";
import purchasFuelNewMonitor from "../components/purchasFuelMonitor/purchasFuelNewMonitor.vue";
import sporadicReportEnterFactory from "../components/sporadicReport/sporadicReportEnterFactory.vue";
import sporadicReportExFactory from "../components/sporadicReport/sporadicReportExFactory.vue";
import saleChemicalCokeForm from "../components/salesLogisticsStatistics/saleChemicalCokeForm.vue";
import saleCoproductForm from "../components/salesLogisticsStatistics/saleCoproductForm.vue";
import saleSteelForm from "../components/salesLogisticsStatistics/saleSteelForm.vue";
import transportationPerformance from "../components/salesLogisticsStatistics/transportationPerformance.vue";
import purchaseChemicalMaterialsNew from "../components/purchaseChemicalMaterials/purchaseChemicalMaterialsNew.vue";
import purchaseChemicalMaterialsOld from "../components/purchaseChemicalMaterials/purchaseChemicalMaterialsOld.vue";
import purInwardReport from "../components/inwardReport/putInwardReport.vue";
import inwardFactory from "../components/inwardReport/inwardFactory.vue";
import getLoading from "../components/inwardReport/getLoading.vue";
import getUnLoading from "../components/inwardReport/getUnLoading.vue";
import purchaseMineral from "../components/purachaseMineral.vue";
import inwardSporadicReport from "../components/sporadicReport/inwardSporadicReport.vue";
import getInstall from "../components/inwardReport/getInstall.vue";
import getCapacityByDefend from "../components/defendCapacity/getCapacityByDefend.vue";
import inwardAssemble from "../components/inwardAssemble/inwardAssemble.vue";
import loadCapacityDetail from "../components/loadCapacityDetail/loadCapacityDetail.vue";
import allInwardReport from "../components/inwardReport/allInwardReport.vue";
import saleSteelAllReport from "../components/salesLogisticsStatistics/saleSteelAllReport.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: "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
      }
    ]
  }
];
const router = new Router({
  routes: constantRouterMap
});
//  before
routerBefore(router, constantRouterMap);

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