|
@@ -61,7 +61,7 @@
|
|
|
<div class="icons adfac" v-if="item.answer">
|
|
|
<el-popover popper-class="icon_pop" placement="bottom" trigger="hover" content="重新生成">
|
|
|
<template #reference>
|
|
|
- <img alt="重新生成" :src="isSx?require('@/assets/images/agent/dialog_sx2.png'):require('@/assets/images/agent/dialog_sx1.png')" @click="handleSx(index)" class="f">
|
|
|
+ <img alt="重新生成" :src="isSx?require('@/assets/images/agent/dialog_sx2.png'):require('@/assets/images/agent/dialog_sx1.png')" @click="handleSx(index,item?.taskId)" class="f">
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
<el-popover popper-class="icon_pop" placement="bottom" trigger="hover" content="复制">
|
|
@@ -167,7 +167,7 @@
|
|
|
import DOMPurify from 'dompurify';
|
|
|
import { ref, getCurrentInstance, watch } from 'vue'
|
|
|
import useClipboard from 'vue-clipboard3';
|
|
|
- import { sendChatMessageStream } from '@/api/agent'
|
|
|
+ import { sendChatMessageStream,stopChatMessage } from '@/api/agent'
|
|
|
const { toClipboard } = useClipboard();
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const uploadUrl = `${window.SITE_CONFIG["apiURL"]}/sys/oss/uploadFile`
|
|
@@ -316,7 +316,7 @@
|
|
|
currentTaskId.value = jsonData?.task_id || '';
|
|
|
dialogList.value = [...dialogList.value].map((item, idx) => {
|
|
|
if (idx === dialogList.value.length - 1) {
|
|
|
- return { ...item, answer: item.answer + (jsonData?.answer.replace(/(\r\n|\n|\r)+/g, '<br>') || '') };
|
|
|
+ return { ...item, answer: item.answer + (jsonData?.answer.replace(/(\r\n|\n|\r)+/g, '<br>') || ''),taskId: jsonData?.task_id || '' };
|
|
|
}
|
|
|
return item;
|
|
|
});
|
|
@@ -336,14 +336,15 @@
|
|
|
return DOMPurify.sanitize(html);
|
|
|
}
|
|
|
|
|
|
- const handleSx = (index) => {
|
|
|
- // isSx.value = !isSx.value;
|
|
|
- dialogList.value[index].answer = '';
|
|
|
- let query = dialogList.value[index-1].question;
|
|
|
- startStream(query)
|
|
|
+ const handleSx = (index,taskId) => {
|
|
|
+ stopChatMessage(taskId).then((res) => {
|
|
|
+ if(res.code!==0) return proxy.$modal.msgError(res.message);
|
|
|
+ dialogList.value[index].answer = '';
|
|
|
+ let query = dialogList.value[index-1].question;
|
|
|
+ startStream(query)
|
|
|
+ })
|
|
|
}
|
|
|
const handleFz = async (index) => {
|
|
|
- // isFz.value = !isFz.value;
|
|
|
try {
|
|
|
await toClipboard(dialogList.value[index].answer);
|
|
|
proxy.$message.success('复制成功');
|