Skip to content

Commit bb2c7db

Browse files
变量赋值:支持设置为空
1 parent de6a04b commit bb2c7db

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

apps/application/flow/step_node/variable_assign_node/impl/base_variable_assign_node.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ def handle(self, variable, evaluation):
8989
val = self.convert(val, variable.get('target_type'))
9090
evaluation(variable, val)
9191
result['output_value'] = val
92+
elif variable['type'] == 'null':
93+
val = None
94+
evaluation(variable, val)
95+
result['output_value'] = val
9296
else:
9397
val = variable['value']
9498
val = self.convert(val, variable.get('target_type'))

ui/src/workflow/nodes/variable-assign-node/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ import { WorkflowMode } from '@/enums/application'
187187
const workflowMode = inject('workflowMode') as WorkflowMode
188188
const props = defineProps<{ nodeModel: any }>()
189189
190-
const typeOptions = ['string', 'num', 'json', 'bool']
190+
const typeOptions = ['string', 'num', 'json', 'bool', 'null']
191191
const targetTypeOptions = [
192192
{ label: t('workflow.nodes.variableAssignNode.doNotConvert'), key: '' },
193193
{ label: 'string', key: 'string' },

0 commit comments

Comments
 (0)