5656 v-model =" item.type"
5757 style =" max-width : 85px "
5858 class =" mr-8"
59- @change =" (val: string) => {
60- if (val === 'bool') {
61- form_data.variable_list[index].value = true;
62- } else {
63- form_data.variable_list[index].value = null;
59+ @change ="
60+ (val: string) => {
61+ if (val === 'bool') {
62+ form_data.variable_list[index].value = true
63+ } else {
64+ form_data.variable_list[index].value = null
65+ }
6466 }
65- } "
67+ "
6668 >
6769 <el-option v-for =" item in typeOptions" :key =" item" :label =" item" :value =" item" />
6870 </el-select >
166168import { cloneDeep , set } from ' lodash'
167169import NodeContainer from ' @/workflow/common/NodeContainer.vue'
168170import NodeCascader from ' @/workflow/common/NodeCascader.vue'
169- import { computed , nextTick , onMounted , ref } from ' vue'
171+ import { computed , nextTick , onMounted , ref , inject } from ' vue'
170172import { isLastNode } from ' @/workflow/common/data'
171173import { randomId } from ' @/utils/common'
172174import { t } from ' @/locales'
173-
175+ import { WorkflowMode } from ' @/enums/application'
176+ const workflowMode = inject (' workflowMode' ) as WorkflowMode
174177const props = defineProps <{ nodeModel: any }>()
175178
176179const typeOptions = [' string' , ' num' , ' json' , ' bool' ]
@@ -257,7 +260,10 @@ function deleteVariable(index: number) {
257260}
258261
259262function variableChange(item : any ) {
260- props .nodeModel .graphModel .nodes .map ((node : any ) => {
263+ ;(workflowMode == WorkflowMode .ApplicationLoop
264+ ? [... props .nodeModel .graphModel .nodes , ... props .nodeModel .graphModel .get_parent_nodes ()]
265+ : props .nodeModel .graphModel .nodes
266+ ).map ((node : any ) => {
261267 if (node .id === ' start-node' ) {
262268 node .properties .config .globalFields .forEach ((field : any ) => {
263269 if (field .value === item .fields [1 ]) {
@@ -270,6 +276,13 @@ function variableChange(item: any) {
270276 }
271277 })
272278 }
279+ if (node .id === ' loop-start-node' ) {
280+ node .properties .loop_input_field_list .forEach ((field : any ) => {
281+ if (field .field === item .fields [1 ]) {
282+ item .name = field .label
283+ }
284+ })
285+ }
273286 })
274287}
275288
0 commit comments