Commit 48397525 authored by chenshouchao's avatar chenshouchao

feat: 解决edgesid不唯一的问题、解决edges为null的报错问题

parent dc267a9b
...@@ -63,6 +63,7 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -63,6 +63,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
item?.edges.map((every) => { item?.edges.map((every) => {
return { return {
...every, ...every,
id: `${every.id}_${count}`,
source: `${every.source}_${count}`, source: `${every.source}_${count}`,
target: `${every.target}_${count}`, target: `${every.target}_${count}`,
}; };
...@@ -75,7 +76,7 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -75,7 +76,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
x: item.type === "BATCH" ? x : item.position?.x, x: item.type === "BATCH" ? x : item.position?.x,
y: item.type === "BATCH" ? y : item.position?.y, y: item.type === "BATCH" ? y : item.position?.y,
}, },
edges: newEdges?.length ? newEdges : item?.edges, edges: newEdges?.length ? newEdges : [],
}; };
}); });
return newVal; return newVal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment