import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Index",
    // component: () => import("@/views/VoltageSag_BJ/index.vue"), // 懒加载组件
    component: () =>
      import(
        import.meta.env.VITE_NAME == "wuxi"
          ? "@/views/SagTraceResult_WX/index.vue"
          : "@/views/VoltageSag_BJ/index.vue"
      ), // 懒加载组件
  },
  {
    path: "/VoltageSag", //电压暂降监测平台_北京
    name: "VoltageSag",
    component: () => import("@/views/VoltageSag_BJ/index.vue"), // 懒加载组件
  },
  {
    path: "/SagTraceResult", //暂降溯源演示平台_无锡
    name: "SagTraceResult",
    component: () => import("@/views/SagTraceResult_WX/index.vue"), // 懒加载组件
  },
];

const base_url = import.meta.env.BASE_URL; //获取vite.config.js配置的base,默认是根目录/

const router = createRouter({
  history: createWebHashHistory(base_url),
  routes,
});

export default router;
