From b3c9305f83b20c8958f9a1529ddd6ce0572b85c6 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 9 Dec 2025 15:08:16 +0800 Subject: [PATCH] fix: The loop nodes in the canvas are prohibited from being copied into the loop body, and the continue and break nodes inside the loop body are also prohibited from being copied into the loop body --- ui/src/workflow/common/shortcut.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/workflow/common/shortcut.ts b/ui/src/workflow/common/shortcut.ts index d6ff118920d..79c084d9d5d 100644 --- a/ui/src/workflow/common/shortcut.ts +++ b/ui/src/workflow/common/shortcut.ts @@ -4,6 +4,7 @@ import { type GraphModel } from '@logicflow/core' import { MsgSuccess, MsgError, MsgConfirm } from '@/utils/message' import { WorkflowType } from '@/enums/application' import { t } from '@/locales' +import { getMenuNodes } from './data' let selected: any | null = null function translationNodeData(nodeData: any, distance: any) { @@ -73,6 +74,9 @@ export function initDefaultShortcut(lf: LogicFlow, graph: GraphModel) { const paste_node = () => { if (!keyboardOptions?.enabled) return true if (graph.textEditElement) return true + const menus = getMenuNodes(lf.graphModel.get_provide(null, null).workflowMode) + const nodes = menus?.flatMap((m: any) => m.list).map((n) => n.type) + selected.nodes = selected.nodes.filter((n: any) => nodes?.includes(n.type)) if (selected && (selected.nodes || selected.edges)) { lf.clearSelectElements() const addElements = lf.addElements(selected, CHILDREN_TRANSLATION_DISTANCE)