From e299e2707d9558604a2dee6f25c58ff2b6b81890 Mon Sep 17 00:00:00 2001 From: cc500 <2014434568@qq.com> Date: Tue, 20 May 2025 15:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=20=E8=8E=B7=E5=8F=96=20conversation=20?= =?UTF-8?q?=E6=97=B6=E5=B1=95=E7=A4=BA=E5=BD=93=E5=89=8D=E9=80=89=E6=8B=A9?= =?UTF-8?q?app=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/historySession.ts | 14 ++++++++++++++ src/views/dialogue/components/DialogueSession.vue | 15 +++++++++++++-- src/views/dialogue/components/MultiSelectTags.vue | 2 -- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/store/historySession.ts b/src/store/historySession.ts index 94f2c3a..430789c 100644 --- a/src/store/historySession.ts +++ b/src/store/historySession.ts @@ -21,6 +21,14 @@ export interface HistorySessionItem { title: string; createdTime: string | Date; docCount: number; + appId: string; + debug: boolean; + kbList: string[]; + llm:{ + icon: string; + modelName: string; + llmId: string; + } } export const useHistorySessionStore = defineStore( @@ -32,6 +40,7 @@ export const useHistorySessionStore = defineStore( const user_selected_app = ref(); const selectLLM = ref(); const currentSelectedSession = ref(''); + const { app } = storeToRefs(useSessionStore()); /** * 选择历史会话 * @param conversationId 会话id @@ -87,6 +96,11 @@ export const useHistorySessionStore = defineStore( historySession.value.forEach((item) => { if (item.conversationId === currentSelectedSession.value) { selectLLM.value = item.llm; + if(item.appId){ + app.value.appId = item.appId; + }else{ + app.value.appId = 'f8a0ebc4-79c4-4a81-b96b-fede6c03f309'; + } } }); }; diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index 73c54bc..5221103 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -631,11 +631,9 @@ onMounted(() => { }); watch(selectLLM, (newValue) => { - console.log(selectLLM); if (newValue) { selectedLLM.value.modalName = newValue.modelName; selectedLLM.value.icon = newValue.icon; - console.log(selectedLLM.value); selectedLLM.value = { ...selectLLM.value }; } }); @@ -684,6 +682,7 @@ const getappMode = (appId: string) => { }; } }); + console.log("getappMode", appId, Form.value); }; watch( @@ -705,6 +704,18 @@ watch( }, ); +watch( + () => app, + (val) => { + if (app.value) { + user_selected_app.value = app.value.appId; + } + }, + { + deep: true, + }, +); + watch( () => isCreateApp, (val) => { diff --git a/src/views/dialogue/components/MultiSelectTags.vue b/src/views/dialogue/components/MultiSelectTags.vue index 0891443..58e7fa0 100644 --- a/src/views/dialogue/components/MultiSelectTags.vue +++ b/src/views/dialogue/components/MultiSelectTags.vue @@ -100,11 +100,9 @@ const toggleModal = () => { // 待优化 const checkTagsOverflow = () => { const container = document.querySelector('.tags-container'); - console.log(container, 'container'); if (!container) return; const tags = container.querySelectorAll('.tag'); - console.log(tags, 'tags'); if (!tags.length) return; //重置所有标签的样式 -- Gitee