diff --git a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx index c8e3017..18b2a21 100644 --- a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx +++ b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx @@ -264,6 +264,10 @@ export default function LabelStudioTextEditor() { () => (project?.datasetType || "").toUpperCase() === "TEXT", [project?.datasetType], ); + const segmentIndices = useMemo(() => { + if (segmentTotal <= 0) return [] as number[]; + return Array.from({ length: segmentTotal }, (_, index) => index); + }, [segmentTotal]); const focusIframe = useCallback(() => { const iframe = iframeRef.current; @@ -982,10 +986,22 @@ export default function LabelStudioTextEditor() {
{segmentTotal > 0 ? ( -
- - 分段列表已关闭,请使用“保存并跳转到下一段/下一条”顺序标注。 - +
+ {segmentIndices.map((segmentIndex) => { + const isCurrent = segmentIndex === currentSegmentIndex; + return ( +
+ {segmentIndex + 1} +
+ ); + })}
) : (