bugfix: 报告生成

This commit is contained in:
2026-03-18 17:24:52 +08:00
parent dd27ffd229
commit e80bb86ef1
2 changed files with 22 additions and 16 deletions

View File

@@ -109,7 +109,7 @@
handleSendMessage({
text: initialData.text,
images: initialData.images,
useReport:initialData.useReport,
useReport: initialData.useReport,
tempImages: initialData.tempImages
})
// 更新 configParams
@@ -131,7 +131,10 @@
isPaused.value = false
isGenerating.value = true
params.message = message.text
params.useReport = message.useReport
if (message.hasOwnProperty('useReport')) {
params.useReport = message.useReport
}
params.imageUrlList = message.images || []
// 如果不是重新生成模式,则添加用户消息到列表
@@ -241,13 +244,11 @@
for (let event of events) {
if (!event.trim()) continue
// 解析事件名称(从 event:xxx 行)
const eventName =
event
.split(/\n/)
.find((line) => line.startsWith('event:'))
?.replace(/^event:\s*/, '')
?.trim() || ''
const eventName = event
.split(/\n/)
.find((line) => line.startsWith('event:'))
?.replace(/^event:\s*/, '')
?.trim()
if (!hasReportStarted && eventName === 'report') {
isGeneratingReport.value = true
@@ -281,7 +282,7 @@
break
}
if (eventName === 'todo') {
break
continue
}
let isNodeIdEvent = eventName === 'nodeId'
@@ -295,9 +296,10 @@
.filter((content) => content.startsWith('{') || content.startsWith('['))
// console.log('dataLInes', dataLines)
if (isNodeIdEvent) {
const versionID = event.split(/\n/)
.filter((line) => line.startsWith('data:'))
.map((line) => line.replace(/^data:\s*/, ''))[0]
const versionID = event
.split(/\n/)
.filter((line) => line.startsWith('data:'))
.map((line) => line.replace(/^data:\s*/, ''))[0]
params.versionID = versionID
projectStore.setProject({ nodeId: versionID })
}

View File

@@ -37,7 +37,7 @@
<div class="left flex align-center">
<div class="agent-operate flex flex-center">
<el-popover
placement="top-end"
placement="top"
trigger="click"
popper-class="agent-plus-popover"
>
@@ -684,9 +684,11 @@
const payload = {
text: inputValue.value.trim(),
images: imageUrlList,
useReport: reportTags.value.length > 0,
tempImages: uploadedImages.value
}
if (reportTags.value.length > 0) {
payload.useReport = true
}
emits('send', payload)
// 发送后清空图片列表
uploadedImages.value = []
@@ -1367,7 +1369,9 @@
border: none !important;
padding: 0 !important;
margin-bottom: -1rem;
pointer-events: none;
width: fit-content !important;
min-width: initial !important;
//pointer-events: none;
.el-popper__arrow:before {
display: none;
}