fix(ReviewPointsList): 读取后端传入的 per-field res 替代前端自行判定
renderModelRule 对 AI 评查点的 res 计算改为优先使用后端写入 config.fields[key].res 的值,fallback 到原来的 value 非空判定。 解决了评查点不通过但所有细项都显示绿色的问题。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1582,6 +1582,7 @@ export function ReviewPointsList({
|
|||||||
page: number | string;
|
page: number | string;
|
||||||
value: string;
|
value: string;
|
||||||
char_positions?: CharPosition[];
|
char_positions?: CharPosition[];
|
||||||
|
res?: boolean;
|
||||||
}>;
|
}>;
|
||||||
ai_suggestion?: {
|
ai_suggestion?: {
|
||||||
summary?: string;
|
summary?: string;
|
||||||
@@ -1634,7 +1635,8 @@ export function ReviewPointsList({
|
|||||||
// 遍历fields,获取每个字段的值并生成对应的JSX元素
|
// 遍历fields,获取每个字段的值并生成对应的JSX元素
|
||||||
if (config.fields) {
|
if (config.fields) {
|
||||||
Object.entries(config.fields).forEach(([key, value], index) => {
|
Object.entries(config.fields).forEach(([key, value], index) => {
|
||||||
const res = value.value.trim() !== '';
|
// 优先使用后端传入的 per-field res,fallback 到 value 非空判定
|
||||||
|
const res = value.res !== undefined && value.res !== null ? value.res : value.value.trim() !== '';
|
||||||
fieldElements.push(
|
fieldElements.push(
|
||||||
<button
|
<button
|
||||||
key={`field-${index}`}
|
key={`field-${index}`}
|
||||||
|
|||||||
Reference in New Issue
Block a user