|
|
|
|
@ -35,6 +35,7 @@ import { defaultNodeTypes } from '@/components/FlowEditor/node/types/defaultType
|
|
|
|
|
import { localNodeData } from '@/pages/flowEditor/sideBar/config/localNodeData';
|
|
|
|
|
import { useAlignmentGuidelines } from '@/hooks/useAlignmentGuidelines';
|
|
|
|
|
import { setMainFlow } from '@/api/appRes';
|
|
|
|
|
import { Message } from '@arco-design/web-react';
|
|
|
|
|
|
|
|
|
|
const edgeTypes: EdgeTypes = {
|
|
|
|
|
custom: CustomEdge
|
|
|
|
|
@ -604,10 +605,16 @@ const FlowEditor: React.FC<{ initialData?: any }> = ({ initialData }) => {
|
|
|
|
|
// 转换会原始数据类型
|
|
|
|
|
const revertedData = revertFlowData(nodes, edges);
|
|
|
|
|
|
|
|
|
|
const res = await setMainFlow(revertedData, initialData.id);
|
|
|
|
|
const res: any = await setMainFlow(revertedData, initialData.id);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
Message.success('保存成功');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
Message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error saving flow data:', error);
|
|
|
|
|
// 可以添加错误提示
|
|
|
|
|
Message.error(error);
|
|
|
|
|
}
|
|
|
|
|
}, [nodes, edges]);
|
|
|
|
|
|
|
|
|
|
|