fix:修改跳转页面如果目标页为1则不进行偏移

This commit is contained in:
2025-10-30 18:09:02 +08:00
parent d11fc54da2
commit 8358b7a585
+4
View File
@@ -195,8 +195,12 @@ export function FilePreview({ fileContent, activeReviewPointResultId, targetPage
// 安全地访问ocrResult // 安全地访问ocrResult
if (fileContent.ocrResult && fileContent.ocrResult.__meta && fileContent.ocrResult.__meta.page_offset) { if (fileContent.ocrResult && fileContent.ocrResult.__meta && fileContent.ocrResult.__meta.page_offset) {
// 可以根据需要使用page_offset调整目标页面 // 可以根据需要使用page_offset调整目标页面
if (targetPage == 1){
newTargetPage = targetPage
}else{
newTargetPage = targetPage + fileContent.ocrResult.__meta.page_offset; newTargetPage = targetPage + fileContent.ocrResult.__meta.page_offset;
} }
}
} catch (error) { } catch (error) {
console.error("访问ocrResult时出错:", error); console.error("访问ocrResult时出错:", error);
toastService.error("访问ocrResult时出错:" + (error instanceof Error ? error.message : '未知错误')); toastService.error("访问ocrResult时出错:" + (error instanceof Error ? error.message : '未知错误'));