import React from "react"; import { Modal, Descriptions, Tag, Space, Divider, Card, Typography } from "antd"; import type { AnnotationTemplate } from "../annotation.model"; const { Text, Paragraph } = Typography; interface TemplateDetailProps { visible: boolean; template?: AnnotationTemplate; onClose: () => void; } const TemplateDetail: React.FC = ({ visible, template, onClose, }) => { if (!template) return null; return ( {template.name} {template.description || "-"} {template.dataType} {template.labelingType} {template.category} {template.style} {template.builtIn ? "系统内置" : "自定义"} {template.version} {new Date(template.createdAt).toLocaleString()} {template.updatedAt && ( {new Date(template.updatedAt).toLocaleString()} )} 配置详情 {template.configuration.objects.map((obj, index) => ( 名称: {obj.name} 类型: {obj.type} 值: {obj.value} ))} {template.configuration.labels.map((label, index) => (
来源名称: {label.fromName} 目标名称: {label.toName} 类型: {label.type} {label.required && 必填}
{label.description && (
描述: {label.description}
)} {label.options && label.options.length > 0 && (
选项:
{label.options.map((opt, i) => ( {opt} ))}
)} {label.labels && label.labels.length > 0 && (
标签:
{label.labels.map((lbl, i) => ( {lbl} ))}
)}
))}
{template.labelConfig && (
                            {template.labelConfig}
                        
)}
); }; export default TemplateDetail;