feat(reviews): add not-applicable count display in evaluation statistics
- Add notApplicable field to Statistics interface - Show blue "未涉及" badge when count > 0 (display only, no filter) - Map backend not_applicable_count to frontend statistics Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -665,6 +665,7 @@ export function ReviewPointsList({
|
|||||||
success: 0,
|
success: 0,
|
||||||
warning: 0,
|
warning: 0,
|
||||||
error: 0,
|
error: 0,
|
||||||
|
notApplicable: 0,
|
||||||
score: 0
|
score: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -686,6 +687,7 @@ export function ReviewPointsList({
|
|||||||
const successToShow = successCount || statsToUse.success;
|
const successToShow = successCount || statsToUse.success;
|
||||||
const warningToShow = warningCount || statsToUse.warning;
|
const warningToShow = warningCount || statsToUse.warning;
|
||||||
const errorToShow = errorCount || statsToUse.error;
|
const errorToShow = errorCount || statsToUse.error;
|
||||||
|
const notApplicableToShow = statsToUse.notApplicable || 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="review-statistics bg-white border-b border-gray-100 py-3 px-4">
|
<div className="review-statistics bg-white border-b border-gray-100 py-3 px-4">
|
||||||
@@ -744,6 +746,18 @@ export function ReviewPointsList({
|
|||||||
<span className="text-xs text-gray-500 ml-2">错误</span>
|
<span className="text-xs text-gray-500 ml-2">错误</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
{/* 未涉及数量(仅在有未涉及评查点时显示,仅统计展示不支持过滤) */}
|
||||||
|
{notApplicableToShow > 0 && (
|
||||||
|
<>
|
||||||
|
<div className="h-8 border-r border-gray-200"></div>
|
||||||
|
<div className="flex items-center">
|
||||||
|
<div className="px-3 h-7 bg-blue-50 rounded-md flex items-center justify-center">
|
||||||
|
<span className="text-sm font-semibold text-blue-500">{notApplicableToShow}</span>
|
||||||
|
<span className="text-xs text-gray-500 ml-2">未涉及</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ interface Statistics {
|
|||||||
success: number;
|
success: number;
|
||||||
warning: number;
|
warning: number;
|
||||||
error: number;
|
error: number;
|
||||||
|
notApplicable: number;
|
||||||
score: number;
|
score: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,6 +240,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
|||||||
success: unifiedData.summary?.passed_count || 0,
|
success: unifiedData.summary?.passed_count || 0,
|
||||||
error: unifiedData.summary?.failed_count || 0,
|
error: unifiedData.summary?.failed_count || 0,
|
||||||
warning: 0,
|
warning: 0,
|
||||||
|
notApplicable: unifiedData.summary?.not_applicable_count || 0,
|
||||||
score: unifiedData.summary?.total_score || 0
|
score: unifiedData.summary?.total_score || 0
|
||||||
},
|
},
|
||||||
comparison_document: ('comparison_document' in reviewData && !('error' in reviewData)) ? reviewData.comparison_document : null,
|
comparison_document: ('comparison_document' in reviewData && !('error' in reviewData)) ? reviewData.comparison_document : null,
|
||||||
|
|||||||
Reference in New Issue
Block a user