From 2df9dce78b61d16b3e8d67a421d56f73b343ec58 Mon Sep 17 00:00:00 2001 From: Syngnat Date: Fri, 26 Jun 2026 17:29:03 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(query-results):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96SQL=E6=89=A7=E8=A1=8C=E6=B6=88=E6=81=AF=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 执行消息拆分标题栏和滚动正文区域,避免 SQL 文本被遮挡 - 消息正文关闭自动换行并保留原始空白,支持横向滚动查看完整 SQL - 补充 SQLServer 消息展示和结果面板结构回归断言 --- .../QueryEditor.results-and-drop.test.tsx | 12 ++++ .../components/QueryEditorResultsPanel.tsx | 64 ++++++++++++------- 2 files changed, 52 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/QueryEditor.results-and-drop.test.tsx b/frontend/src/components/QueryEditor.results-and-drop.test.tsx index d755d04..5bc6438 100644 --- a/frontend/src/components/QueryEditor.results-and-drop.test.tsx +++ b/frontend/src/components/QueryEditor.results-and-drop.test.tsx @@ -1169,6 +1169,12 @@ describe('QueryEditor external SQL save', () => { '', " where funcno = @funcno and tabname = '$vendorclass'", ].join('\n')); + expect(messageTextarea.props.wrap).toBe('off'); + expect(messageTextarea.props.style).toMatchObject({ + display: 'block', + whiteSpace: 'pre', + overflow: 'auto', + }); expect(messageTextarea.props.value).not.toContain('mssql:'); }); @@ -2633,6 +2639,12 @@ describe('QueryEditor external SQL save', () => { expect(source).toContain("textAlign: 'left'"); expect(source).toContain("justifyContent: 'flex-start'"); + expect(source).toContain('query-result-message-block'); + expect(source).toContain('query-result-message-header'); + expect(source).toContain('query-result-message-scroll-body'); + expect(source).toContain("flex: fillHeight ? 1 : '0 1 auto'"); + expect(source).toContain('wrap="off"'); + expect(source).toContain("whiteSpace: 'pre'"); expect(source).toContain("data-query-result-message-textarea"); expect(source).toContain("query_editor.results_panel.message.action.copy"); expect(source).toContain("typeof navigator?.clipboard?.writeText !== 'function'"); diff --git a/frontend/src/components/QueryEditorResultsPanel.tsx b/frontend/src/components/QueryEditorResultsPanel.tsx index 02fd5aa..a317bcf 100644 --- a/frontend/src/components/QueryEditorResultsPanel.tsx +++ b/frontend/src/components/QueryEditorResultsPanel.tsx @@ -134,7 +134,7 @@ const QueryEditorResultsPanel: React.FC = ({ color: string; marginTop?: number; }) => ( -
= ({ minHeight: fillHeight ? 0 : undefined, boxSizing: 'border-box', }}> -
{title ? {title} : }
-