From ba59c4cab264fa299cbc886559d6353ea465061c Mon Sep 17 00:00:00 2001 From: Twilight Date: Sat, 14 Sep 2024 15:39:52 +0800 Subject: [PATCH] =?UTF-8?q?TODO:=20=E5=AE=8C=E6=88=90=E5=8A=A9=E7=90=86?= =?UTF-8?q?=E5=85=B1=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/settings/AssistantSettings.vue | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/components/settings/AssistantSettings.vue b/src/components/settings/AssistantSettings.vue index bb77666..88593a7 100644 --- a/src/components/settings/AssistantSettings.vue +++ b/src/components/settings/AssistantSettings.vue @@ -76,22 +76,34 @@ :options="librarySelects" /> - - 更新 + + 更新 + + 删除 + +
工具 -
-
- 工具 1 -
+
+
工具 1
+ + +
+
+ 助理共享 + + 新建助理 + +
+
@@ -138,6 +150,7 @@ import router from "@/router"; import { ref } from "vue"; import { EntityAssistant, + EntityAssistantShare, EntityAssistantTool, EntityLibrary, EntityTool, @@ -154,19 +167,24 @@ const currentAssistant: Ref = ref({}); const assistants: Ref = ref([]); const librarySelects: any = ref([]); const libraries: Ref = ref([]); +const assistantShares: Ref = ref([]); + async function getChats() { chatStore.chats = (await getApi().Chat.apiV1ChatsGet()).data.data; } -const deleteAssistant = async (id: number) => { +const deleteAssistant = async () => { dialog.warning({ title: "删除助理", content: "删除后,将不能恢复", positiveText: "确定", negativeText: "取消", onPositiveClick: async () => { - await getApi().Assistant.apiV1AssistantsIdDelete(id); + await getApi().Assistant.apiV1AssistantsIdDelete( + currentAssistantId.value + ); await getAssistants(); + showSettingsDialog.value = false; }, }); }; @@ -177,6 +195,8 @@ const showEditAssistant = async (id: number) => { currentAssistant.value = (await getApi().Assistant.apiV1AssistantsIdGet(id)).data.data ?? {}; + assistantShares.value = + (await getApi().Assistant.apiV1AssistantsIdSharesGet(id)).data.data ?? []; getTools(); }; @@ -207,6 +227,7 @@ const createAssistant = async () => { currentAssistant.value.description ?? currentAssistant.value.name ?? "", }); await getAssistants(); + showCreateDialog.value = false; }; const getLibraries = async () => {