9090 />
9191 <slot ></slot >
9292 <template v-if =" nodeFields .length > 0 " >
93- <h5 class =" title-decoration-1 mb-8 mt-8" >
94- {{ $t('common.param.outputParam') }}
95- </h5 >
93+ <div class =" flex-between" >
94+ <h5 class =" title-decoration-1 mb-8 mt-8" >
95+ {{ $t('common.param.outputParam') }}
96+ </h5 >
97+ <el-switch
98+ v-if =" exceptionNodeList.includes(nodeModel.type)"
99+ v-model =" enable_exception"
100+ />
101+ </div >
102+
96103 <template v-for =" (item , index ) in nodeFields " :key =" index " >
97104 <div
98105 class =" flex-between border-r-6 p-8-12 mb-8 layout-bg lighter"
@@ -324,10 +331,25 @@ function clickNodes(item: any) {
324331
325332 closeNodeMenu ()
326333}
327-
328- const props = defineProps <{
329- nodeModel: any
330- }>()
334+ const enable_exception = computed ({
335+ set : (v ) => {
336+ set (props .nodeModel .properties , ' enableException' , v )
337+ },
338+ get : () => {
339+ if (props .nodeModel .properties .enableException !== undefined ) {
340+ return props .nodeModel .properties .enableException
341+ }
342+ set (props .nodeModel .properties , ' enableException' , false )
343+ return false
344+ },
345+ })
346+ const props = withDefaults (
347+ defineProps <{
348+ nodeModel: any
349+ exceptionNodeList? : string []
350+ }>(),
351+ { exceptionNodeList : () => [' ai-chat-node' ] },
352+ )
331353const nodeFields = computed (() => {
332354 if (props .nodeModel .properties .config .fields ) {
333355 const fields = props .nodeModel .properties .config .fields ?.map ((field : any ) => {
@@ -338,6 +360,17 @@ const nodeFields = computed(() => {
338360 globeValue: ` {{context['${props .nodeModel .id }'].${field .value }}} ` ,
339361 }
340362 })
363+ if (enable_exception .value ) {
364+ return [
365+ ... fields ,
366+ {
367+ label: ' 异常信息' ,
368+ value: ' exception' ,
369+ globeLabel: ` {{${props .nodeModel .properties .stepName }.exception}} ` ,
370+ globeValue: ` {{context['${props .nodeModel .id }'].exception}} ` ,
371+ },
372+ ]
373+ }
341374 return fields
342375 }
343376 return []
0 commit comments