Commit 4115f646 authored by chenghong_tao's avatar chenghong_tao

fix loading及历史会话重复

parent d9b5230d
......@@ -134,7 +134,19 @@ const getConversationMsg = async (id) => {
taskStore.setMessageId('');
taskStore.setWorkflowRunId('');
console.log("result:", result);
emits("getHistoryMsg", result.data);
const data = result.data
// data是一个数组[{query: '....', ...}], 查询所有数据,根据query是否相同,如果有相同数据,则过滤仅保留最后一条
const uniqueData = data.reduce((acc, curr) => {
const existingIndex = acc.findIndex((item) => item.query === curr.query);
if (existingIndex === -1) {
acc.push(curr);
} else {
acc[existingIndex] = curr;
}
return acc;
}, []);
emits("getHistoryMsg", uniqueData);
};
const openEdit = (id) => {
......
......@@ -191,6 +191,7 @@ const reStartSSE = () => {
// if(workflowItemRef.value) {
// workflowItemRef.value.clearWorkflow();
// }
emits("messageFinished", false);
startSSE(props.query);
console.log('reStartSSE', props.query, props.messageType, props.content)
};
......
......@@ -70,9 +70,7 @@ const props = defineProps({
watch(
() => props.loadingFinished,
(newValue) => {
if (newValue) {
senderLoading.value = false;
}
senderLoading.value = !newValue;
}
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment