fix: replace page shorthand labels in review detail

This commit is contained in:
wren
2026-05-06 18:05:51 +08:00
parent 153865c734
commit c7bbe59882
2 changed files with 15 additions and 3 deletions
@@ -121,6 +121,11 @@ function getFieldBboxHighlight(point: ReviewPoint, key: string, page?: number):
};
}
function formatPageLabel(page?: number): string {
if (!page || !Number.isFinite(page) || page <= 0) return '未定位';
return `${page}`;
}
function ExtractedFieldsPanel({
reviewPoints,
onFieldClick,
@@ -224,10 +229,10 @@ function ExtractedFieldsPanel({
handleFieldNavigate(f.pointId, f.page, f.highlightValue, f.bboxHighlight);
}}
>
p.{f.page}
{formatPageLabel(f.page)}
</button>
) : (
<div className="mt-0.5 text-[10px] text-slate-300">-</div>
<div className="mt-0.5 text-[10px] text-slate-300"></div>
)}
</div>
</div>
@@ -89,6 +89,11 @@ function getLeauditBboxHighlight(reviewPoint: ReviewPoint, fieldKey: string, pag
};
}
function formatPageLabel(page?: number): string {
if (!page || !Number.isFinite(page) || page <= 0) return '未定位';
return `${page}`;
}
// ── Tooltip 系统 ──
let activeTooltip = { show: false, content: null as React.ReactNode, position: { top: 0, left: 0 }, ready: false };
function TooltipPortal() {
@@ -708,7 +713,9 @@ function LeauditReviewPointDetailCard({ reviewPoint, onReviewPointSelect, onStat
{enterpriseButton && enterpriseButton}
</div>
<div className="flex items-center gap-2 shrink-0">
{page && <span className="text-[10.5px] text-slate-400 shrink-0">P{page}</span>}
<span className={`text-[10.5px] shrink-0 ${page ? 'text-slate-400' : 'text-slate-300'}`}>
{formatPageLabel(page)}
</span>
</div>
</div>
<div