From f2c2c60127dad3d842d96a055eef3ffabe3ab8fd Mon Sep 17 00:00:00 2001 From: Gsh <15170702455@163.com> Date: Tue, 20 Jan 2026 00:38:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=B7=E6=B1=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E4=BC=98=E5=8C=96=EF=BC=8C=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/console/channel/index.vue | 350 +++++++++++++----- 1 file changed, 253 insertions(+), 97 deletions(-) diff --git a/Yi.Ai.Vue3/src/pages/console/channel/index.vue b/Yi.Ai.Vue3/src/pages/console/channel/index.vue index 1580bd86..ddea45b9 100644 --- a/Yi.Ai.Vue3/src/pages/console/channel/index.vue +++ b/Yi.Ai.Vue3/src/pages/console/channel/index.vue @@ -2,7 +2,7 @@ import type { AiAppDto, AiModelDto, AppShortcutDto } from '@/api/channel/types'; import { Delete, Edit, Plus, Refresh, View } from '@element-plus/icons-vue'; import { ElMessage, ElMessageBox } from 'element-plus'; -import { onMounted, ref } from 'vue'; +import { onMounted, onUnmounted, ref } from 'vue'; import { clearPremiumModelCache, createApp, @@ -16,6 +16,12 @@ import { updateModel, } from '@/api/channel'; +// 移动端检测 +const isMobile = ref(false); +function checkMobile() { + isMobile.value = window.innerWidth < 768; +} + // ==================== 应用管理 ==================== const appList = ref([]); const appLoading = ref(false); @@ -151,7 +157,7 @@ async function handleBatchApply() { try { // 批量更新应用(只更新终结点和API Key,不修改应用名称) - const promises = selectedAppIds.value.map(appId => { + const promises = selectedAppIds.value.map((appId) => { // 获取当前应用信息,保留原有名称和排序 const currentApp = appList.value.find(a => a.id === appId); return updateApp({ @@ -185,7 +191,8 @@ function toggleAppSelection(appId: string) { const index = selectedAppIds.value.indexOf(appId); if (index > -1) { selectedAppIds.value.splice(index, 1); - } else { + } + else { selectedAppIds.value.push(appId); } } @@ -352,14 +359,20 @@ async function handleClearCache() { // 初始化 onMounted(() => { + checkMobile(); + window.addEventListener('resize', checkMobile); fetchAppList(); fetchShortcutList(); }); + +onUnmounted(() => { + window.removeEventListener('resize', checkMobile); +});