Skip to content

Commit 4ab9407

Browse files
简化赋值为null的配置。
1 parent bb2c7db commit 4ab9407

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ 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
9692
else:
9793
val = variable['value']
9894
val = self.convert(val, variable.get('target_type'))
9995
evaluation(variable, val)
10096
result['output_value'] = val
97+
elif variable['source'] == 'null':
98+
val = None
99+
evaluation(variable, val)
100+
result['output_value'] = val
101101
else:
102102
reference = self.get_reference_content(variable['reference'])
103103
reference = self.convert(reference, variable.get('target_type'))

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<el-select :teleported="false" v-model="item.source" size="small" style="width: 85px">
4646
<el-option :label="$t('workflow.variable.Referencing')" value="referencing" />
4747
<el-option :label="$t('common.custom')" value="custom" />
48+
<el-option :label="null" value="null" />
4849
</el-select>
4950
</div>
5051

@@ -86,7 +87,6 @@
8687
></el-input>
8788
</el-form-item>
8889
<el-form-item
89-
class="w-full"
9090
v-else-if="item.type === 'num'"
9191
:prop="'variable_list.' + index + '.value'"
9292
:rules="{
@@ -152,7 +152,7 @@
152152
<el-option v-for="item2 in targetTypeOptions" :key="item2.key" :label="item2.label" :value="item2.key" />
153153
</el-select>
154154
</div>
155-
<el-form-item v-else>
155+
<el-form-item v-else-if="item.source === 'referencing'">
156156
<NodeCascader
157157
ref="nodeCascaderRef2"
158158
:nodeModel="nodeModel"
@@ -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', 'null']
190+
const typeOptions = ['string', 'num', 'json', 'bool']
191191
const targetTypeOptions = [
192192
{ label: t('workflow.nodes.variableAssignNode.doNotConvert'), key: '' },
193193
{ label: 'string', key: 'string' },

0 commit comments

Comments
 (0)