From ea423e8a3254ccafd970ad89ef818596030b2257 Mon Sep 17 00:00:00 2001 From: yangqianqian <5845211314@qq.com> Date: Tue, 16 Jun 2026 12:28:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(C2):=20=E5=AE=A1=E6=A0=B8=E5=8F=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=A1=88=E8=B4=A8=E9=87=8F=E5=88=86(?= =?UTF-8?q?=E6=80=BB=E5=88=86+7=E7=BB=B4=E6=98=8E=E7=BB=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 审核要能判断,原审核队列接口不返回分数=组长盲审。 - review.py _fmt_queue_item: 解析selected_text.score_json,复用现成 _score_array_to_obj(tasks.py)算总分+透传维度,绝不读eval_score(留NULL) - dto.tasks.ts: ReviewQueueItem.selected_text 加 score?:TextScore|null - ReviewCard.tsx: 复用现成ScoreDimBars组件,passLine=80(合格线红线, 不用组件默认85) 端到端验:task40审核队列返回total=83+5维明细,新旧维度兼容。tsc EXIT0。 Co-Authored-By: Claude Opus 4.8 --- backend/app/api/v1/review.py | 10 ++++++++++ frontend/src/components/review/ReviewCard.tsx | 5 +++++ frontend/src/types/dto.tasks.ts | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/backend/app/api/v1/review.py b/backend/app/api/v1/review.py index 27b826a..ea4250d 100644 --- a/backend/app/api/v1/review.py +++ b/backend/app/api/v1/review.py @@ -50,6 +50,7 @@ def review_queue( def _fmt_queue_item(t: GenerationTask, db: Session) -> dict: import json from app.models.product import Product + from app.api.v1.tasks import _score_array_to_obj product = db.query(Product).filter(Product.id == t.product_id).first() operator = db.query(User).filter(User.id == t.operator_id).first() selected_text = db.query(TextCandidate).filter( @@ -67,6 +68,14 @@ def _fmt_queue_item(t: GenerationTask, db: Session) -> dict: except (json.JSONDecodeError, ValueError): text_parsed = {"content": selected_text.content} + # 质量分:解析 score_json 明细数组算总分+透传维度(绝不读 eval_score,设计留NULL) + text_score = None + if selected_text and selected_text.score_json: + try: + text_score = _score_array_to_obj(json.loads(selected_text.score_json)) + except (json.JSONDecodeError, ValueError): + text_score = None + return { "task_id": t.id, "product_name": product.name if product else None, @@ -79,6 +88,7 @@ def _fmt_queue_item(t: GenerationTask, db: Session) -> dict: "title": text_parsed.get("title", ""), "content": text_parsed.get("content", ""), # 纯正文 "tags": text_parsed.get("tags", []), + "score": text_score, # 审核显分:总分+7维明细(C2) } if selected_text else None, "selected_image": { "candidate_id": selected_image.id, diff --git a/frontend/src/components/review/ReviewCard.tsx b/frontend/src/components/review/ReviewCard.tsx index b633c57..f959460 100644 --- a/frontend/src/components/review/ReviewCard.tsx +++ b/frontend/src/components/review/ReviewCard.tsx @@ -4,6 +4,7 @@ * 通过(+5) / 打回(-3,必填原因) */ import { ReviewQueueItem } from '@/types/index'; +import { ScoreDimBars } from '@/components/tasks/ScoreDimBars'; interface ReviewCardProps { item: ReviewQueueItem; @@ -30,6 +31,10 @@ export function ReviewCard({ item, onApprove, onReject }: ReviewCardProps) { {item.selected_text.content}

)} + {/* 质量分:审核可判断(C2)。合格线80=红线,不用组件默认85 */} + {item.selected_text?.score && ( + + )} {item.selected_image && (