Browse Source

修改第二次识别字数

ai_dev
zhouhaibin 3 days ago
parent
commit
f96aa51526
  1. 10
      src/components/UniversalResultDrawer.vue

10
src/components/UniversalResultDrawer.vue

@ -889,14 +889,14 @@
checkForPageModal();
}, 300); //
} catch (error) {
console.error('完整文本定位失败,尝试使用前10个字符定位:', error);
console.error('完整文本定位失败,尝试使用前20个字符定位:', error);
// 10
const shortText = text.trim().substring(0, 10);
const shortText = text.trim().substring(0,25);
if (shortText && shortText !== text.trim()) {
try {
console.log('使用前10个字符进行定位:', shortText);
message.warning('完整文本定位失败,尝试使用前10个字符定位');
console.log('使用前25个字符进行定位:', shortText);
message.warning('完整文本定位失败,尝试使用前25个字符定位');
await pdfContainerRef.value.locateByText(shortText, pdfSource);
//
@ -904,7 +904,7 @@
checkForPageModal();
}, 300); //
} catch (shortError) {
console.error('前10个字符定位也失败:', shortError);
console.error('前25个字符定位也失败:', shortError);
message.warning('文本定位失败,该内容可能不在PDF中');
}
} else {

Loading…
Cancel
Save