From fa3d02ea8341776bdb1c0fcc2204a66256637bd8 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 19 Jan 2026 19:50:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(layout):=20=E6=B7=BB=E5=8A=A0=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E7=94=9F=E6=88=90=E8=8F=9C=E5=8D=95=E9=A1=B9=E5=B9=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=96=E9=83=A8=E9=93=BE=E6=8E=A5=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在侧边栏菜单中新增内容生成选项 - 集成 Sparkles 图标用于内容生成功能 - 为菜单项添加外部链接跳转功能 - 实现点击外部链接时在新标签页打开 - 更新菜单配置以支持外部链接属性 --- frontend/src/pages/Layout/Sidebar.tsx | 6 ++++++ frontend/src/pages/Layout/menu.tsx | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/frontend/src/pages/Layout/Sidebar.tsx b/frontend/src/pages/Layout/Sidebar.tsx index 06a5da3..71ffb00 100644 --- a/frontend/src/pages/Layout/Sidebar.tsx +++ b/frontend/src/pages/Layout/Sidebar.tsx @@ -108,6 +108,12 @@ const AsiderAndHeaderLayout = () => { selectedKeys={[activeItem]} defaultOpenKeys={["synthesis"]} onClick={({ key }) => { + // 查找菜单项,检查是否有外部链接 + const menuItem = menuItems.find((item) => item.id === key); + if (menuItem?.externalLink) { + window.open(menuItem.externalLink, "_blank"); + return; + } setActiveItem(key); navigate(`/data/${key}`); }} diff --git a/frontend/src/pages/Layout/menu.tsx b/frontend/src/pages/Layout/menu.tsx index eb33bb2..c442354 100644 --- a/frontend/src/pages/Layout/menu.tsx +++ b/frontend/src/pages/Layout/menu.tsx @@ -8,6 +8,7 @@ import { GitBranch, Zap, Shield, + Sparkles, // Database, // Store, // Merge, @@ -42,6 +43,14 @@ export const menuItems = [ description: "对数据进行标注和标记", color: "bg-green-500", }, + { + id: "content-generation", + title: "内容生成", + icon: Sparkles, + description: "智能内容生成与创作", + color: "bg-purple-500", + externalLink: "https://www.baidu.com", + }, // { // id: "synthesis", // title: "数据合成",