import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "index",
    component: () => import("@/views/index.vue"),
    meta: {
      title: import.meta.env.VITE_APP_TITLE
    }
  },
  {
    path: "/yzy/callback",
    name: "YzyCallback",
    component: () => import('@/components/YzyCallback/index.vue')
  },
  {
    path: "/leader/index",
    name: "LeaderIndex",
    component: () => import('@/views/leader/index.vue')
  },
  {
    path: "/mobile_control2/index",
    name: "MobileControl2",
    component: () => import('@/views/mobileControl2/index.vue')
  },
  /*
  {
    path: "/leader",
    name: "Leader",
    component: Layout,
    redirect: { name: "LeaderIndex" },
    children: [
      {
        path: "index",
        name: "LeaderIndex",
        component: () => import("@/views/leader/index.vue"),
        meta: {
          title: "首页",
          noCache: true
        }
      },
      {
        path: "mobile_control",
        name: "MobileControl",
        component: () => import("@/views/mobileControl/index.vue"),
        meta: {
          title: "移动指挥（平时态）",
          noCache: true
        }
      },
      {
        path: "mobile_control2",
        name: "MobileControl2",
        component: () => import("@/views/mobileControl2/index.vue"),
        meta: {
          title: "移动指挥（应急态）",
          noCache: true
        }
      },
      {
        path: "address_book",
        name: "AddressBook",
        component: () => import("@/views/addressBook/index.vue"),
        meta: {
          title: "通讯录",
          noCache: true
        }
      },
      {
        path: "my",
        name: "My",
        component: () => import("@/views/about/index.vue"),
        meta: {
          title: "我",
          noCache: true
        }
      }
    ]
  },*/
  {
    path: "/worker",
    name: "Worker",
    component: Layout,
    redirect: { name: "WokerIndex" },
    children: [
      {
        path: "index2",
        name: "WokerIndex",
        component: () => import("@/views/worker/index.vue"),
        meta: {
          title: "主页3"
        }
      },
      {
        path: "about2",
        name: "About",
        component: () => import("@/views/about/index.vue"),
        meta: {
          title: "关于3",
          noCache: true
        }
      }
    ]
  },
  {
    path: "/event/index",
    name: "EventList",
    component: () => import("@/views/event/index.vue"),
    meta: {
      title: "事件列表"
    }
  },
  {
    path: "/event/detail",
    name: "EventDetail",
    component: () => import("@/views/event/detail.vue"),
    meta: {
      title: "事件详情页",
      noCache: true
    }
  },
  {
    path: "/signPage",
    name: "signPage",
    component: () => import("@/views/signPage/index.vue"),
    meta: {
      title: "签到签退"
    }
  },
  {
    path: "/signOK",
    name: "signOK",
    component: () => import("@/views/signPage/signok.vue"),
    meta: {
      title: "签到签退成功"
    }
  }
];

export default routes;
