From c5f06422a4bb62bef2b8cf174408ff756103bcf9 Mon Sep 17 00:00:00 2001 From: Junki Date: Tue, 7 May 2024 15:57:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/modal/Setting.vue | 4 +-- .../views/ai-calendar/AICalendar.vue | 35 +++++++++++++------ src/renderer/src/i18n/local/en_US.json | 1 + src/renderer/src/i18n/local/zh_CN.json | 1 + 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/renderer/src/components/modal/Setting.vue b/src/renderer/src/components/modal/Setting.vue index 25f50fa..450a51c 100644 --- a/src/renderer/src/components/modal/Setting.vue +++ b/src/renderer/src/components/modal/Setting.vue @@ -677,9 +677,7 @@ onMounted(() => { v-for="m in chatModels[settingStore.aiCalendar.bigModel.provider]" :key="m.name" > - {{ - m['name'] - }} + {{ m['name'] }} diff --git a/src/renderer/src/components/views/ai-calendar/AICalendar.vue b/src/renderer/src/components/views/ai-calendar/AICalendar.vue index 3a741fe..904a58f 100644 --- a/src/renderer/src/components/views/ai-calendar/AICalendar.vue +++ b/src/renderer/src/components/views/ai-calendar/AICalendar.vue @@ -19,6 +19,9 @@ const calendarStore = useCalendarStore() // i18n const { t } = useI18n() +// 阻断控制 +let abortCtr = new AbortController() + // 数据绑定 const data = reactive({ currentSessionId: randomUUID(), @@ -233,6 +236,14 @@ const generateReport = async () => { ...otherOption }) } + +// 手动结束 +const stopGenerateReport = () => { + data.currentSessionId = randomUUID() + systemStore.aiCalendarLoading = false + abortCtr.abort() + abortCtr = new AbortController() +}