fix(layout): common

This commit is contained in:
zhangheng
2026-04-11 17:38:26 +08:00
parent fe1182cb55
commit d68dd75be5
2 changed files with 43 additions and 23 deletions

View File

@@ -12,12 +12,12 @@ const currentComponentList: MenuItem[] = [
{ {
title: "图片标注", title: "图片标注",
url: "project", url: "project",
icon: "SystemIcon", icon: "ImageAnnotationIcon",
items: [ items: [
{ {
title: "我的项目", title: "我的项目",
url: "own", url: "own",
icon: "PersonalMenuIcon", icon: "MyProjectsIcon",
}, },
], ],
}, },
@@ -27,23 +27,23 @@ export const componentList: MenuItem[] = [
{ {
title: "个人中心", title: "个人中心",
url: "person", url: "person",
icon: "PersonalMenuIcon", icon: "PersonalCenterIcon",
}, },
...currentComponentList, ...currentComponentList,
{ {
title: "视频标注", title: "视频标注",
url: "video", url: "video",
icon: "SystemIcon", icon: "VideoAnnotationIcon",
},
{
title: "点云标注",
url: "lidar",
icon: "LidarAnnotationIcon",
}, },
// {
// title: "点云标注",
// url: "lidar",
// icon: "SystemIcon",
// },
{ {
title: "管理中心", title: "管理中心",
url: "mgt", url: "mgt",
icon: "SystemIcon", icon: "ManagementCenterIcon",
}, },
] ]

View File

@@ -1,14 +1,39 @@
// import { type LucideIcon } from "lucide-react";
import { import {
AuthMenuIcon, IconCategory2,
PersonalMenuIcon, IconCube3dSphere,
SystemIcon, IconFileText,
TaskMenuIcon, IconFolder,
} from "./icons/custom" IconFolders,
IconHierarchy3,
IconLayoutDashboard,
IconPhoto,
IconSettings,
IconUserCircle,
IconUsersGroup,
IconVideo,
} from "@tabler/icons-react"
import React from "react" import React from "react"
const iconMap = {
DashboardIcon: IconLayoutDashboard,
EmployeeManagementIcon: IconUsersGroup,
ImageAnnotationIcon: IconPhoto,
LidarAnnotationIcon: IconCube3dSphere,
ManagementCenterIcon: IconSettings,
MyProjectsIcon: IconFolder,
PersonalCenterIcon: IconUserCircle,
ProjectCategoryIcon: IconCategory2,
ProjectManagementIcon: IconFolders,
ReportIcon: IconFileText,
TeamManagementIcon: IconHierarchy3,
VideoAnnotationIcon: IconVideo,
SystemIcon: IconSettings,
PersonalMenuIcon: IconUserCircle,
TaskMenuIcon: IconLayoutDashboard,
AuthMenuIcon: IconFileText,
} as const
export const ClientIcon = React.forwardRef< export const ClientIcon = React.forwardRef<
HTMLDivElement, HTMLDivElement,
React.ComponentProps<"button"> & { React.ComponentProps<"button"> & {
@@ -16,12 +41,7 @@ export const ClientIcon = React.forwardRef<
} }
>(({ icon, ...props }, _ref) => { >(({ icon, ...props }, _ref) => {
if (icon) { if (icon) {
const IconComponent = { const IconComponent = iconMap[icon as keyof typeof iconMap]
SystemIcon,
PersonalMenuIcon,
TaskMenuIcon,
AuthMenuIcon,
}[icon]
return IconComponent ? <IconComponent style={{ ...props.style }} /> : null return IconComponent ? <IconComponent style={{ ...props.style }} /> : null
} else { } else {
return null return null