From 137bf2c0666b60cfc0d98b1a9ca7ead860ee4e7c Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期三, 28 十月 2026 17:57:29 +0800
Subject: [PATCH] feat(device,supply,satisfaction): 设备计划改造、耗材采购调整与满意度照片上传

---
 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