Skip to content

Commit

Permalink
feat: 修改新增节点的判断逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaojunnanya committed Sep 2, 2024
1 parent d4efabb commit 410af57
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/editor/src/components/FlowNode/FlowNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ function FlowNode(_: any, ref: any) {
if (type === 'normal') {
nodeList.splice(node.index + 1, 0, taskNode);
} else {
if(node.selfNode.type === 'start'){
message.error('开始节点后第一个不能添加分支节点');
return;
}
if(node.selfNode.type === 'condition'){
message.error('分支节点后第一个不能添加分支节点');
return;
}
nodeList.splice(node.index + 1, 0, {
...taskNode,
children: [
Expand All @@ -169,7 +177,7 @@ function FlowNode(_: any, ref: any) {
}
} else if (node?.parentNode?.type === 'condition') {
if (type === 'condition') {
message.error('分支节点第一个不能添加分支节点');
message.error('分支节点后第一个不能添加分支节点');
return;
}
node.parentNode.children[node.index].children.unshift(taskNode);
Expand Down

0 comments on commit 410af57

Please sign in to comment.