diff --git a/packages/frontend/src/components/CommandInputBar.vue b/packages/frontend/src/components/CommandInputBar.vue index 900f68d..962bf28 100644 --- a/packages/frontend/src/components/CommandInputBar.vue +++ b/packages/frontend/src/components/CommandInputBar.vue @@ -424,24 +424,6 @@ const handleQuickCommandExecute = (command: string) => { - - - - + + + + diff --git a/packages/frontend/src/views/WorkspaceView.vue b/packages/frontend/src/views/WorkspaceView.vue index c9a8b58..b37b42a 100644 --- a/packages/frontend/src/views/WorkspaceView.vue +++ b/packages/frontend/src/views/WorkspaceView.vue @@ -77,12 +77,13 @@ const isVirtualKeyboardVisible = ref(true); // +++ State for virtual keyboard vi // --- 文件管理器模态框状态 --- const showFileManagerModal = ref(false); -const fileManagerProps = shallowRef(null); +}>>(new Map()); +const currentFileManagerSessionId = ref(null); // --- 处理全局键盘事件 --- const handleGlobalKeyDown = (event: KeyboardEvent) => { @@ -683,23 +684,25 @@ const handleFileManagerOpenRequest = (payload: { sessionId: string }) => { return; } - // 3. 生成 instanceId - const instanceId = `fm-modal-${sessionId}-${Date.now()}`; + // 3. 生成或获取 instanceId + const currentProps = fileManagerPropsMap.value.get(sessionId); + const instanceId = currentProps ? currentProps.instanceId : `fm-modal-${sessionId}`; // 4. 设置 props 并显示模态框 - fileManagerProps.value = { + const newProps = { sessionId, instanceId, dbConnectionId: String(dbConnectionId), // 确保是 string wsDeps, }; + fileManagerPropsMap.value.set(sessionId, newProps); + currentFileManagerSessionId.value = sessionId; showFileManagerModal.value = true; - console.log(`[WorkspaceView] Opening FileManager modal with props:`, fileManagerProps.value); + console.log(`[WorkspaceView] Opening FileManager modal with props for session ${sessionId}:`, newProps); }; const closeFileManagerModal = () => { showFileManagerModal.value = false; - // fileManagerProps.value = null; // 不再清理 props,以实现保活 console.log('[WorkspaceView] FileManager modal hidden (kept alive).'); }; @@ -796,23 +799,27 @@ const closeFileManagerModal = () => { - -
+ +
-

{{ t('fileManager.modalTitle', '文件管理器') }} ({{ fileManagerProps.sessionId }})

+

{{ t('fileManager.modalTitle', '文件管理器') }} ({{ currentFileManagerSessionId }})

- +