feat(annotation): 添加标注类型显示功能

- 在前端页面中新增标注类型列并使用Tag组件展示
- 添加AnnotationTypeMap常量用于标注类型的映射
- 修改接口定义支持labelingType字段的传递
- 更新后端项目创建和更新逻辑以存储标注类型
- 添加标注类型配置键常量统一管理
- 扩展数据传输对象支持标注类型属性
- 实现模板标注类型的继承逻辑
This commit is contained in:
2026-02-01 19:08:11 +08:00
parent d135a7f336
commit 0bb9abb200
5 changed files with 66 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { useState } from "react";
import { Card, Button, Table, message, Modal, Tabs } from "antd";
import { Card, Button, Table, Tag, message, Modal, Tabs } from "antd";
import {
PlusOutlined,
EditOutlined,
@@ -15,7 +15,11 @@ import {
deleteAnnotationTaskByIdUsingDelete,
queryAnnotationTasksUsingGet,
} from "../annotation.api";
import { mapAnnotationTask, type AnnotationTaskListItem } from "../annotation.const";
import {
AnnotationTypeMap,
mapAnnotationTask,
type AnnotationTaskListItem,
} from "../annotation.const";
import CreateAnnotationTask from "../Create/components/CreateAnnotationTaskDialog";
import ExportAnnotationDialog from "./ExportAnnotationDialog";
import { ColumnType } from "antd/es/table";
@@ -168,6 +172,21 @@ export default function DataAnnotation() {
key: "datasetName",
width: 180,
},
{
title: "标注类型",
dataIndex: "labelingType",
key: "labelingType",
width: 160,
render: (value?: string) => {
if (!value) {
return "-";
}
const label =
AnnotationTypeMap[value as keyof typeof AnnotationTypeMap]?.label ||
value;
return <Tag color="geekblue">{label}</Tag>;
},
},
{
title: "数据量",
dataIndex: "totalCount",