= memo(props => {
const deletable = globalConfig?.edge?.deletable ?? true;
const panelonClose = globalConfig?.nodePanel?.onClose;
+ const getNodesJ = nodes => {
+ const result = nodes.map(item => {
+ const { data, ...rest } = item;
+ const { _nodeType, ...restData } = data;
+ return {
+ ...rest,
+ data: restData,
+ type: _nodeType,
+ };
+ });
+ return result;
+ };
+ console.log('121212', nodes, getNodesJ(nodes),edges);
+
return (
= memo(props => {
},
deletable: deletable, //默认连线属性受此项控制
}}
- onBeforeDelete={async()=>{
- if(readOnly){
- return false
+ onBeforeDelete={async () => {
+ if (readOnly) {
+ return false;
}
- return true
+ return true;
}}
onConnect={onConnect}
onNodesChange={changes => {
@@ -350,8 +368,8 @@ const XFlow: FC = memo(props => {
if (!isTruthy(activeNode?._status) || !openLogPanel) {
setActiveNode(null);
}
- if(isFunction(panelonClose)){
- panelonClose(activeNode?.id)
+ if (isFunction(panelonClose)) {
+ panelonClose(activeNode?.id);
}
}}
node={activeNode}