import React from "react";
import Icon from "@ant-design/icons";
import { DageRouteItem } from "./types";
import { ReactComponent as SettingIcon } from "@/assets/icons/systems.svg";
import { ReactComponent as AssessmentIcon } from "@/assets/icons/icon_check.svg";
import { ReactComponent as ManagementIcon } from "@/assets/icons/icon_management.svg";
import { ReactComponent as PerfomanceIcon } from "@/assets/icons/icon_achievements.svg";

export const DEFAULT_MENU: DageRouteItem[] = [
  {
    mapId: 100,
    path: "/assessment",
    title: "考核设置",
    icon: <Icon component={AssessmentIcon} />,
    redirect: "/assessment/index",
    children: [
      {
        mapId: 110,
        path: "/assessment/index",
        title: "指标设置",
        Component: React.lazy(() => import("../pages/Assessment/Index")),
        children: [
          {
            mapId: 111,
            hide: true,
            path: "/assessment/index/create/:type",
            title: "新增指标",
            Component: React.lazy(
              () => import("../pages/Assessment/Index/CreateOrEdit")
            ),
          },
          {
            mapId: 112,
            hide: true,
            path: "/assessment/index/edit/:type/:id",
            title: "编辑指标",
            Component: React.lazy(
              () => import("../pages/Assessment/Index/CreateOrEdit")
            ),
          },
        ],
      },
      {
        mapId: 120,
        path: "/assessment/template",
        title: "考核模板",
        Component: React.lazy(() => import("../pages/Assessment/Template")),
        children: [
          {
            mapId: 121,
            hide: true,
            path: "/assessment/template/create/:type",
            title: "新增模板",
            Component: React.lazy(
              () => import("../pages/Assessment/Template/CreateOrEdit")
            ),
          },
          {
            mapId: 122,
            hide: true,
            path: "/assessment/template/edit/:type/:id",
            title: "编辑模板",
            Component: React.lazy(
              () => import("../pages/Assessment/Template/CreateOrEdit")
            ),
          },
        ],
      },
    ],
  },
  {
    mapId: 200,
    path: "/management",
    title: "考核管理",
    icon: <Icon component={ManagementIcon} />,
    redirect: "/management/index",
    children: [
      {
        mapId: 210,
        path: "/management/index",
        title: "考核管理",
        Component: React.lazy(() => import("../pages/Management/Index")),
        children: [
          {
            mapId: 211,
            hide: true,
            path: "/management/index/create/:type",
            title: "新增考核",
            Component: React.lazy(
              () => import("../pages/Management/Index/CreateOrEdit")
            ),
          },
          {
            mapId: 212,
            hide: true,
            path: "/management/index/edit/:type/:id",
            title: "编辑考核",
            Component: React.lazy(
              () => import("../pages/Management/Index/CreateOrEdit")
            ),
          },
          {
            mapId: 213,
            hide: true,
            path: "/management/index/setting-index/:type/:id",
            title: "设置指标",
            Component: React.lazy(
              () => import("../pages/Management/Index/SettingIndex")
            ),
          },
          {
            mapId: 214,
            hide: true,
            path: "/management/index/setting-role/:type/:id/:status",
            title: "设置角色",
            Component: React.lazy(
              () => import("../pages/Management/Index/SettingRole")
            ),
          },
          {
            mapId: 215,
            hide: true,
            meta: {
              custom: true,
            },
            path: "/management/index/detail/:id",
            title: "考核详情",
            Component: React.lazy(() => import("../pages/AssessmentDetail")),
          },
          {
            mapId: 216,
            hide: true,
            path: "/management/index/detail/:id/index",
            title: "考核指标详情",
            Component: React.lazy(
              () => import("../pages/AssessmentDetail/IndexDetail")
            ),
          },
        ],
      },
      {
        mapId: 220,
        path: "/management/form",
        title: "考核填报",
        Component: React.lazy(() => import("../pages/Management/Form")),
        children: [
          {
            mapId: 221,
            hide: true,
            meta: {
              custom: true,
            },
            path: "/management/form/detail/:id/:accessId",
            title: "考核详情",
            Component: React.lazy(() => import("../pages/AssessmentDetail")),
          },
          {
            mapId: 222,
            hide: true,
            path: "/management/form/detail/index",
            title: "考核指标详情",
            Component: React.lazy(
              () => import("../pages/AssessmentDetail/IndexDetail")
            ),
          },
        ],
      },
      {
        mapId: 230,
        path: "/management/evaluation",
        title: "考核评定",
        Component: React.lazy(() => import("../pages/Management/Evaluation")),
        children: [
          {
            mapId: 231,
            hide: true,
            meta: {
              custom: true,
            },
            path: "/management/evaluation/detail/:id",
            title: "考核详情",
            Component: React.lazy(() => import("../pages/AssessmentDetail")),
          },
          {
            mapId: 232,
            hide: true,
            path: "/management/evaluation/detail/index",
            title: "考核指标详情",
            Component: React.lazy(
              () => import("../pages/AssessmentDetail/IndexDetail")
            ),
          },
        ],
      },
      {
        mapId: 240,
        path: "/management/files",
        title: "附件管理",
        Component: React.lazy(() => import("../pages/Management/Files")),
      },
    ],
  },
  {
    mapId: 300,
    path: "/perfomance",
    title: "绩效分析",
    redirect: "/perfomance/report",
    icon: <Icon component={PerfomanceIcon} />,
    children: [
      {
        mapId: 310,
        path: "/perfomance/report",
        title: "指标分析",
        Component: React.lazy(() => import("../pages/Performance/Report")),
      },
      {
        mapId: 320,
        path: "/perfomance/form",
        title: "考核报告",
        Component: React.lazy(() => import("../pages/Performance/Form")),
        children: [
          {
            hide: true,
            path: "/perfomance/form/create/:id",
            title: "新增报告",
            Component: React.lazy(
              () => import("../pages/Performance/Form/Edit")
            ),
          },
          {
            hide: true,
            path: "/perfomance/form/edit/:id",
            title: "编辑报告",
            Component: React.lazy(
              () => import("../pages/Performance/Form/Edit")
            ),
          },
        ],
      },
    ],
  },
];

export const DEFAULT_ADMIN_MENU: DageRouteItem[] = [
  {
    path: "/setting",
    title: "系统设置",
    icon: <Icon component={SettingIcon} />,
    children: [
      {
        path: "/setting/user",
        title: "用户管理",
        Component: React.lazy(() => import("../pages/User")),
      },
      {
        path: "/setting/role",
        title: "角色管理",
        Component: React.lazy(() => import("../pages/User/role")),
        children: [
          {
            hide: true,
            path: "/setting/role/create",
            title: "新增角色",
            Component: React.lazy(() => import("../pages/User/RoleEdit")),
          },
          {
            hide: true,
            path: "/setting/role/edit/:id",
            title: "编辑角色",
            Component: React.lazy(() => import("../pages/User/RoleEdit")),
          },
        ],
      },
      {
        path: "/setting/log",
        title: "操作日志",
        Component: React.lazy(() => import("../pages/Log")),
      },
    ],
  },
];

export * from "./types";
