From 7109031f71bbdd94a8d7aac02de004936b1750ed Mon Sep 17 00:00:00 2001 From: logan Date: Mon, 25 May 2026 00:45:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=96=B0=E5=BB=BA=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E9=A1=B5=E9=9D=A2=E5=85=A8=E9=AB=98=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E2=80=94=20=E5=8F=82=E8=80=83=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=B5=E9=9D=A2=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 全高布局 h-[calc(100vh-3rem)],去掉 max-w-6xl 限制 - 顶栏紧凑排列: 返回+标题+实例+数据库+定时+浏览+格式化+操作按钮 - 左侧 Schema 浏览面板(280px 可折叠) - SQL 编辑器占满剩余空间 - 底部: 审核结果+变更原因(单行 input 替代 textarea) - 按钮精简: 'SQL 检测' + '提交审批',去掉冗长提示文案 --- frontend/src/pages/TicketCreatePage.tsx | 343 ++++++++++++------------ 1 file changed, 178 insertions(+), 165 deletions(-) diff --git a/frontend/src/pages/TicketCreatePage.tsx b/frontend/src/pages/TicketCreatePage.tsx index 4640269..702f7fb 100644 --- a/frontend/src/pages/TicketCreatePage.tsx +++ b/frontend/src/pages/TicketCreatePage.tsx @@ -657,180 +657,193 @@ export default function TicketCreatePage() { }; /* ================================================================== */ - /* MAIN RENDER */ + /* MAIN RENDER — 全高布局,参考 QueriesPage */ /* ================================================================== */ + const [showBrowser, setShowBrowser] = useState(true); + return ( -
- {/* Header */} -
- -

新建数据变更工单

-
- - {/* Error */} - {error && ( -
- {error} -
- )} - - {/* === Form — single page === */} -
- {/* Row 1: Title + Instance + Database */} -
-
- - setTitle(e.target.value)} - className="w-full px-3 py-2 bg-[var(--dg-bg-primary)] border border-[var(--dg-border)] rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors" - placeholder="如:用户表添加索引" /> +
+ {/* ====== 左侧 Schema 浏览面板 ====== */} + {showBrowser && instanceId && database && ( +
+
+ 库表浏览 +
-
- - -
-
- - {isRedis ? ( - - ) : databases.length > 0 ? ( - - ) : ( - setDatabase(e.target.value)} disabled={!instanceId} - className="w-full px-3 py-2 bg-[var(--dg-bg-primary)] border border-[var(--dg-border)] rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors disabled:opacity-50" - placeholder={instanceId ? '请输入数据库名' : '请先选择实例'} /> - )} -
-
- - {/* 定时执行 */} -
- - {enableSchedule && ( - setScheduledAt(e.target.value)} - step="1" - className="px-3 py-2 bg-[var(--dg-bg-primary)] border border-[var(--dg-border)] rounded-lg text-sm focus:outline-none focus:border-blue-500 transition-colors" - min={new Date().toISOString().slice(0, 16)} /> - )} - {enableSchedule && scheduledAt && ( - - 将于 {new Date(scheduledAt).toLocaleString('zh-CN')} 执行 - - )} -
- - {/* SQL Editor + Browser Panel */} -
-
-
-
- -
- - - {sqlContent.trim() ? sqlContent.trim().split(/;\s*/).filter(Boolean).length + ' 条语句' : ''} - -
-
- -
-
-
+
{renderBrowserPanel()}
- - {/* Reason */} -
- -