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

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    redirect: "/project"
  },
  // 规划
  {
    path: "/project",
    name: "project",
    component: () => import("@/views/project/index")
  },
  // 结构分析
  {
    path: "/structure",
    name: "structure",
    component: () => import("@/views/structure/index")
  },
  // 调研
  {
    path: "/survey",
    name: "survey",
    component: () => import("@/views/survey/index")
  },
  // 获取调研分析
  {
    path: "/analyse",
    name: "analyse",
    component: () => import("@/views/survey/components/analyse")
  },
  // 功能分析
  {
    path: "/function2",
    name: "fmeaTree",
    component: () => import("@/views/fmeaTree")
  },
  // 风险分析
  {
    path: "/risk",
    name: "risk",
    component: () => import("@/views/riskAnalysis/index")
  },
  // 措施追踪
  {
    path: "/measureTrack",
    name: "measureTrack",
    component: () => import("@/views/measureTrack")
  },
  // 总结归档
  {
    path: "/summaryArchive",
    name: "summaryArchive",
    component: () => import("@/views/summaryArchive")
  }
];

const router = new VueRouter({
  mode: "hash", //history hash
  base: process.env.VUE_APP_MERGE == 1 ? process.env.VUE_APP_BASE_URL_MFE : "",
  routes
});

export default router;
