feat: 添加标签管理模态框

This commit is contained in:
Baobhan Sith
2025-05-11 11:20:26 +08:00
parent 1eb1efde72
commit 598df938bf
40 changed files with 634 additions and 170 deletions
@@ -230,14 +230,14 @@ const deleteSingleCommand = (id: number) => {
commandHistoryStore.deleteCommand(id);
};
// 新增:执行命令 (发出事件)
// 执行命令 (发出事件)
const executeCommand = (command: string) => {
emitWorkspaceEvent('terminal:sendCommand', { command });
// Optionally reset selection after execution
// selectedIndex.value = -1; // REMOVED: Store handles index
};
// +++ 新增:聚焦搜索框的方法 +++
// +++ 聚焦搜索框的方法 +++
const focusSearchInput = (): boolean => {
if (searchInputRef.value) {
searchInputRef.value.focus();
@@ -44,7 +44,7 @@ const getInitialSelectedTagId = (): number | null => {
return storedValue && storedValue !== 'null' ? parseInt(storedValue, 10) : null;
};
const selectedTagId = ref<number | null>(getInitialSelectedTagId());
const searchQuery = ref(''); // +++ 新增搜索查询状态 +++
const searchQuery = ref('');
// +++ 控制添加/编辑表单的显示状态 +++
const showAddEditConnectionForm = ref(false);
@@ -280,7 +280,7 @@ watch(editingTagId, async (newId) => {
}
});
// 新增:监听显示模式变化,重置选择
// 监听显示模式变化,重置选择
watch(showQuickCommandTagsBoolean, () => {
quickCommandsStore.resetSelection();
});
@@ -432,7 +432,7 @@ const executeCommand = (command: QuickCommandFE) => {
// selectedIndex.value = -1; // REMOVED: Store handles index
};
// +++ 新增:聚焦搜索框的方法 +++
// +++ 聚焦搜索框的方法 +++
const focusSearchInput = (): boolean => {
if (searchInputRef.value) {
searchInputRef.value.focus();
@@ -75,7 +75,7 @@ const currentSearchTerm = ref(''); // 当前搜索的关键词
const mobileTerminalRef = ref<InstanceType<typeof Terminal> | null>(null); // +++ 添加 mobileTerminalRef +++
const isVirtualKeyboardVisible = ref(true); // +++ State for virtual keyboard visibility +++
// --- 新增:处理全局键盘事件 ---
// --- 处理全局键盘事件 ---
const handleGlobalKeyDown = (event: KeyboardEvent) => {
// 检查是否按下了 Alt 键以及上/下箭头键
if (event.altKey && (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
@@ -422,7 +422,7 @@ const handleCloseSearch = () => { // +++ 修改 +++
}
};
// +++ 新增:处理清空终端事件 +++
// +++ 处理清空终端事件 +++
const handleClearTerminal = () => { // +++ 修改 +++
const currentSession = activeSession.value;
if (!currentSession) {
@@ -511,7 +511,7 @@ const handleCloseEditorTab = (tabId: string) => {
}
};
// +++ 新增:处理编辑器编码更改事件 +++
// +++ 处理编辑器编码更改事件 +++
const handleChangeEncoding = (payload: { tabId: string; encoding: string }) => {
const isShared = shareFileEditorTabsBoolean.value;
console.log(`[WorkspaceView] handleChangeEncoding for tab ${payload.tabId} to ${payload.encoding}, Shared mode: ${isShared}`);
@@ -543,7 +543,7 @@ const handleCloseEditorTab = (tabId: string) => {
sessionStore.handleOpenNewSession(id);
};
// +++ 新增:处理虚拟键盘按键事件 +++
// +++ 处理虚拟键盘按键事件 +++
const handleVirtualKeyPress = (keySequence: string) => {
const currentSession = activeSession.value;
if (!currentSession) {