bugfix: 报告生成
This commit is contained in:
@@ -109,7 +109,7 @@
|
|||||||
handleSendMessage({
|
handleSendMessage({
|
||||||
text: initialData.text,
|
text: initialData.text,
|
||||||
images: initialData.images,
|
images: initialData.images,
|
||||||
useReport:initialData.useReport,
|
useReport: initialData.useReport,
|
||||||
tempImages: initialData.tempImages
|
tempImages: initialData.tempImages
|
||||||
})
|
})
|
||||||
// 更新 configParams
|
// 更新 configParams
|
||||||
@@ -131,7 +131,10 @@
|
|||||||
isPaused.value = false
|
isPaused.value = false
|
||||||
isGenerating.value = true
|
isGenerating.value = true
|
||||||
params.message = message.text
|
params.message = message.text
|
||||||
params.useReport = message.useReport
|
if (message.hasOwnProperty('useReport')) {
|
||||||
|
params.useReport = message.useReport
|
||||||
|
}
|
||||||
|
|
||||||
params.imageUrlList = message.images || []
|
params.imageUrlList = message.images || []
|
||||||
|
|
||||||
// 如果不是重新生成模式,则添加用户消息到列表
|
// 如果不是重新生成模式,则添加用户消息到列表
|
||||||
@@ -241,13 +244,11 @@
|
|||||||
for (let event of events) {
|
for (let event of events) {
|
||||||
if (!event.trim()) continue
|
if (!event.trim()) continue
|
||||||
|
|
||||||
// 解析事件名称(从 event:xxx 行)
|
const eventName = event
|
||||||
const eventName =
|
.split(/\n/)
|
||||||
event
|
.find((line) => line.startsWith('event:'))
|
||||||
.split(/\n/)
|
?.replace(/^event:\s*/, '')
|
||||||
.find((line) => line.startsWith('event:'))
|
?.trim()
|
||||||
?.replace(/^event:\s*/, '')
|
|
||||||
?.trim() || ''
|
|
||||||
|
|
||||||
if (!hasReportStarted && eventName === 'report') {
|
if (!hasReportStarted && eventName === 'report') {
|
||||||
isGeneratingReport.value = true
|
isGeneratingReport.value = true
|
||||||
@@ -281,7 +282,7 @@
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if (eventName === 'todo') {
|
if (eventName === 'todo') {
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
let isNodeIdEvent = eventName === 'nodeId'
|
let isNodeIdEvent = eventName === 'nodeId'
|
||||||
@@ -295,9 +296,10 @@
|
|||||||
.filter((content) => content.startsWith('{') || content.startsWith('['))
|
.filter((content) => content.startsWith('{') || content.startsWith('['))
|
||||||
// console.log('dataLInes', dataLines)
|
// console.log('dataLInes', dataLines)
|
||||||
if (isNodeIdEvent) {
|
if (isNodeIdEvent) {
|
||||||
const versionID = event.split(/\n/)
|
const versionID = event
|
||||||
.filter((line) => line.startsWith('data:'))
|
.split(/\n/)
|
||||||
.map((line) => line.replace(/^data:\s*/, ''))[0]
|
.filter((line) => line.startsWith('data:'))
|
||||||
|
.map((line) => line.replace(/^data:\s*/, ''))[0]
|
||||||
params.versionID = versionID
|
params.versionID = versionID
|
||||||
projectStore.setProject({ nodeId: versionID })
|
projectStore.setProject({ nodeId: versionID })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="left flex align-center">
|
<div class="left flex align-center">
|
||||||
<div class="agent-operate flex flex-center">
|
<div class="agent-operate flex flex-center">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="top-end"
|
placement="top"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
popper-class="agent-plus-popover"
|
popper-class="agent-plus-popover"
|
||||||
>
|
>
|
||||||
@@ -684,9 +684,11 @@
|
|||||||
const payload = {
|
const payload = {
|
||||||
text: inputValue.value.trim(),
|
text: inputValue.value.trim(),
|
||||||
images: imageUrlList,
|
images: imageUrlList,
|
||||||
useReport: reportTags.value.length > 0,
|
|
||||||
tempImages: uploadedImages.value
|
tempImages: uploadedImages.value
|
||||||
}
|
}
|
||||||
|
if (reportTags.value.length > 0) {
|
||||||
|
payload.useReport = true
|
||||||
|
}
|
||||||
emits('send', payload)
|
emits('send', payload)
|
||||||
// 发送后清空图片列表
|
// 发送后清空图片列表
|
||||||
uploadedImages.value = []
|
uploadedImages.value = []
|
||||||
@@ -1367,7 +1369,9 @@
|
|||||||
border: none !important;
|
border: none !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
margin-bottom: -1rem;
|
margin-bottom: -1rem;
|
||||||
pointer-events: none;
|
width: fit-content !important;
|
||||||
|
min-width: initial !important;
|
||||||
|
//pointer-events: none;
|
||||||
.el-popper__arrow:before {
|
.el-popper__arrow:before {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user