From cebaeafb1bbf9a6b0aea0c0dd4e4fa29de5a46b1 Mon Sep 17 00:00:00 2001 From: ZLY Date: Tue, 28 Oct 2025 11:28:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(utils):=E4=BC=98=E5=8C=96=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=95=B0=E6=8D=AE=E8=BD=AC=E6=8D=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91-=20=E7=A7=BB=E9=99=A4=E4=BA=8B=E4=BB=B6=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E5=92=8C=E5=8F=91=E9=80=81=E7=9A=84=E7=A9=BA=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=BF=87=E6=BB=A4=E9=80=BB=E8=BE=91=20-=20=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E4=BA=8B=E4=BB=B6=E5=88=97=E8=A1=A8=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD=20-=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E6=95=B0=E6=8D=AE=E8=BD=AC=E6=8D=A2=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/convertAppFlowData.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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: []