feat(annotation): 添加文本分段标注功能

- 引入文本分割器实现长文本按200字符自动分段
- 增加分段状态管理和段落导航界面
- 支持按段落保存和加载标注数据
- 实现分段模式下的标注状态跟踪
- 扩展API接口支持段落索引参数
- 添加分段相关的数据模型定义
This commit is contained in:
2026-01-19 18:18:19 +08:00
parent 3af0f0b3a1
commit 71c4a8d8a6
6 changed files with 395 additions and 41 deletions

View File

@@ -61,14 +61,22 @@ export function listEditorTasksUsingGet(projectId: string, params?: any) {
return get(`/api/annotation/editor/projects/${projectId}/tasks`, params);
}
export function getEditorTaskUsingGet(projectId: string, fileId: string) {
return get(`/api/annotation/editor/projects/${projectId}/tasks/${fileId}`);
export function getEditorTaskUsingGet(
projectId: string,
fileId: string,
params?: { segmentIndex?: number }
) {
return get(`/api/annotation/editor/projects/${projectId}/tasks/${fileId}`, params);
}
export function upsertEditorAnnotationUsingPut(
projectId: string,
fileId: string,
data: any
data: {
annotation: any;
expectedUpdatedAt?: string;
segmentIndex?: number;
}
) {
return put(`/api/annotation/editor/projects/${projectId}/tasks/${fileId}/annotation`, data);
}