修复提示框文字换行问题

This commit is contained in:
2025-04-26 18:43:22 +08:00
parent 6c40c4d074
commit 9a22e9092f
5 changed files with 129 additions and 91 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ export function AIAnalysis({ analysisData, score, onConfirmResults }: AIAnalysis
</div>
{/* 操作按钮 */}
<div className="mt-4 flex space-x-4">
{/* <div className="mt-4 flex space-x-4">
<button
className="ant-btn ant-btn-default flex items-center"
onClick={handleExportReport}
@@ -124,7 +124,7 @@ export function AIAnalysis({ analysisData, score, onConfirmResults }: AIAnalysis
>
<i className="ri-check-double-line mr-1"></i> 确认评查结果
</button>
</div>
</div> */}
</div>
</div>
</div>
+14 -11
View File
@@ -175,17 +175,20 @@ export function FilePreview({ fileContent, reviewPoints, activeReviewPointResult
// 如果有目标页码,并且与上次不同或activeReviewPointId变化了,则执行跳转
if (targetPage && numPages && targetPage <= numPages && (targetPage !== prevTargetPageRef.current || activeReviewPointResultId)) {
prevTargetPageRef.current = targetPage;
let newTargetPage = targetPage;
try {
// 安全地访问ocrResult
if (fileContent.ocrResult && fileContent.ocrResult.__meta && fileContent.ocrResult.__meta.page_offset) {
// 可以根据需要使用page_offset调整目标页面
newTargetPage = targetPage + fileContent.ocrResult.__meta.page_offset;
}
} catch (error) {
console.error("访问ocrResult时出错:", error);
toastService.error("访问ocrResult时出错:" + (error instanceof Error ? error.message : '未知错误'));
}
const newTargetPage = targetPage;
// let newTargetPage = targetPage;
// console.log("targetPage:", targetPage);
// console.log("fileContent:", fileContent);
// try {
// // 安全地访问ocrResult
// if (fileContent.ocrResult && fileContent.ocrResult.__meta && fileContent.ocrResult.__meta.page_offset) {
// // 可以根据需要使用page_offset调整目标页面
// newTargetPage = targetPage + fileContent.ocrResult.__meta.page_offset;
// }
// } catch (error) {
// console.error("访问ocrResult时出错:", error);
// toastService.error("访问ocrResult时出错:" + (error instanceof Error ? error.message : '未知错误'));
// }
const pageElement = document.getElementById(`page-${newTargetPage}`);
if (pageElement) {