|
|
@ -469,12 +469,21 @@ |
|
|
|
const dataToProcess = props.taskResultDetail.slice(1); // 跳过第一个数据 |
|
|
|
|
|
|
|
// 根据剩余数据生成标签页 |
|
|
|
return dataToProcess.map((category, index) => ({ |
|
|
|
key: category.name, // 使用数据的name作为key |
|
|
|
label: `${category.name} (${category.results?.length || 0})`, |
|
|
|
dataIndex: index + 1, // 记录在原数据中的索引(+1因为跳过了第一个) |
|
|
|
name: category.name |
|
|
|
})); |
|
|
|
return dataToProcess.map((category, index) => { |
|
|
|
let label = `${category.name} (${category.results?.length || 0})`; |
|
|
|
|
|
|
|
// 特殊处理:如果是实质性审查,加上审查立场 |
|
|
|
if (category.name === '实质性审查' && props.taskInfo?.contractPartyRole) { |
|
|
|
label = `(${props.taskInfo.contractPartyRole})实质性审查 (${category.results?.length || 0})`; |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
key: category.name, // 使用数据的name作为key |
|
|
|
label: label, |
|
|
|
dataIndex: index + 1, // 记录在原数据中的索引(+1因为跳过了第一个) |
|
|
|
name: category.name |
|
|
|
}; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// 过滤后的结果(用于标签模式) |
|
|
@ -849,6 +858,12 @@ |
|
|
|
currentSelectItem.value = item; |
|
|
|
currentSelectCategoryIndex.value = categoryIndex; |
|
|
|
currentSelectItemIndex.value = itemIndex; |
|
|
|
|
|
|
|
// 清理当前字段的页面按钮数据,重新获取 |
|
|
|
const fieldKey = getFieldKey(item, fieldConfig, categoryIndex, itemIndex); |
|
|
|
console.log('fieldKey', fieldKey); |
|
|
|
delete fieldPageButtons.value[fieldKey]; |
|
|
|
console.log('fieldPageButtons', fieldPageButtons.value); |
|
|
|
} |
|
|
|
|
|
|
|
// 检查是否已经有页面按钮,如果有直接使用第一个页面 |
|
|
@ -866,7 +881,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
// 调用原有的PDF定位方法,让它自己处理单页面或显示弹窗 |
|
|
|
// 先尝试用完整文本进行定位 |
|
|
|
await pdfContainerRef.value.locateByText(text, pdfSource); |
|
|
|
|
|
|
|
// 延迟检查是否出现了页面选择弹窗 |
|
|
@ -874,7 +889,27 @@ |
|
|
|
checkForPageModal(); |
|
|
|
}, 300); // 等待弹窗显示 |
|
|
|
} catch (error) { |
|
|
|
console.error('PDF定位失败:', error); |
|
|
|
console.error('完整文本定位失败,尝试使用前10个字符定位:', error); |
|
|
|
|
|
|
|
// 如果完整文本定位失败,尝试用前10个字符再次定位 |
|
|
|
const shortText = text.trim().substring(0, 10); |
|
|
|
if (shortText && shortText !== text.trim()) { |
|
|
|
try { |
|
|
|
console.log('使用前10个字符进行定位:', shortText); |
|
|
|
message.warning('完整文本定位失败,尝试使用前10个字符定位'); |
|
|
|
await pdfContainerRef.value.locateByText(shortText, pdfSource); |
|
|
|
|
|
|
|
// 延迟检查是否出现了页面选择弹窗 |
|
|
|
setTimeout(() => { |
|
|
|
checkForPageModal(); |
|
|
|
}, 300); // 等待弹窗显示 |
|
|
|
} catch (shortError) { |
|
|
|
console.error('前10个字符定位也失败:', shortError); |
|
|
|
message.warning('文本定位失败,该内容可能不在PDF中'); |
|
|
|
} |
|
|
|
} else { |
|
|
|
message.warning('文本定位失败,该内容可能不在PDF中'); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
@ -912,12 +947,13 @@ |
|
|
|
|
|
|
|
modalButtons.forEach(button => { |
|
|
|
const text = button.textContent || ''; |
|
|
|
console.log('button', button.textContent); |
|
|
|
const match = text.match(/第(\d+)页/); |
|
|
|
if (match) { |
|
|
|
pages.push(parseInt(match[1])); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
console.log('pages', pages); |
|
|
|
// 如果有字段信息,创建页面按钮 |
|
|
|
if (pages.length > 0 && currentSelectFieldConfig.value && currentSelectItem.value && |
|
|
|
currentSelectCategoryIndex.value !== null && currentSelectItemIndex.value !== null) { |
|
|
|