feat(layout): 添加内容生成菜单项并支持外部链接跳转

- 在侧边栏菜单中新增内容生成选项
- 集成 Sparkles 图标用于内容生成功能
- 为菜单项添加外部链接跳转功能
- 实现点击外部链接时在新标签页打开
- 更新菜单配置以支持外部链接属性
This commit is contained in:
2026-01-19 19:50:04 +08:00
parent 21cc505f97
commit fa3d02ea83
2 changed files with 15 additions and 0 deletions

View File

@@ -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}`);
}}

View File

@@ -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: "数据合成",