From 32e5b3273f1fae3c8607bda874066974394b06ae Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:10:48 +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 (#4470) --- 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 d6ff11892..79c084d9d 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)