From b9281a638ad8ba599fabd7808860cf8e314f0466 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Sun, 20 Apr 2025 20:16:42 +0800 Subject: [PATCH] update --- .../backend/src/repositories/terminal-theme.repository.ts | 5 ++++- packages/frontend/src/components/LayoutConfigurator.vue | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/repositories/terminal-theme.repository.ts b/packages/backend/src/repositories/terminal-theme.repository.ts index 14e608c..1946429 100644 --- a/packages/backend/src/repositories/terminal-theme.repository.ts +++ b/packages/backend/src/repositories/terminal-theme.repository.ts @@ -99,7 +99,8 @@ export const findAllThemes = async (): Promise => { try { const db = await getDbInstance(); // Specify the expected row type for allDb - const rows = await allDb(db, 'SELECT * FROM terminal_themes ORDER BY is_preset DESC, name ASC'); + // Correct the ORDER BY clause to use theme_type and sort presets first + const rows = await allDb(db, 'SELECT * FROM terminal_themes ORDER BY CASE theme_type WHEN \'preset\' THEN 0 ELSE 1 END ASC, name ASC'); // Filter out potential errors during mapping return rows.map(row => { try { @@ -111,6 +112,8 @@ export const findAllThemes = async (): Promise => { }).filter((theme): theme is TerminalTheme => theme !== null); } catch (err: any) { // Add type annotation for err console.error('查询所有终端主题失败:', err.message); + // 添加详细错误日志 + console.error('详细错误:', err); throw new Error('查询终端主题失败'); // Re-throw or handle error appropriately } }; diff --git a/packages/frontend/src/components/LayoutConfigurator.vue b/packages/frontend/src/components/LayoutConfigurator.vue index 698ba92..358e91e 100644 --- a/packages/frontend/src/components/LayoutConfigurator.vue +++ b/packages/frontend/src/components/LayoutConfigurator.vue @@ -458,6 +458,8 @@ const handleNodeRemove = (payload: { parentNodeId: string | undefined; nodeIndex background-color: #fff; border-radius: 8px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); + min-width: 1072px; + min-height:748px; /* width, height, top, left 由 dialogStyle 控制 */ /* 移除 max-width, max-height,由拖拽逻辑和 minSize 控制 */ display: flex;