From d68dd75be59aa258b1d83f7bf3b3f40f18af2e03 Mon Sep 17 00:00:00 2001 From: zhangheng Date: Sat, 11 Apr 2026 17:38:26 +0800 Subject: [PATCH] fix(layout): common --- components/layout/common.ts | 20 ++++----- components/layout/components/ClientIcon.tsx | 46 +++++++++++++++------ 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/components/layout/common.ts b/components/layout/common.ts index d6f3276..c19782b 100644 --- a/components/layout/common.ts +++ b/components/layout/common.ts @@ -12,12 +12,12 @@ const currentComponentList: MenuItem[] = [ { title: "图片标注", url: "project", - icon: "SystemIcon", + icon: "ImageAnnotationIcon", items: [ { title: "我的项目", url: "own", - icon: "PersonalMenuIcon", + icon: "MyProjectsIcon", }, ], }, @@ -27,23 +27,23 @@ export const componentList: MenuItem[] = [ { title: "个人中心", url: "person", - icon: "PersonalMenuIcon", + icon: "PersonalCenterIcon", }, ...currentComponentList, { title: "视频标注", url: "video", - icon: "SystemIcon", + icon: "VideoAnnotationIcon", + }, + { + title: "点云标注", + url: "lidar", + icon: "LidarAnnotationIcon", }, - // { - // title: "点云标注", - // url: "lidar", - // icon: "SystemIcon", - // }, { title: "管理中心", url: "mgt", - icon: "SystemIcon", + icon: "ManagementCenterIcon", }, ] diff --git a/components/layout/components/ClientIcon.tsx b/components/layout/components/ClientIcon.tsx index 273efcc..480455a 100644 --- a/components/layout/components/ClientIcon.tsx +++ b/components/layout/components/ClientIcon.tsx @@ -1,14 +1,39 @@ -// import { type LucideIcon } from "lucide-react"; - import { - AuthMenuIcon, - PersonalMenuIcon, - SystemIcon, - TaskMenuIcon, -} from "./icons/custom" + IconCategory2, + IconCube3dSphere, + IconFileText, + IconFolder, + IconFolders, + IconHierarchy3, + IconLayoutDashboard, + IconPhoto, + IconSettings, + IconUserCircle, + IconUsersGroup, + IconVideo, +} from "@tabler/icons-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< HTMLDivElement, React.ComponentProps<"button"> & { @@ -16,12 +41,7 @@ export const ClientIcon = React.forwardRef< } >(({ icon, ...props }, _ref) => { if (icon) { - const IconComponent = { - SystemIcon, - PersonalMenuIcon, - TaskMenuIcon, - AuthMenuIcon, - }[icon] + const IconComponent = iconMap[icon as keyof typeof iconMap] return IconComponent ? : null } else { return null