|
|
|
@ -60,8 +60,6 @@ export const useFlowCallbacks = (
|
|
|
|
const apiOuts = nodeParams.apiOuts || [];
|
|
|
|
const apiOuts = nodeParams.apiOuts || [];
|
|
|
|
const apiIns = nodeParams.apiIns || [];
|
|
|
|
const apiIns = nodeParams.apiIns || [];
|
|
|
|
|
|
|
|
|
|
|
|
console.log('123:', apiIns, apiOuts);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (apiOuts.some((api: any) => (api.name || api.id) === handleId) ||
|
|
|
|
if (apiOuts.some((api: any) => (api.name || api.id) === handleId) ||
|
|
|
|
apiIns.some((api: any) => (api.name || api.id) === handleId) || (handleId.includes('loop'))) {
|
|
|
|
apiIns.some((api: any) => (api.name || api.id) === handleId) || (handleId.includes('loop'))) {
|
|
|
|
return 'api';
|
|
|
|
return 'api';
|
|
|
|
@ -605,6 +603,15 @@ export const useFlowCallbacks = (
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nodeType === 'SWITCH') {
|
|
|
|
|
|
|
|
newNode.data.component = {
|
|
|
|
|
|
|
|
customDef: JSON.stringify({
|
|
|
|
|
|
|
|
apiOutIds: ['default'],
|
|
|
|
|
|
|
|
conditions: []
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 将未定义的节点动态追加进nodeTypes
|
|
|
|
// 将未定义的节点动态追加进nodeTypes
|
|
|
|
const nodeMap = Array.from(Object.values(nodeTypeMap).map(key => key));
|
|
|
|
const nodeMap = Array.from(Object.values(nodeTypeMap).map(key => key));
|
|
|
|
if (!nodeMap.includes(nodeType)) {
|
|
|
|
if (!nodeMap.includes(nodeType)) {
|
|
|
|
@ -707,6 +714,15 @@ export const useFlowCallbacks = (
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nodeType === 'SWITCH') {
|
|
|
|
|
|
|
|
newNode.data.component = {
|
|
|
|
|
|
|
|
customDef: JSON.stringify({
|
|
|
|
|
|
|
|
apiOutIds: ['default'],
|
|
|
|
|
|
|
|
conditions: []
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 将未定义的节点动态追加进nodeTypes
|
|
|
|
// 将未定义的节点动态追加进nodeTypes
|
|
|
|
const nodeMap = Array.from(Object.values(nodeTypeMap).map(key => key));
|
|
|
|
const nodeMap = Array.from(Object.values(nodeTypeMap).map(key => key));
|
|
|
|
// 目前默认添加的都是系统组件/本地组件
|
|
|
|
// 目前默认添加的都是系统组件/本地组件
|
|
|
|
|