优化显示提出意见时显示的已获得分数

This commit is contained in:
2025-07-25 17:23:00 +08:00
parent 27b3574cef
commit 9a366d042a
4 changed files with 33 additions and 22 deletions
+5 -2
View File
@@ -420,8 +420,11 @@ export async function getReviewPoints(fileId: string, request: Request) {
// score是评查点设置的满分的分数 // score是评查点设置的满分的分数
score: point.score || 0, score: point.score || 0,
// finalScore是评查点对应评查结果最终所得的分数 用户交叉评查时使用 // finalScore是评查点对应评查结果最终所得的分数 用户交叉评查时使用,可能为null
finalScore: result.final_score || 0, finalScore: result.final_score,
// machineScore是评查点对应评查结果机器进行的评分,交叉评查时使用,实际上对应的是评查点设置好的分数
machineScore: result.machine_score,
postAction: point.post_action || '', postAction: point.post_action || '',
// postAction: 'manual', // postAction: 'manual',
@@ -118,7 +118,8 @@ export interface ReviewPoint {
failMessage?: string; failMessage?: string;
passMessage?: string; passMessage?: string;
score?: number; // 评查点满分 score?: number; // 评查点满分
finalScore?: number; // 评查点获得分数 finalScore?: number | null; // 评查点最终获得分数
machineScore?: number; // 评查点机器获得分数
evaluationConfig?: { evaluationConfig?: {
rules?: Array<{ rules?: Array<{
type: string; type: string;
@@ -445,15 +446,15 @@ export function ReviewPointsList({
const fetcher = useFetcher(); const fetcher = useFetcher();
// 归一化 reviewPoints,确保每个点都有 id 字段 // 归一化 reviewPoints,确保每个点都有 id 字段
const [normalizedReviewPoints, setNormalizedReviewPoints] = useState<ReviewPoint[]>([]); // const [normalizedReviewPoints, setNormalizedReviewPoints] = useState<ReviewPoint[]>([]);
console.log('normalizedReviewPoints', normalizedReviewPoints); // console.log('normalizedReviewPoints', normalizedReviewPoints);
useEffect(() => { // useEffect(() => {
const norm = reviewPoints.map(point => ({ // const norm = reviewPoints.map(point => ({
...point, // ...point,
id: String(point.id || point.evaluationPointId || point.pointId || '') // 保证 id 为字符串且不为 undefined // id: String(point.id || point.evaluationPointId || point.pointId || '') // 保证 id 为字符串且不为 undefined
})); // }));
setNormalizedReviewPoints(norm); // setNormalizedReviewPoints(norm);
}, [reviewPoints]); // }, [reviewPoints]);
// 同步外部scoringProposals到本地状态 // 同步外部scoringProposals到本地状态
useEffect(() => { useEffect(() => {
@@ -2573,7 +2574,8 @@ export function ReviewPointsList({
<label htmlFor="deduction-score" className="block text-sm font-medium text-gray-700 mb-2"> <label htmlFor="deduction-score" className="block text-sm font-medium text-gray-700 mb-2">
(+/-) (+/-)
<span className="text-red-500 ml-1">*</span> <span className="text-red-500 ml-1">*</span>
<span className="text-xs text-gray-500 ml-1"> {selectedReviewPoint?.score} , {selectedReviewPoint?.finalScore} </span> {/* 已获得分数需要判断finalScore是否为null,为null时应该用machineScore(说明该评查点没有修改过分数),否则用finalScore */}
<span className="text-xs text-gray-500 ml-1"> {selectedReviewPoint?.score} , {selectedReviewPoint?.finalScore !== null ? selectedReviewPoint?.finalScore : selectedReviewPoint?.machineScore} </span>
</label> </label>
<input <input
id="deduction-score" id="deduction-score"
+7 -1
View File
@@ -30,6 +30,11 @@ interface ApiConfig {
// 端口特定配置映射 // 端口特定配置映射
// 根据不同端口提供不同的API配置 // 根据不同端口提供不同的API配置
const portConfigs: Record<string, Partial<ApiConfig>> = { const portConfigs: Record<string, Partial<ApiConfig>> = {
'51703': {
baseUrl: 'http://172.16.0.55:51703',
documentUrl: 'http://172.16.0.55:51703/docauditai/',
uploadUrl: 'http://172.16.0.55:51703/admin/documents'
},
'51704': { '51704': {
baseUrl: 'http://172.16.0.55:51704', baseUrl: 'http://172.16.0.55:51704',
documentUrl: 'http://172.16.0.55:51704/docauditai/', documentUrl: 'http://172.16.0.55:51704/docauditai/',
@@ -96,7 +101,8 @@ const configs: Record<string, ApiConfig> = {
// 生产环境 // 生产环境
production: { production: {
// postgrest // postgrest
baseUrl: 'http://10.79.97.17:8000', baseUrl: 'http://172.16.0.55:8008',
// baseUrl: 'http://10.79.97.17:8000',
// minio // minio
documentUrl: 'http://10.76.244.156:9000/docauditai/', documentUrl: 'http://10.76.244.156:9000/docauditai/',
// 文件上传 // 文件上传
+8 -8
View File
@@ -605,14 +605,14 @@ export default function CrossCheckingIndex() {
); );
} }
}, },
{ // {
title: "评查分数", // title: "评查分数",
key: "score", // key: "score",
align: "center" as const, // align: "center" as const,
width: "5%", // width: "5%",
render: (_: unknown, record: CrossCheckingTask) => // render: (_: unknown, record: CrossCheckingTask) =>
record.status === CrossCheckingTaskStatus.COMPLETED ? record.score : '-' // record.status === CrossCheckingTaskStatus.COMPLETED ? record.score : '-'
}, // },
{ {
title: "操作", title: "操作",
key: "operation", key: "operation",