@@ -6,7 +6,7 @@ import type { ToolWorkflowRecord } from '@/api/types'
66import { MsgError } from ' @/utils/message'
77import { ConversationStream } from ' @/conversation-panel/stream'
88import { aggregators } from ' @/conversation-panel'
9- import ContentItem from ' @/conversation-panel/content/index.vue'
9+ import ContentList from ' @/conversation-panel/content-list /index.vue'
1010import ExecutionDetailContent from ' @/workflow-canvas/details/index.vue'
1111import { WorkflowMode } from ' @/workflow-canvas/types'
1212
@@ -25,6 +25,8 @@ interface ResumeParameters {
2525 formData? : Record <string , unknown >
2626 position? : unknown
2727 chunkId? : string
28+ chatRecordId? : string
29+
2830}
2931const props = defineProps <{ toolId: string }>()
3032const running = defineModel <boolean >(' running' , { default: false })
@@ -71,9 +73,9 @@ async function execute(extra: Record<string, unknown> = {}) {
7173 stream = new ConversationStream (
7274 response ,
7375 receiveChunk ,
74- () => {},
75- (error : unknown ) => {
76- streamError = error
76+ (error ? : unknown ) => {
77+ if (error ) streamError = error
78+ running . value = false
7779 },
7880 )
7981 await stream .start ()
@@ -88,16 +90,14 @@ async function execute(extra: Record<string, unknown> = {}) {
8890 }
8991 } finally {
9092 stream = undefined
91- running . value = false
93+
9294 }
9395}
9496
9597// 表单节点沿用同一条执行记录续跑,复用现有回复组件的 sendMessage 协议。
9698provide (' sendMessage' , (options : ResumeParameters ) => {
9799 if (running .value || ! visible .value ) return
98- const block = blocks .value .find ((entry ) => entry .id === options .chunkId )
99- if (block ) Object .assign (block , { is_submit: true , form_data: options .formData })
100- return execute ({ ... options .formData , position: options .position })
100+ return execute ({ ' form_data' :options .formData ,' chat_record_id' :options .chatRecordId , ' chunk_id' :options .chunkId ,position: options .position })
101101})
102102
103103function open(parameters : Record <string , unknown >) {
@@ -136,21 +136,21 @@ defineExpose({ open, close })
136136 <h4 class =" mk-title-decoration mb-4 mt-4" >回复内容</h4 >
137137
138138 <!-- // TODO: 回复内容 -->
139+ <el-card >
140+ <ContentList :content-list =" blocks " />
141+ <div v-if =" running" >回答中...</div >
142+ </el-card >
139143
140144 <template v-if =" record " >
141145 <h4 class =" mk-title-decoration my-4" >输出参数</h4 >
142- <el-alert
143- :title =" record.state === 'SUCCESS' ? '运行成功' : '运行失败'"
144- :type =" record.state === 'SUCCESS' ? 'success' : 'error'"
145- :closable =" false"
146- show-icon
147- class =" mb-4"
148- />
146+ <el-alert :title =" record.state === 'SUCCESS' ? '运行成功' : '运行失败'"
147+ :type =" record.state === 'SUCCESS' ? 'success' : 'error'" :closable =" false" show-icon class =" mb-4" />
149148 <pre class =" mk-gray-card whitespace-pre-wrap break-all" >{{ output }}</pre >
150149 </template >
151150 </el-tab-pane >
152151 <el-tab-pane label =" 执行详情" name =" details" >
153152 <!-- TODO 执行详情 -->
153+ <ExecutionDetailContent :detail =" executionDetails " :workflow-mode =" WorkflowMode .Tool " ></ExecutionDetailContent >
154154 </el-tab-pane >
155155 </el-tabs >
156156 </MkDrawer >
0 commit comments