feat(frontend): integrate GraphRAG scored evaluation results

- Add getUnifiedEvaluationResults API function
- Extend ReviewPointsListProps with flowType, scoredResults, scoredSummary
- Add ScoredResultCard rendering for graphrag flow_type
- Modify reviews.tsx loader to call unified API
- Add scored evaluation component imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-20 09:42:30 +08:00
parent 11c00d34bc
commit 306cb24c70
7 changed files with 351 additions and 19 deletions
@@ -0,0 +1,56 @@
import React from 'react';
import { ScoreBar } from './ScoreBar';
import { FieldResultList } from './FieldResultList';
interface ScoredResultCardProps {
result: {
evaluation_point_id: number;
code: string;
name: string;
passed: boolean;
machine_score: number; // e.g., 3
score: number; // e.g., 5 (full score from evaluation_points)
percentage: number;
total_score: number; // e.g., 60
total_weight: number; // e.g., 100
field_results: Array<{
field_path: string;
evaluation_as: string;
weight: number;
scored: number;
status: string;
value: string;
page?: string;
ai_feedback?: string;
}>;
missing_fields?: string[];
ai_suggestion?: string;
};
}
export function ScoredResultCard({ result }: ScoredResultCardProps) {
return (
<div className="scored-result-card" data-passed={result.passed}>
<div className="scored-result-card__header">
<span className="scored-result-card__code">{result.code}</span>
<span className="scored-result-card__name">{result.name}</span>
</div>
<ScoreBar
score={result.machine_score}
fullScore={result.score}
percentage={result.percentage}
passed={result.passed}
/>
<FieldResultList items={result.field_results} />
{result.ai_suggestion && (
<div className="scored-result-card__suggestion">
<strong>💡 </strong>
<span>{result.ai_suggestion}</span>
</div>
)}
</div>
);
}