diff --git a/src/utils/convertAppFlowData.ts b/src/utils/convertAppFlowData.ts index b3c6f34..22ad08a 100644 --- a/src/utils/convertAppFlowData.ts +++ b/src/utils/convertAppFlowData.ts @@ -15,10 +15,8 @@ export const convertAppFlowData = (appFlowData: any[]) => { // 处理每个应用流程数据项(每个应用作为一个节点) appFlowData.forEach((app: any, index: number) => { // 添加过滤逻辑:如果 eventListenes 和 eventSends 都为空,则不生成节点 - const hasEventListenes = app.eventListenes && app.eventListenes.length > 0 && - app.eventListenes.some((event: any) => event && !event.topic?.includes('**empty**')); - const hasEventSends = app.eventSends && app.eventSends.length > 0 && - app.eventSends.some((event: any) => event && !event.topic?.includes('**empty**')); + const hasEventListenes = app.eventListenes && app.eventListenes.length > 0; + const hasEventSends = app.eventSends && app.eventSends.length > 0; // 如果两者都为空,则跳过当前应用节点的创建 if (!hasEventListenes && !hasEventSends) { @@ -40,7 +38,7 @@ export const convertAppFlowData = (appFlowData: any[]) => { dataType: '', defaultValue: '', topic: event.topic - })).filter((event: any) => event && !event.topic?.includes('**empty**')) : [], + })) : [], // eventSends 作为 apiOuts(输出) apiOuts: app.eventSends ? app.eventSends.map((event: any) => ({ name: event.eventName, @@ -48,7 +46,7 @@ export const convertAppFlowData = (appFlowData: any[]) => { dataType: '', defaultValue: '', topic: event.topic - })).filter((event: any) => event && !event.topic?.includes('**empty**')) : [], + })) : [], // 提取 dataIns 和 dataOuts 属性 dataIns: [], dataOuts: []