diff --git a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx index b58cd09..a526737 100644 --- a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx +++ b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useRef, useState } from "react"; import { App, Button, Card, List, Spin, Typography } from "antd"; -import { LeftOutlined, ReloadOutlined, SaveOutlined } from "@ant-design/icons"; +import { LeftOutlined, ReloadOutlined, SaveOutlined, MenuFoldOutlined, MenuUnfoldOutlined } from "@ant-design/icons"; import { useNavigate, useParams } from "react-router"; import { @@ -54,6 +54,7 @@ export default function LabelStudioTextEditor() { const [project, setProject] = useState(null); const [tasks, setTasks] = useState([]); const [selectedFileId, setSelectedFileId] = useState(""); + const [sidebarCollapsed, setSidebarCollapsed] = useState(false); const postToIframe = (type: string, payload?: any) => { const win = iframeRef.current?.contentWindow; @@ -128,15 +129,29 @@ export default function LabelStudioTextEditor() { labelConfig: project.labelConfig, task, user: { id: "datamate" }, + // 完整的 Label Studio 原生界面配置 interfaces: [ - "panel", - "update", - "controls", + // 核心面板 + "panel", // 导航面板(undo/redo/reset) + "update", // 更新按钮 + "submit", // 提交按钮 + "controls", // 控制面板 + // 侧边栏(包含 Outliner 和 Details) "side-column", + // 标注管理 "annotations:tabs", "annotations:menu", "annotations:current", + "annotations:add-new", + "annotations:delete", + "annotations:view-all", "annotations:history", + // 预测 + "predictions:tabs", + "predictions:menu", + // 其他 + "auto-annotation", + "edit-history", ], selectedAnnotationIndex: 0, allowCreateEmptyAnnotation: true, @@ -282,19 +297,25 @@ export default function LabelStudioTextEditor() { } return ( -
-
+
+ {/* 顶部工具栏 */} +
- - 标注 +
-
- + {/* 左侧文件列表 - 可折叠 */} +
- ( - setSelectedFileId(item.fileId)} - > -
-
- {item.fileName} - - {item.hasAnnotation ? "已标注" : "未标注"} +
+ 文件列表 +
+
+ ( + setSelectedFileId(item.fileId)} + > +
+ + {item.fileName} +
+ + {item.hasAnnotation ? "已标注" : "未标注"} + + {item.annotationUpdatedAt && ( + + {item.annotationUpdatedAt} + + )} +
- {item.annotationUpdatedAt && ( - - 更新: {item.annotationUpdatedAt} - - )} -
- - )} - /> - - - -
- {(!iframeReady || loadingTaskDetail || (selectedFileId && !lsReady)) && ( -
- -
- )} -