feat: keycard change place

This commit is contained in:
scarqin
2024-12-24 14:37:45 +08:00
parent ac56f9f7a6
commit fb90189f3c
@@ -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
})
})