From 06f78e1695a87f9fc69053cd05c008f657d3b4a7 Mon Sep 17 00:00:00 2001 From: Twilight Date: Sun, 15 Sep 2024 15:53:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/settings/AssistantSettings.vue | 4 ++-- src/components/settings/ChatSettings.vue | 5 ++--- src/components/settings/ToolSettings.vue | 7 +++++-- src/layouts/Header.vue | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/settings/AssistantSettings.vue b/src/components/settings/AssistantSettings.vue index 9a606df..b586031 100644 --- a/src/components/settings/AssistantSettings.vue +++ b/src/components/settings/AssistantSettings.vue @@ -249,9 +249,9 @@ const assistantApiKeys: Ref = ref([]); const isMobile = useIsMobile(); const drawerWidth = computed(() => { if (isMobile.value) { - return 400; + return window.innerWidth; } else { - return 600; + return window.innerWidth * 0.6; } }); diff --git a/src/components/settings/ChatSettings.vue b/src/components/settings/ChatSettings.vue index 4395be1..47d7b9c 100644 --- a/src/components/settings/ChatSettings.vue +++ b/src/components/settings/ChatSettings.vue @@ -92,12 +92,11 @@ import { useIsMobile } from "@/utils/composables"; const isMobile = useIsMobile(); const drawerWidth = computed(() => { if (isMobile.value) { - return 400; + return window.innerWidth; } else { - return 600; + return window.innerWidth * 0.6; } }); - const dialog = useDialog(); const chatStore = useChatStore(); const showSettingsDialog = ref(false); diff --git a/src/components/settings/ToolSettings.vue b/src/components/settings/ToolSettings.vue index e156709..6ac971f 100644 --- a/src/components/settings/ToolSettings.vue +++ b/src/components/settings/ToolSettings.vue @@ -67,12 +67,15 @@ const createToolRequest: Ref = ref({ const isMobile = useIsMobile(); const drawerWidth = computed(() => { if (isMobile.value) { - return 400; + return window.innerWidth; } else { - return 600; + return window.innerWidth * 0.6; } }); +/** + * 获取所有工具 + */ const getTools = async () => { toolStore.tools = (await getApi().Tool.apiV1ToolsGet()).data.data ?? []; }; diff --git a/src/layouts/Header.vue b/src/layouts/Header.vue index a4fed8e..0e5608f 100644 --- a/src/layouts/Header.vue +++ b/src/layouts/Header.vue @@ -137,7 +137,7 @@ const isMobile = useIsMobile(); const showDrawer = ref(false); const width = computed(() => { if (isMobile.value) { - return window.innerWidth - 100; + return window.innerWidth; } else { return window.innerWidth * 0.5; }