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 ae2beb4 commit 6413269
Show file tree
Hide file tree
Showing 3 changed files with 5,577 additions and 4,469 deletions.
5 changes: 3 additions & 2 deletions packages/editor/src/components/FlowNode/FlowNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ function FlowNode(_: any, ref: any) {
);
};
// 条件节点
const ConditionNode = ({ children }: any) => {
const ConditionNode = ({ children, id }: any) => {
return (
<div className="condition-node">
<div className="title">分支</div>
<div className="node-list">{children}</div>
<span className="arrow-line"></span>
<AddNode id={id} />
</div>
);
};
Expand Down Expand Up @@ -261,7 +262,7 @@ function FlowNode(_: any, ref: any) {
return <NormalNode key={node.id} node={node} />;
case 'condition':
return (
<ConditionNode key={node.id} title={node.title}>
<ConditionNode key={node.id} title={node.title} id={node.id}>
{node.children.map((item: any, index: number) => {
return (
<ConditionItem key={item.id} type={index === 0 ? 'start' : index == node.children.length - 1 ? 'end' : 'center'}>
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/src/components/FlowNode/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
}
}
.start-node,
.normal-node {
.normal-node,
.condition-node {
// 添加节点容器
.add-node-btn {
position: absolute;
Expand Down
Loading

0 comments on commit 6413269

Please sign in to comment.