import Login from "@/views/login/index.vue";
import RouterViewWrapper from "@/components/layout/RouterViewWrapper.vue";

// 静态路由
export const constantRoutes = [
  { path: "/", redirect: "/login" },
  {
    path: "/login",
    name: "Login",
    component: Login,
    meta: { title: "登录", layout: false, role: "public" },
  },

  // ========== 医院端（顶部菜单布局） ==========
  {
    path: "/hospital",
    component: RouterViewWrapper,
    redirect: "/hospital/workbench",
    meta: { title: "医院端", layoutType: "hospital", role: "Hospital" },
    children: [
      {
        path: "workbench",
        name: "HospitalWorkbench",
        component: () => import("@/views/hospital/workbench.vue"),
        meta: { title: "我的工作台", icon: "hospital-router-yy-gzt" },
      },
      {
        path: "orders",
        name: "HospitalOrders",
        component: () => import("@/views/hospital/orders/list.vue"),
        meta: { title: "我的工单", icon: "hospital-router-yy-gd" },
      },
      {
        path: "orders/detail/:id",
        name: "HospitalOrderDetail",
        component: () => import("@/views/hospital/orders/detail.vue"),
        meta: { title: "工单详情", hidden: true },
      },
      {
        path: "points",
        name: "HospitalPoints",
        component: () => import("@/views/hospital/points.vue"),
        meta: { title: "我的积分", icon: "hospital-router-yy-jf" },
      },
      // {
      //   path: "password",
      //   name: "HospitalPassword",
      //   component: () => import("@/views/hospital/password.vue"),
      //   meta: { title: "修改密码", hidden: true },
      // },
    ],
  },

  // ========== 管理端（顶部水平菜单布局） ==========
  {
    path: "/admin",
    component: RouterViewWrapper,
    redirect: "/admin/orders",
    meta: { title: "管理端", layoutType: "admin", role: "Admin" },
    children: [
      // 服务工单
      {
        path: "orders",
        name: "AdminOrders",
        component: () => import("@/views/admin/orders/list.vue"),
        meta: { title: "服务工单", icon: "admin-router-fuwu-gd" },
      },
      // 服务报告
      {
        path: "orders/report",
        name: "AdminOrderReport",
        component: () => import("@/views/admin/orders/report.vue"),
        meta: { title: "服务报告", icon: "admin-router-fuwu-bg" },
      },
      // 医院信息
      {
        path: "hospitals",
        name: "AdminHospitals",
        component: () => import("@/views/admin/hospitals/list.vue"),
        meta: { title: "医院信息", icon: "admin-router-yiyuan-xx" },
      },
      // 客户服务
      {
        path: "hospitals/service",
        name: "AdminHospitalService",
        component: () => import("@/views/admin/hospitals/service.vue"),
        meta: { title: "客户服务", icon: "admin-router-kehu-fw" },
      },
      // 客户经理积分
      {
        path: "performance/score",
        name: "AdminPerformanceScore",
        component: () => import("@/views/admin/performance/score.vue"),
        meta: { title: "客户经理积分", icon: "admin-router-kehu-jljf" },
      },
      // 账号管理
      {
        path: "accounts",
        name: "AdminAccounts",
        component: () => import("@/views/admin/accounts/list.vue"),
        meta: { title: "账号管理", icon: "admin-router-zhanghao-gl" },
      },
      {
        path: "accounts/edit/:id?",
        name: "AdminAccountEdit",
        component: () => import("@/views/admin/accounts/edit.vue"),
        meta: { title: "编辑账号", hidden: true },
      },
    ],
  },

  { path: "/:pathMatch(.*)*", redirect: "/login" },
];
