From 9abdd9b257017d7f6246065e5275642e261ea1b5 Mon Sep 17 00:00:00 2001 From: Syngnat Date: Fri, 31 Jul 2026 10:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(tdengine):=20=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E8=A1=A8=E9=85=8D=E7=BD=AE=E4=B8=8E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 同页展示 TDengine 表类型、TAG 配置与字段定义,避免新增字段后不可见 - 为普通表和超级表提供独立字段区域与数量摘要,并保持区域滚动 - 子表继续隐藏字段编辑区,新增字段后在合并页自动聚焦新行 --- frontend/src/components/TableDesigner.tsx | 86 +++++++++++++++++++---- 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/TableDesigner.tsx b/frontend/src/components/TableDesigner.tsx index d58cb44f..d8e78611 100644 --- a/frontend/src/components/TableDesigner.tsx +++ b/frontend/src/components/TableDesigner.tsx @@ -635,7 +635,8 @@ const TableDesigner: React.FC<{ tab: TabData; embedded?: boolean }> = ({ tab, em }, []); const focusColumnRow = useCallback((targetKey: string): boolean => { - if (activeKey !== 'columns') return false; + // TDengine's new-table view embeds the columns table in its tdengine tab. + if (activeKey !== 'columns' && activeKey !== 'tdengine') return false; const tableBody = containerRef.current?.querySelector('.ant-table-body') as HTMLElement | null; if (!tableBody) return false; const row = tableBody.querySelector(`tr[data-row-key="${targetKey}"]`) as HTMLTableRowElement | null; @@ -671,7 +672,8 @@ const TableDesigner: React.FC<{ tab: TabData; embedded?: boolean }> = ({ tab, em useEffect(() => { const pendingKey = pendingFocusColumnKeyRef.current; - if (!pendingKey || activeKey !== 'columns') return; + // TDengine's new-table view embeds the columns table in its tdengine tab. + if (!pendingKey || (activeKey !== 'columns' && activeKey !== 'tdengine')) return; let cancelled = false; const tryFocus = () => { @@ -2905,8 +2907,7 @@ END;`; ); - const tdengineAdvancedTabContent = ( -
+ const tdengineAdvancedFormContent = ( )} -
); const columnsTabContent = ( @@ -3048,6 +3048,66 @@ END;`; ); + const tdengineCombinedTabContent = ( +
+
+ {tdengineAdvancedFormContent} +
+ {!isTDengineChildNewTable && ( +
+
+ {t('table_designer.tab.columns', undefined, i18nLanguage)} + + {designerColumnSummary} + +
+
+ {columnsTabContent} +
+
+ )} +
+ ); + return (