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[] = [
  {
    path: "/assessment",
    title: "考核设置",
    icon: <Icon component={AssessmentIcon} />,
    redirect: "/assessment/index",
    children: [
      {
        path: "/assessment/index",
        title: "指标设置",
        Component: React.lazy(() => import("../pages/Assessment/Index")),
        children: [
          {
            hide: true,
            path: "/assessment/index/create",
            title: "新增指标",
            Component: React.lazy(
              () => import("../pages/Assessment/Index/CreateOrEdit")
            ),
          },
        ],
      },
      {
        path: "/assessment/template",
        title: "考核模板",
        Component: React.lazy(() => import("../pages/Assessment/Template")),
        children: [
          {
            hide: true,
            path: "/assessment/template/create",
            title: "新增模板",
            Component: React.lazy(
              () => import("../pages/Assessment/Template/CreateOrEdit")
            ),
          },
        ],
      },
    ],
  },
  {
    path: "/management",
    title: "考核管理",
    icon: <Icon component={ManagementIcon} />,
    redirect: "/management/index",
    children: [
      {
        path: "/management/index",
        title: "考核管理",
        Component: React.lazy(() => import("../pages/Management/Index")),
        children: [
          {
            hide: true,
            path: "/management/index/create",
            title: "新增考核",
            Component: React.lazy(
              () => import("../pages/Management/Index/CreateOrEdit")
            ),
          },
          {
            hide: true,
            path: "/management/index/setting-index",
            title: "设置指标",
            Component: React.lazy(
              () => import("../pages/Management/Index/SettingIndex")
            ),
          },
          {
            hide: true,
            path: "/management/index/setting-role",
            title: "设置角色",
            Component: React.lazy(
              () => import("../pages/Management/Index/SettingRole")
            ),
          },
          {
            hide: true,
            meta: {
              custom: true,
            },
            path: "/management/index/detail",
            title: "考核详情",
            Component: React.lazy(() => import("../pages/AssessmentDetail")),
          },
          {
            hide: true,
            path: "/management/index/detail/index",
            title: "考核指标详情",
            Component: React.lazy(
              () => import("../pages/AssessmentDetail/IndexDetail")
            ),
          },
        ],
      },
      {
        path: "/management/form",
        title: "考核填报",
        Component: React.lazy(() => import("../pages/Management/Form")),
        children: [
          {
            hide: true,
            meta: {
              custom: true,
            },
            path: "/management/form/detail",
            title: "考核详情",
            Component: React.lazy(() => import("../pages/AssessmentDetail")),
          },
          {
            hide: true,
            path: "/management/form/detail/index",
            title: "考核指标详情",
            Component: React.lazy(
              () => import("../pages/AssessmentDetail/IndexDetail")
            ),
          },
        ],
      },
      {
        path: "/management/evaluation",
        title: "考核评定",
        Component: React.lazy(() => import("../pages/Management/Evaluation")),
        children: [
          {
            hide: true,
            meta: {
              custom: true,
            },
            path: "/management/evaluation/detail",
            title: "考核详情",
            Component: React.lazy(() => import("../pages/AssessmentDetail")),
          },
          {
            hide: true,
            path: "/management/evaluation/detail/index",
            title: "考核指标详情",
            Component: React.lazy(
              () => import("../pages/AssessmentDetail/IndexDetail")
            ),
          },
          {
            hide: true,
            path: "/management/evaluation/detail/submit",
            title: "考核指标详情",
            Component: React.lazy(
              () => import("../pages/AssessmentDetail/IndexDetail")
            ),
          },
        ],
      },
      {
        path: "/management/files",
        title: "附件管理",
        Component: React.lazy(() => import("../pages/Management/Files")),
      },
    ],
  },
  {
    path: "perfomance",
    title: "绩效分析",
    redirect: "/perfomance/report",
    icon: <Icon component={PerfomanceIcon} />,
    children: [
      {
        path: "/perfomance/report",
        title: "指标分析",
        Component: React.lazy(() => import("../pages/Performance/Report")),
      },
      {
        path: "/perfomance/form",
        title: "考核报告",
        Component: React.lazy(() => import("../pages/Performance/Form")),
      },
    ],
  },
];

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/log",
        title: "操作日志",
        Component: React.lazy(() => import("../pages/Log")),
      },
    ],
  },
];

export * from "./types";
