From 4a651ced7de7262cb41c4f43a974f4eac6ab98a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=E9=AD=8F?= Date: Tue, 9 Sep 2025 19:21:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9AMCP=E7=BC=96=E8=BE=91config?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98=E3=80=82=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA=E4=BA=A4=E4=BA=92=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dialoguePanel/DialogueFlow.vue | 35 +++++++++++------ src/store/conversation.ts | 29 ++++++++++++-- src/views/api/components/McpDrawer.vue | 38 ++++++++++++------- .../dialogue/components/DialogueSession.vue | 1 + 4 files changed, 73 insertions(+), 30 deletions(-) diff --git a/src/components/dialoguePanel/DialogueFlow.vue b/src/components/dialoguePanel/DialogueFlow.vue index 884ea2b..66816eb 100644 --- a/src/components/dialoguePanel/DialogueFlow.vue +++ b/src/components/dialoguePanel/DialogueFlow.vue @@ -20,7 +20,6 @@ const props = withDefaults( const contents = ref(); const exData = ref([]); const exParam = ref([]); -const dataStatus = ref(false); const paramIndex = ref(0); const taskId = ref(); const totalTime = ref(0); @@ -32,7 +31,6 @@ if (props.flowdata) { for (const item of props.flowdata.data[0]) { if (item && item?.data.exData) { if (item.data.exData.reason) { - exData.value.push(item.data.exData); } else if (item.data.exData.message) { exParam.value.push(item.data.exData); } @@ -55,6 +53,7 @@ function getRiskType(risk) { const doFlow = async (type) => { if (taskId) { + exData.value.pop(); taskId.value = null; let content = ''; await sendQuestion( @@ -68,7 +67,6 @@ const doFlow = async (type) => { null, 'wait', ); - dataStatus.value = true; } }; @@ -112,10 +110,25 @@ watch( if (props.flowdata?.data.exParam) { exParam.value.push(props.flowdata?.data.exParam); } else { - dataStatus.value = false; exData.value.push(props.flowdata?.data.exData); } taskId.value = props.flowdata?.taskId; + } else { + let newContentList = props.flowdata?.data; + for (const newContent of newContentList) { + if (!(newContent instanceof Array)) { + continue; + } + for (const item of newContent) { + let input = item.data.input; + const isDuplicate = contents.value[0].data[0].some( + (it) => it.id === item.id, + ); + if (!isDuplicate && input) { + contents.value[0].data[0].push(item); + } + } + } } }, { deep: true, immediate: true }, @@ -133,7 +146,7 @@ watch( }" >
- + -