import { Card, Collapse, Space, Typography, Tag, Alert, Empty, List, Divider } from 'antd'; import { CheckCircleOutlined, WarningOutlined, CloseCircleOutlined, FileTextOutlined, } from '@ant-design/icons'; import type { EditorialReview as EditorialReviewType, EditorialItem } from '../../api/reviewApi'; import ScoreCard from './ScoreCard'; const { Title, Text, Paragraph } = Typography; const { Panel } = Collapse; interface EditorialReviewProps { data: EditorialReviewType; } /** * 稿约规范性评估详情组件 * 展示11个评估标准的详细结果 */ const EditorialReview = ({ data }: EditorialReviewProps) => { if (!data) { return ; } // 获取状态图标和颜色 const getStatusDisplay = (status: 'pass' | 'warning' | 'fail') => { const config = { pass: { icon: , color: 'success' as const, text: '通过', }, warning: { icon: , color: 'warning' as const, text: '警告', }, fail: { icon: , color: 'error' as const, text: '不通过', }, }; return config[status]; }; // 统计数据 const stats = { total: data.items.length, pass: data.items.filter((item) => item.status === 'pass').length, warning: data.items.filter((item) => item.status === 'warning').length, fail: data.items.filter((item) => item.status === 'fail').length, }; return ( 稿约规范性评估详情 }> {/* 总体评分 */} {/* 总结 */} {/* 统计信息 */}
评估标准: {stats.total}
通过: {stats.pass}
警告: {stats.warning}
不通过: {stats.fail}
{/* 详细评估结果 */} index.toString())}> {data.items.map((item: EditorialItem, index: number) => { const statusDisplay = getStatusDisplay(item.status); return ( {statusDisplay.text} {item.criterion} ({item.score}分)
} key={index} > {/* 评分 */}
评分: {item.score} / 100
{/* 问题列表 */} {item.issues && item.issues.length > 0 && (
发现的问题: ( {issue} )} style={{ marginTop: 8 }} />
)} {/* 改进建议 */} {item.suggestions && item.suggestions.length > 0 && (
改进建议: ( {suggestion} )} style={{ marginTop: 8 }} />
)} {/* 无问题提示 */} {(!item.issues || item.issues.length === 0) && item.status === 'pass' && ( )}
); })}
); }; export default EditorialReview;