feat: 修复 AI 风险语义并隔离 Mock 数据

This commit is contained in:
weijuesen
2026-08-14 01:16:50 +08:00
parent 839ba91354
commit 74d1948d68
29 changed files with 650 additions and 113 deletions
+11
View File
@@ -15,6 +15,17 @@ export interface InspectionRecord {
detections?: AIDetection[];
riskScore?: number;
riskLevel?: string;
riskAssessment?: {
score: number;
level: string;
confidence: string;
modelVersion: string;
ruleVersion: string;
components: Record<string, number | null>;
missing: string[];
};
modelVersion?: string;
isMock?: boolean;
aiStatus: string;
createdAt?: string;
}
+13 -1
View File
@@ -60,7 +60,17 @@ export default function InspectionsPage() {
width: 80,
render: (_, r) => (r.imageUrl ? <Image src={r.imageUrl} width={48} height={48} style={{ objectFit: 'cover', borderRadius: 4 }} /> : '-'),
},
{ title: '状态', dataIndex: 'aiStatus', search: false, render: (_, r) => (r.aiStatus === 'done' ? <Tag color="green"></Tag> : <Tag color="red"></Tag>) },
{
title: '状态',
dataIndex: 'aiStatus',
search: false,
render: (_, r) => (
<>
{r.aiStatus === 'done' ? <Tag color="green"></Tag> : <Tag color="red"></Tag>}
{r.isMock ? <Tag color="orange">Mock</Tag> : null}
</>
),
},
{
title: '操作',
valueType: 'option',
@@ -101,6 +111,8 @@ export default function InspectionsPage() {
<br />
{detail.aiStatus === 'done' ? '检测成功' : '检测失败'}
<br />
{detail.isMock ? '联调 Mock,不计入生产统计' : detail.modelVersion || '未知模型'}
<br />
{detail.riskScore !== undefined ? Math.round(detail.riskScore) : '-'}
{detail.riskLevel ? riskLevelLabel(detail.riskLevel) : '-'}
</Typography.Paragraph>