/**
 * 路由配置
 */
import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
  {
    path: "/",
    name: "login",
    component: () => import("../pages/login/index"),
  },
  {
    path: "/Home",
    name: "Home",
    component: () => import("../pages/newHome/index"),
  },
  // 新增：Greeting message 转换页面
  {
    path: "/checkInPage",
    name: "checkInPage",
    component: () => import("../pages/checkInPage/index.vue"),
  },
  {
    path: "/traffic-alerts",
    name: "traffic-alerts",
    component: () => import("../pages/trafficAlerts/index.vue"),
  },
  {
    path: "/traffic-alert-detail",
    name: "traffic-alert-detail",
    component: () => import("../pages/trafficAlerts/detail.vue"),
  },
  {
    path: "/violation-alerts",
    name: "violation-alerts",
    component: () => import("../pages/violationAlerts/index.vue"),
  },
  {
    path: "/violation-detail",
    name: "violation-detail",
    component: () => import("../pages/violationAlerts/detail.vue"),
  },
  {
    path: "/alert-handle",
    name: "alert-handle",
    component: () => import("../pages/alertHandle/index.vue"),
  },
  {
    path: "/map",
    name: "map",
    component: () => import("../pages/map/index.vue"),
  },
  {
    path: "/video-monitor",
    name: "video-monitor",
    component: () => import("../pages/videoMonitor/index.vue"),
  },
  {
    path: "/videoMonitorMap",
    name: "videoMonitorMap",
    component: () => import("../pages/videoMonitorMap/index.vue"),
  },
  {
    path: "/warningList",
    name: "warningList",
    component: () => import("../pages/warningList/index.vue"),
  },
  // 新增：Greeting message 完整转换页面
  {
    path: "/keyDetection",
    name: "keyDetection",
    component: () => import("../pages/keyDetection/index.vue"),
  },
  {
    path: "/keyDetection/detail",
    name: "keyDetection-detail",
    component: () => import("../pages/keyDetection/detail.vue"),
  },
  {
    path: "/keyVehicle",
    name: "keyVehicle",
    component: () => import("../pages/keyVehicle/index.vue"),
  },
  {
    path: "/keyVehicle/detail",
    name: "keyVehicle-detail",
    component: () => import("../pages/keyVehicle/detail.vue"),
  },

  {
    path: "/dataReport",
    name: "dataReport",
    component: () => import("../pages/dataReport/index.vue"),
  },
  {
    path: "/ssp-report",
    name: "ssp-report",
    component: () => import("../pages/sspReport/index.vue"),
  },
  {
    path: "/error",
    name: "error",
    component: () => import("../pages/error/index"),
  },

  {
    path: "/my",
    name: "my",
    component: () => import("../pages/my/index"),
  },
  {
    path: "/clockInPage",
    name: "clockInPage",
    component: () => import("../pages/clockInPage/index"),
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  routes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return {
        left: 0,
        top: 0,
      };
    }
  },
});

export default router;
