feat(reviews): display not-applicable evaluation points in review list
- Create placeholder reviewPoints from not_applicable unified results - Merge with existing reviewPoints for display - Count notApplicable from reviewPoints for accurate statistics Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -690,7 +690,10 @@ 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;
|
const notApplicableCount = reviewPoints.filter(
|
||||||
|
point => point.status === 'notApplicable' || point.status === 'not_applicable'
|
||||||
|
).length;
|
||||||
|
const notApplicableToShow = notApplicableCount || 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">
|
||||||
|
|||||||
+27
-1
@@ -230,10 +230,36 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
|||||||
// 先获取文档基本信息(统一接口不返回文档内容)
|
// 先获取文档基本信息(统一接口不返回文档内容)
|
||||||
const reviewData = await getReviewPoints_fromApi(id, request);
|
const reviewData = await getReviewPoints_fromApi(id, request);
|
||||||
|
|
||||||
|
// 合并已评查的 reviewPoints + 未涉及的评查点
|
||||||
|
const existingPoints = ('data' in reviewData && !('error' in reviewData)) ? reviewData.data : [];
|
||||||
|
const notApplicablePoints = (unifiedData.results || [])
|
||||||
|
.filter((r: any) => r.result_type === 'not_applicable')
|
||||||
|
.map((r: any) => ({
|
||||||
|
id: `na-${r.evaluation_point_id}`,
|
||||||
|
documentId: id,
|
||||||
|
pointId: r.evaluation_point_id,
|
||||||
|
editAuditStatusId: '',
|
||||||
|
editAuditStatus: '',
|
||||||
|
editAuditStatusMessage: '',
|
||||||
|
title: '该评查点未涉及',
|
||||||
|
pointName: r.name || '',
|
||||||
|
groupName: '',
|
||||||
|
status: 'notApplicable',
|
||||||
|
content: {},
|
||||||
|
contentPage: {},
|
||||||
|
suggestion: r.ai_suggestion || '该评查点未涉及',
|
||||||
|
result: null,
|
||||||
|
score: r.score || 0,
|
||||||
|
finalScore: null,
|
||||||
|
machineScore: 0,
|
||||||
|
postAction: '',
|
||||||
|
}));
|
||||||
|
const allReviewPoints = [...existingPoints, ...notApplicablePoints];
|
||||||
|
|
||||||
return Response.json({
|
return Response.json({
|
||||||
previousRoute: previousRoute,
|
previousRoute: previousRoute,
|
||||||
document: ('document' in reviewData && !('error' in reviewData)) ? reviewData.document : null,
|
document: ('document' in reviewData && !('error' in reviewData)) ? reviewData.document : null,
|
||||||
reviewPoints: ('data' in reviewData && !('error' in reviewData)) ? reviewData.data : unifiedData.results,
|
reviewPoints: allReviewPoints,
|
||||||
reviewInfo: { reviewTime: unifiedData.evaluated_at, reviewModel: 'GraphRAG', ruleGroup: '', result: '', issueCount: unifiedData.summary?.total_points || 0 },
|
reviewInfo: { reviewTime: unifiedData.evaluated_at, reviewModel: 'GraphRAG', ruleGroup: '', result: '', issueCount: unifiedData.summary?.total_points || 0 },
|
||||||
statistics: {
|
statistics: {
|
||||||
total: unifiedData.summary?.total_points || 0,
|
total: unifiedData.summary?.total_points || 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user