From d1908582c195856a16d8b59375ce0cc9bef6ac6d Mon Sep 17 00:00:00 2001 From: asp_ly Date: Sat, 14 Dec 2024 15:41:23 +0800 Subject: [PATCH] 1 --- .../Workflow/Definition/Design/index.tsx | 65 ++++++++++++++++--- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/frontend/src/pages/Workflow/Definition/Design/index.tsx b/frontend/src/pages/Workflow/Definition/Design/index.tsx index 7e6e2e2e..e1a31849 100644 --- a/frontend/src/pages/Workflow/Definition/Design/index.tsx +++ b/frontend/src/pages/Workflow/Definition/Design/index.tsx @@ -88,6 +88,14 @@ const WorkflowDesign: React.FC = () => { rubberband: true, movable: true, showNodeSelectionBox: true, + strict: true, + selectCellOnMoved: true, + selectNodeOnMoved: true, + selectEdgeOnMoved: true, + multipleSelectionModifiers: ['ctrl', 'meta'], + showEdgeSelectionBox: true, + showAnchorSelectionBox: true, + pointerEvents: 'auto' }, snapline: true, keyboard: { @@ -120,7 +128,25 @@ const WorkflowDesign: React.FC = () => { }, }); - graph.use(new Selection()); + // 初始化Selection插件 + const selection = new Selection({ + enabled: true, + multiple: true, + rubberband: true, + movable: true, + showNodeSelectionBox: true, + strict: true, + selectCellOnMoved: true, + selectNodeOnMoved: true, + selectEdgeOnMoved: true, + multipleSelectionModifiers: ['ctrl', 'meta'], + showEdgeSelectionBox: true, + showAnchorSelectionBox: true, + pointerEvents: 'auto' + }); + console.log('Initializing Selection plugin:', selection); + graph.use(selection); + graph.use(new MiniMap({ container: minimapContainerRef.current!, width: minimapWidth, @@ -782,18 +808,39 @@ const WorkflowDesign: React.FC = () => { - +