部分重型模块的原子化拆解

This commit is contained in:
2026-07-23 20:46:16 +08:00
parent 2afff129b9
commit 5fa1b99c5d
12 changed files with 1688 additions and 875 deletions
+39
View File
@@ -0,0 +1,39 @@
// modules/ui.js
import { ref } from 'vue';
// Tab 切换
export const activeTab = ref('proxies');
export function switchTab(tab) {
activeTab.value = tab;
}
// 弹窗控制
export const dialogVisible = ref(false);
export const dialogMode = ref('add');
export const dialogForm = ref({
id: null,
name: '',
type: 'tcp',
localIP: '',
localPort: 0,
remotePort: 0,
});
export function openAddDialog() {
dialogMode.value = 'add';
dialogForm.value = { id: null, name: '', type: 'tcp', localIP: '', localPort: 0, remotePort: 0 };
dialogVisible.value = true;
}
export function openEditDialog(proxy) {
dialogMode.value = 'edit';
dialogForm.value = { ...proxy };
dialogVisible.value = true;
}
export function closeDialog() {
dialogVisible.value = false;
}
// 搜索
export const searchKeyword = ref('');