From 5ee5033b89d0fcfe960e7d31097158f2b8b4a94a Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Mon, 31 Mar 2025 17:27:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/templates/report-template.html | 10 ++++++++++ .../summary/reprot-print/components/ReportPreview.vue | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/public/templates/report-template.html b/public/templates/report-template.html index 258adb3..ef0785e 100644 --- a/public/templates/report-template.html +++ b/public/templates/report-template.html @@ -941,6 +941,7 @@ font-size: 16px; line-height: 1.6; } + .summary-tip { margin-top: 20px !important; @@ -1679,6 +1680,15 @@ // 处理汇总内容分页修改 function handleSummaryPagination(summaryText) { + // 添加处理标记,防止重复处理 + if (window._summaryProcessed && document.getElementById('summary-content-1').textContent) { + console.log('汇总内容已处理,跳过重复操作'); + return; + } + + // 设置处理标记 + window._summaryProcessed = true; + if (!summaryText || summaryText === '--') { // 如果没有汇总内容,隐藏第二页 document.getElementById('summary-page-2').style.display = 'none'; diff --git a/src/views/summary/reprot-print/components/ReportPreview.vue b/src/views/summary/reprot-print/components/ReportPreview.vue index 21c0d70..fbbcbd7 100644 --- a/src/views/summary/reprot-print/components/ReportPreview.vue +++ b/src/views/summary/reprot-print/components/ReportPreview.vue @@ -364,8 +364,6 @@ const handleIframeLoad = async () => { // 更新汇总结果 const summaryElement = doc.getElementById('summary-content-1') if (summaryElement) { - summaryElement.textContent = reportData.summaryResult || '--' - // 处理汇总内容分页 if (iframe?.contentWindow && 'handleSummaryPagination' in iframe.contentWindow) { (iframe.contentWindow as any).handleSummaryPagination(reportData.summaryResult || '--');