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 () => {