()
+const enable_exception = computed({
+ set: (v) => {
+ set(props.nodeModel.properties, 'enableException', v)
+ },
+ get: () => {
+ if (props.nodeModel.properties.enableException !== undefined) {
+ return props.nodeModel.properties.enableException
+ }
+ set(props.nodeModel.properties, 'enableException', false)
+ return false
+ },
+})
+const props = withDefaults(
+ defineProps<{
+ nodeModel: any
+ exceptionNodeList?: string[]
+ }>(),
+ { exceptionNodeList: () => ['ai-chat-node'] },
+)
const nodeFields = computed(() => {
if (props.nodeModel.properties.config.fields) {
const fields = props.nodeModel.properties.config.fields?.map((field: any) => {
@@ -338,6 +360,17 @@ const nodeFields = computed(() => {
globeValue: `{{context['${props.nodeModel.id}'].${field.value}}}`,
}
})
+ if (enable_exception.value) {
+ return [
+ ...fields,
+ {
+ label: '异常信息',
+ value: 'exception',
+ globeLabel: `{{${props.nodeModel.properties.stepName}.exception}}`,
+ globeValue: `{{context['${props.nodeModel.id}'].exception}}`,
+ },
+ ]
+ }
return fields
}
return []
diff --git a/ui/src/workflow/common/app-node.ts b/ui/src/workflow/common/app-node.ts
index 1894d1831..1bc9864df 100644
--- a/ui/src/workflow/common/app-node.ts
+++ b/ui/src/workflow/common/app-node.ts
@@ -454,6 +454,15 @@ class AppNodeModel extends HtmlResize.model {
type: 'left',
})
}
+
+ if (this.properties.enableException) {
+ anchors.push({
+ x: x + width / 2 - 10,
+ y: y+(this.height/2) -80,
+ id: `${id}_exception_right`,
+ type: 'right',
+ })
+ }
anchors.push({
x: x + width / 2 - 10,
y: showNode ? y : y - 15,