|
|
|
|
@ -206,8 +206,6 @@ const FlowEditorMain: React.FC<FlowEditorMainProps> = (props) => {
|
|
|
|
|
return !isRunning; // 运行时禁止删除节点
|
|
|
|
|
}}
|
|
|
|
|
onNodesDelete={(deleted) => {
|
|
|
|
|
console.log('deleted:', deleted);
|
|
|
|
|
|
|
|
|
|
// 检查是否有循环节点
|
|
|
|
|
const loopNodes = deleted.filter(node =>
|
|
|
|
|
node.data?.type === 'LOOP_START' || node.data?.type === 'LOOP_END'
|
|
|
|
|
@ -298,10 +296,6 @@ const FlowEditorMain: React.FC<FlowEditorMainProps> = (props) => {
|
|
|
|
|
fitView
|
|
|
|
|
selectionOnDrag={!isRunning} // 运行时禁用拖拽选择
|
|
|
|
|
selectionMode={!isRunning ? SelectionMode.Partial : undefined} // 运行时禁用选择模式
|
|
|
|
|
panOnDrag={!isRunning ? [0, 1, 2] : []} // 运行时禁用拖拽平移
|
|
|
|
|
zoomOnScroll={!isRunning} // 运行时禁用滚轮缩放
|
|
|
|
|
zoomOnPinch={!isRunning} // 运行时禁用捏合缩放
|
|
|
|
|
panOnScrollSpeed={!isRunning ? 0.5 : 0} // 运行时禁用滚动平移
|
|
|
|
|
>
|
|
|
|
|
<Background />
|
|
|
|
|
<Panel position="top-left">
|
|
|
|
|
|