Skip to content

Commit 29e5f3c

Browse files
authored
fix: After one click beautification in the loop body, the workflow of the loop body becomes smaller and smaller. (#4464)
1 parent 489c7b6 commit 29e5f3c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ui/src/workflow/nodes/loop-body-node/LoopBodyContainer.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ function enlargeHandle() {
217217
props.nodeModel.setHeight(height.value)
218218
}
219219
}
220+
const zoom = () => {
221+
if (enlarge.value) {
222+
enlargeHandle()
223+
}
224+
}
225+
defineExpose({ close, zoom })
220226
</script>
221227
<style lang="scss" scoped>
222228
.workflow-node-container {

ui/src/workflow/nodes/loop-body-node/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<LoopBodyContainer :nodeModel="nodeModel">
2+
<LoopBodyContainer :nodeModel="nodeModel" ref="LoopBodyContainerRef">
33
<div ref="containerRef" @wheel.stop style="height: 100%; width: 100%"></div>
44
</LoopBodyContainer>
55
</template>
@@ -19,7 +19,7 @@ const loop_workflow_mode = inject('loopWorkflowMode') || WorkflowMode.Applicatio
1919
const nodes: any = import.meta.glob('@/workflow/nodes/**/index.ts', { eager: true })
2020
const props = defineProps<{ nodeModel: any }>()
2121
const containerRef = ref()
22-
22+
const LoopBodyContainerRef = ref<InstanceType<typeof LoopBodyContainer>>()
2323
const validate = () => {
2424
const workflow = new WorkFlowInstance(lf.value.getGraphData(), WorkflowMode.ApplicationLoop)
2525
return Promise.all(lf.value.graphModel.nodes.map((element: any) => element?.validate?.()))
@@ -159,6 +159,7 @@ const renderGraphData = (data?: any) => {
159159
}
160160
161161
const loopLayout = () => {
162+
LoopBodyContainerRef.value?.zoom()
162163
lf.value?.extension?.dagre.layout()
163164
}
164165
onMounted(() => {

0 commit comments

Comments
 (0)