From b24ba08658011a53ade32d0d67c8c57a7cdd63d1 Mon Sep 17 00:00:00 2001 From: admin <572701190@qq.com> Date: Sun, 19 Apr 2026 18:25:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E6=89=93=E5=8D=B0=E9=9A=90=E8=97=8F?= =?UTF-8?q?AI=E5=8C=BA=E5=9F=9F=E8=93=9D=E6=A1=86=20+=20diff=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=AD=97=E4=BD=93=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - print.ts的iframe样式中增加.ai-region隐藏规则:去除边框/背景/内边距,隐藏右上角标签 - diffModal右侧AI提议版本容器增加style属性:fontFamily SimSun、fontSize 12pt、lineHeight 1.5 - 确保打印输出和diff对比的视觉一致性 --- src/pages/ReportEditor.tsx | 1 + src/utils/print.ts | 2 ++ 工程分析/20260419_1822/实现方案.md | 58 ++++++++++++++++++++++++++++++ 工程分析/20260419_1822/测试方案.md | 41 +++++++++++++++++++++ 工程分析/20260419_1822/需求分析.md | 31 ++++++++++++++++ 工程分析/经验记录.md | 28 +++++++++++++++ 6 files changed, 161 insertions(+) create mode 100644 工程分析/20260419_1822/实现方案.md create mode 100644 工程分析/20260419_1822/测试方案.md create mode 100644 工程分析/20260419_1822/需求分析.md diff --git a/src/pages/ReportEditor.tsx b/src/pages/ReportEditor.tsx index 570c1af..7a96e5a 100644 --- a/src/pages/ReportEditor.tsx +++ b/src/pages/ReportEditor.tsx @@ -2633,6 +2633,7 @@ export default function ReportEditor() { suppressContentEditableWarning onBlur={(e) => setDiffModal(prev => prev ? { ...prev, newHtml: e.target.innerHTML } : null)} dangerouslySetInnerHTML={{ __html: diffModal.newHtml }} + style={{ fontFamily: 'SimSun, "Microsoft YaHei", serif', fontSize: '12pt', lineHeight: '1.5' }} > diff --git a/src/utils/print.ts b/src/utils/print.ts index 9e2dcbd..a7f6067 100644 --- a/src/utils/print.ts +++ b/src/utils/print.ts @@ -41,6 +41,8 @@ export const printDocument = (htmlContent: string, docTitle: string = '图文报 .smart-field-wrapper .field-label { color: #64748b; user-select: none; } .smart-field-wrapper .field-value { min-width: 24px; padding: 0 2px; margin: 0; border: 1px solid #cbd5e1; border-radius: 2px; display: inline-block; background: #f8fafc; color: #0f172a; line-height: inherit; font-size: inherit; vertical-align: baseline; box-sizing: border-box; outline: none; text-align: center; } .report-signature-img { max-width: 120px; max-height: 40px; width: auto; height: auto; object-fit: contain; vertical-align: middle; display: inline-block; } + .ai-region { border: none !important; background: transparent !important; padding: 0 !important; margin: 0 !important; } + .ai-region > [contenteditable="false"] { display: none !important; } @media print { .smart-field-wrapper .field-value { outline: none !important; box-shadow: none !important; border: none !important; border-bottom: 1px solid #000 !important; border-radius: 0 !important; background: transparent !important; padding: 0 2px 0px 2px !important; line-height: 1 !important; } .smart-field-wrapper .field-value.no-underline { border-bottom: none !important; } diff --git a/工程分析/20260419_1822/实现方案.md b/工程分析/20260419_1822/实现方案.md new file mode 100644 index 0000000..3a37444 --- /dev/null +++ b/工程分析/20260419_1822/实现方案.md @@ -0,0 +1,58 @@ +# 实现方案 + +## 修改文件 1:`src/utils/print.ts` + +在 iframe 的 `