fix: Error displaying execution details for assigning loop node variables (#4093)

This commit is contained in:
shaohuzhang1 2025-09-23 19:36:35 +08:00 committed by GitHub
parent 95fb124c07
commit d26b61f18b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 9 deletions

View File

@ -126,6 +126,9 @@ const renderGraphData = (data?: any) => {
}
}
lf.value.graphModel.refresh_loop_fields = refresh_loop_fields
lf.value.graphModel.get_parent_nodes = () => {
return props.nodeModel.graphModel.nodes
}
lf.value.graphModel.get_up_node_field_list = props.nodeModel.get_up_node_field_list
lf.value.batchRegister([...Object.keys(nodes).map((key) => nodes[key].default), AppEdge])
lf.value.setDefaultEdgeType('app-edge')

View File

@ -56,13 +56,15 @@
v-model="item.type"
style="max-width: 85px"
class="mr-8"
@change="(val: string) => {
if (val === 'bool') {
form_data.variable_list[index].value = true;
} else {
form_data.variable_list[index].value = null;
@change="
(val: string) => {
if (val === 'bool') {
form_data.variable_list[index].value = true
} else {
form_data.variable_list[index].value = null
}
}
}"
"
>
<el-option v-for="item in typeOptions" :key="item" :label="item" :value="item" />
</el-select>
@ -166,11 +168,12 @@
import { cloneDeep, set } from 'lodash'
import NodeContainer from '@/workflow/common/NodeContainer.vue'
import NodeCascader from '@/workflow/common/NodeCascader.vue'
import { computed, nextTick, onMounted, ref } from 'vue'
import { computed, nextTick, onMounted, ref, inject } from 'vue'
import { isLastNode } from '@/workflow/common/data'
import { randomId } from '@/utils/common'
import { t } from '@/locales'
import { WorkflowMode } from '@/enums/application'
const workflowMode = inject('workflowMode') as WorkflowMode
const props = defineProps<{ nodeModel: any }>()
const typeOptions = ['string', 'num', 'json', 'bool']
@ -257,7 +260,10 @@ function deleteVariable(index: number) {
}
function variableChange(item: any) {
props.nodeModel.graphModel.nodes.map((node: any) => {
;(workflowMode == WorkflowMode.ApplicationLoop
? [...props.nodeModel.graphModel.nodes, ...props.nodeModel.graphModel.get_parent_nodes()]
: props.nodeModel.graphModel.nodes
).map((node: any) => {
if (node.id === 'start-node') {
node.properties.config.globalFields.forEach((field: any) => {
if (field.value === item.fields[1]) {
@ -270,6 +276,13 @@ function variableChange(item: any) {
}
})
}
if (node.id === 'loop-start-node') {
node.properties.loop_input_field_list.forEach((field: any) => {
if (field.field === item.fields[1]) {
item.name = field.label
}
})
}
})
}