diff --git a/src/components/dialoguePanel/DialogueFlow.vue b/src/components/dialoguePanel/DialogueFlow.vue index 884ea2b85fc8a7472aceeefe672985f823b5b4ce..66816ebadaf3394fc329ba35e1c027330c7e22fa 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( }" >
- + -