From 89fd9ab312c0aef9fcab89fbbaee4add5baa7c57 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期二, 27 十月 2026 09:43:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/utils/reportDocxLayout.js | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/utils/reportDocxLayout.js b/src/utils/reportDocxLayout.js
index ff2ae3f..8b081a6 100644
--- a/src/utils/reportDocxLayout.js
+++ b/src/utils/reportDocxLayout.js
@@ -164,6 +164,21 @@
return changed ? documentXml : null
}
+function clearDefaultSequenceUnderlines(xml) {
+ return xml.replace(resultTablePattern, table => {
+ if (!table.includes('搴忓彿') || !/(妫�娴嬬粨鏋渱妫�楠岀粨鏋�)/.test(table)) return table
+ return table.replace(tableRowPattern, row => row.replace(tableCellPattern, (cell, offset) => {
+ if (offset !== row.indexOf('<w:tc')) return cell
+ const text = [...cell.matchAll(/<w:t\b(?![^>]*\/>)[^>]*>([\s\S]*?)<\/w:t>/g)]
+ .map(match => match[1]).join('').trim()
+ if (!/^\d+$/.test(text)) return cell
+ // 鏃ф姤鍛婁腑鐨� <w:u w:color="auto"/> 榛樿浼氳瑙i噴鎴愬崟涓嬪垝绾裤��
+ // 鏄惧紡璁剧疆浜嗙被鍨嬬殑涓嬪垝绾夸繚鐣欙紝鍏佽鐢ㄦ埛鑷淇敼搴忓彿鏍煎紡銆�
+ return cell.replace(/<w:u\b[^>]*\/>/g, tag => /\bw:val=/.test(tag) ? tag : '')
+ }))
+ })
+}
+
export async function normalizeReportDocxForEditor(blob, reportCode) {
const zip = await JSZip.loadAsync(blob)
const documentPart = zip.file('word/document.xml')
@@ -173,6 +188,7 @@
const themeXml = themePart ? await themePart.async('string') : ''
const themeFonts = { major: chineseThemeFont(themeXml, 'major'), minor: chineseThemeFont(themeXml, 'minor') }
let normalizedXml = alignResultTable(documentXml) || documentXml
+ normalizedXml = clearDefaultSequenceUnderlines(normalizedXml)
normalizedXml = fitCoverCustomer(normalizedXml) || normalizedXml
normalizedXml = materializeChineseThemeFonts(normalizedXml, themeFonts) || normalizedXml
let changed = normalizedXml !== documentXml
--
Gitblit v1.9.3