feat: keycard change place

This commit is contained in:
scarqin
2024-12-24 14:37:45 +08:00
parent 5ea0cc7838
commit b4c2b3614b
@@ -188,6 +188,20 @@ const AIFlowChart = () => {
}
}
}
if (n.type === 'keyCard') {
const modelId = n.id.replace('-keys', '')
const modelNode = sortedNodes.find((mn) => mn.id === modelId)
if (modelNode) {
const index = sortedNodes.findIndex((sn) => sn.id === modelId)
return {
...n,
position: {
x: LAYOUT.KEY_NODE_X,
y: LAYOUT.NODE_START_Y + index * LAYOUT.NODE_GAP
}
}
}
}
return n
})
})