mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-18 01:11:55 +08:00
fix: #815
This commit is contained in:
parent
b2b9576d4e
commit
17be487958
@ -544,6 +544,41 @@ export const cloneNode = (sourceNode: WorkflowNode, { withCopySuffix, nodeIdMap
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WorkflowNodeType.Condition:
|
||||
{
|
||||
const stack = [] as Expr[];
|
||||
|
||||
const expr = (draft.config as WorkflowNodeConfigForCondition).expression;
|
||||
if (expr) {
|
||||
stack.push(expr);
|
||||
|
||||
while (stack.length > 0) {
|
||||
const n = stack.pop()!;
|
||||
|
||||
if ("left" in n) {
|
||||
stack.push(n.left);
|
||||
|
||||
if ("selector" in n.left) {
|
||||
const prevNodeId = n.left.selector.id;
|
||||
if (nodeIdMap.has(prevNodeId)) {
|
||||
n.left.selector.id = nodeIdMap.get(prevNodeId)!;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ("right" in n) {
|
||||
stack.push(n.right);
|
||||
}
|
||||
}
|
||||
|
||||
draft.config = {
|
||||
...draft.config,
|
||||
expression: expr,
|
||||
} as WorkflowNodeConfigForCondition;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user