import { RouteName } from "./routeName";
import { appConstant, appRoutes } from "@/app";

export { RouteName };
export type Routes = Route[];
export type RouteMeta = { title: string; icon?: string };
export type Route = {
  name: string;
  path: string;
  component: any;
  meta: RouteMeta;
  children?: Routes;
};

export const system: Routes = [
  {
    name: RouteName.login,
    path: "/login/:caseId",
    component:
    appConstant.loginComponent || (() => import("@/view/system/index.vue")),
    meta: { title: "登录" },
  },
  // {
  //   name: RouteName.register,
  //   path: "/register",
  //   component: () => import("@/view/system/index.vue"),
  //   meta: { title: "注册" },
  // },
  // {
  //   name: RouteName.forget,
  //   path: "/forget",
  //   component: () => import("@/view/system/index.vue"),
  //   meta: { title: "重置密码" },
  // },
];

export const routes: Routes = [
  {
    name: RouteName.viewLayout,
    path: "/",
    component: () => import("@/view/layout/index.vue"),
    meta: { title: "VR看房管理" },
    children: [
      ...system,
      {
        name: RouteName.vrmodel,
        path: "home/:caseId",
        component: () => import("@/view/vrmodel/index.vue"),
        
        meta: { title: "实景三维", icon: "icon-shiyongwendang" },
      },  
      {
        name: RouteName.diversity,
        path: "diversity/:caseId",
        component: () => import("@/view/diversity/index.vue"),
        
        meta: { title: "多元融合", icon: "icon-shiyongwendang" },
      },
      {
        name: RouteName.abstract,
        path: "abstract/:caseId",
        component: () => import("@/view/abstract/index.vue"),
        meta: { title: "简要案情", icon: "icon-liebiao" },
      },
      {
        name: RouteName.originalPhoto,
        path: "originalPhoto/:caseId",
        component: () => import("@/view/originalPhoto/index.vue"),
        meta: { title: "原始照片", icon: "icon-zhaopian" },
      },
      // {
      //   name: RouteName.material,
      //   path: "material/:caseId",
      //   component: () => import("@/view/material/index.vue"),
      //   meta: { title: "三录材料", icon: "icon-tidangan" },
      // },
      {
        name: RouteName.photos,
        path: "photos/:caseId",
        component: () => import("@/view/material/photos.vue"),
        meta: { title: "痕迹物证", icon: "icon-tidangan" },
      },
      // {
      //   name: RouteName.rollMaking,
      //   path: "rollMaking/:caseId",
      //   component: () => import("@/view/material/rollMaking.vue"),
      //   meta: { title: "平面图", icon: "icon-tidangan" },
      // },
      {
        name: RouteName.sceneImg,
        path: "sceneImg/:caseId",
        component: () => import("@/view/material/sceneImg.vue"),
        meta: { title: "三录材料", icon: "icon-tidangan" },
      },
      // {
      //   name: RouteName.other,
      //   path: "other/:caseId",
      //   component: () => import("@/view/other/index.vue"),
      //   meta: { title: "其他材料", icon: "icon-fuzhi" },
      // },
      // {
      //   name: RouteName.aiList,
      //   path: "aiList/:caseId",
      //   component: () => import("@/view/aiList/index.vue"),
      //   meta: { title: "AI 勘查", icon: "icon-chaxun" },
      // },
      {
        name: RouteName.dossier,
        path: "dossier/:caseId",
        component: () => import("@/view/dossier/index.vue"),
        meta: { title: "案件卷宗", icon: "icon-juanzongguanli" },
      },
      {
        name: RouteName.camera,
        path: "camera",
        component: () => import("@/view/camera/index.vue"),
        meta: { title: "相机管理", icon: "iconfire_camera" },
      },
      ...appRoutes,
      {
        name: RouteName.organization,
        path: "organization",
        component: () => import("@/view/organization/index.vue"),
        meta: { title: "组织架构", icon: "iconfire_organization" },
      },
      {
        name: RouteName.role,
        path: "role",
        component: () => import("@/view/role/index.vue"),
        meta: { title: "角色管理", icon: "iconfire_role_management" },
      },
      {
        name: RouteName.user,
        path: "user",
        component: () => import("@/view/user/index.vue"),
        meta: { title: "用户管理", icon: "iconfire_user" },
      },
      {
        name: RouteName.statistics,
        path: "/statistics",
        component: () => import("@/view/statistics/index.vue"),
        meta: { title: "数据统计", icon: "icon-fire_statistics" },
      },
      {
        name: RouteName.downloadLog,
        path: "download-log",
        component: () => import("@/view/vrmodel/downloadLog.vue"),
        meta: { title: "下载记录", icon: "icon-query_home" },
      },
      {
        name: RouteName.caseFile,
        path: "case/file/:caseId",
        component: () => import("@/view/case/caseFile.vue"),
        meta: { title: "卷宗管理" },
      },
      {
        name: RouteName.drawCasePhotos,
        path: "/case/photos/:caseId",
        component: () => import("@/view/case/photos/index.vue"),
        meta: { title: "照片制卷" },
      },
      {
        name: RouteName.records,
        path: "/case/records/:caseId/:fileId",
        component: () => import("@/view/case/records/index.vue"),
        meta: { title: "现场勘验笔录" },
      },
    ],
  },
  {
    name: RouteName.drawCaseFile,
    path: "/case/file/:caseId/:type/:id",
    component: () => import("@/view/case/draw/index.vue"),
    meta: { title: "绘制卷宗图" },
  },
  {
    name: 'drawShareFile',
    path: "/share/file",
    component: () => import("@/view/case/draw/share.vue"),
    meta: { title: "绘制卷宗图" },
  },
];
