feat(flow): 添加事件连线处理功能

master
钟良源 3 months ago
parent cbceb5a101
commit 49d06a9130

@ -1224,7 +1224,8 @@ export const useFlowCallbacks = (
} }
else { else {
const appFlowParams = { const appFlowParams = {
appEventList: {} appEventList: {},
eventEdges: []
}; };
nodes.forEach(node => { nodes.forEach(node => {
@ -1236,6 +1237,21 @@ export const useFlowCallbacks = (
const eventMap = new Map(); const eventMap = new Map();
edges.forEach((edge: any) => { edges.forEach((edge: any) => {
console.log('edge:', edge);
// 处理事件连线
appFlowParams.eventEdges.push({
id: edge.id,
source: edge.source,
target: edge.target,
lineType: 'data',
data: {
displayData: {
...edge.data.displayData
}
}
});
// 应用组件的桩点id就是事件id // 应用组件的桩点id就是事件id
const sourceId = edge.sourceHandle; const sourceId = edge.sourceHandle;
const targetId = edge.targetHandle; const targetId = edge.targetHandle;
@ -1260,7 +1276,7 @@ export const useFlowCallbacks = (
eventId: Array.from(new Set(item.eventId)) eventId: Array.from(new Set(item.eventId))
})); }));
try { try {
updateAppFlowData(appEventParams); updateAppFlowData(appFlowParams);
if (appEventParams.length > 0) { if (appEventParams.length > 0) {
for (const item of appEventParams) { for (const item of appEventParams) {
await sleep(500); await sleep(500);

Loading…
Cancel
Save