You've already forked DataMate
feat(annotation): 添加标注任务的数据量统计功能
- 在前端表格中新增数据量和已标注列显示 - 添加标注完成百分比计算和提示功能 - 在后端schema中增加totalCount和annotatedCount字段 - 实现项目统计数据查询服务方法 - 集成前后端数据映射和接口响应更新
This commit is contained in:
@@ -160,6 +160,30 @@ export default function DataAnnotation() {
|
||||
key: "datasetName",
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: "数据量",
|
||||
dataIndex: "totalCount",
|
||||
key: "totalCount",
|
||||
width: 100,
|
||||
align: "center" as const,
|
||||
},
|
||||
{
|
||||
title: "已标注",
|
||||
dataIndex: "annotatedCount",
|
||||
key: "annotatedCount",
|
||||
width: 100,
|
||||
align: "center" as const,
|
||||
render: (value: number, record: any) => {
|
||||
const total = record.totalCount || 0;
|
||||
const annotated = value || 0;
|
||||
const percent = total > 0 ? Math.round((annotated / total) * 100) : 0;
|
||||
return (
|
||||
<span title={`${annotated}/${total} (${percent}%)`}>
|
||||
{annotated}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
dataIndex: "createdAt",
|
||||
|
||||
@@ -48,6 +48,8 @@ export function mapAnnotationTask(task: any) {
|
||||
name: task.name,
|
||||
description: task.description || "",
|
||||
datasetName: task.datasetName || task.dataset_name || "-",
|
||||
totalCount: task.totalCount ?? task.total_count ?? 0,
|
||||
annotatedCount: task.annotatedCount ?? task.annotated_count ?? 0,
|
||||
createdAt: task.createdAt || task.created_at || "-",
|
||||
updatedAt: task.updatedAt || task.updated_at || "-",
|
||||
icon: <StickyNote />,
|
||||
|
||||
Reference in New Issue
Block a user