diff --git a/src/pages/flowEditor/index.tsx b/src/pages/flowEditor/index.tsx index 7a08c13..fe239b2 100644 --- a/src/pages/flowEditor/index.tsx +++ b/src/pages/flowEditor/index.tsx @@ -59,6 +59,7 @@ const FlowEditor: React.FC = () => { event.dataTransfer.dropEffect = 'move'; }, []); + // 侧边栏节点实例 const onDrop = useCallback( (event: React.DragEvent) => { event.preventDefault(); diff --git a/src/pages/flowEditor/node/basicNode/BasicNode.tsx b/src/pages/flowEditor/node/basicNode/BasicNode.tsx index 333fd4d..2029b0d 100644 --- a/src/pages/flowEditor/node/basicNode/BasicNode.tsx +++ b/src/pages/flowEditor/node/basicNode/BasicNode.tsx @@ -6,8 +6,10 @@ import { useStore } from '@xyflow/react'; interface BasicNodeData { title?: string; parameters?: { - inputs?: any[]; - outputs?: any[]; + dataIns?: any[]; + dataOuts?: any[]; + apiIns?: any[]; + apiOuts?: any[]; }; showFooter?: boolean; diff --git a/src/pages/flowEditor/node/endNode/EndNode.tsx b/src/pages/flowEditor/node/endNode/EndNode.tsx index 0c89d43..e5c3728 100644 --- a/src/pages/flowEditor/node/endNode/EndNode.tsx +++ b/src/pages/flowEditor/node/endNode/EndNode.tsx @@ -6,8 +6,10 @@ import { useStore } from '@xyflow/react'; interface EndNodeData { title?: string; parameters?: { - inputs?: any[]; - outputs?: any[]; + dataIns?: any[]; + dataOuts?: any[]; + apiIns?: any[]; + apiOuts?: any[]; }; showFooter?: boolean; diff --git a/src/pages/flowEditor/node/index.tsx b/src/pages/flowEditor/node/index.tsx index 3f7b15f..6cce302 100644 --- a/src/pages/flowEditor/node/index.tsx +++ b/src/pages/flowEditor/node/index.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { NodeTypes } from '@xyflow/react'; -import TextUpdaterNode from './textUpdateNode/TextUpdaterNode'; import StartNode from './startNode/StartNode'; import EndNode from './endNode/EndNode'; import DraggableNode from './draggableNode/DraggableNode'; @@ -8,7 +7,6 @@ import BasicNode from './basicNode/BasicNode'; // 定义所有可用的节点类型 export const nodeTypes: NodeTypes = { - textUpdater: TextUpdaterNode, start: StartNode, end: EndNode, draggable: DraggableNode, @@ -17,7 +15,6 @@ export const nodeTypes: NodeTypes = { // 节点类型映射,用于创建节点时的类型查找 export const nodeTypeMap: Record = { - 'textUpdater': 'textUpdater', 'start': 'start', 'end': 'end', 'draggable': 'draggable', @@ -26,7 +23,6 @@ export const nodeTypeMap: Record = { // 节点显示名称映射 export const nodeTypeNameMap: Record = { - 'textUpdater': '文本更新节点', 'start': '开始节点', 'end': '结束节点', 'draggable': '任务节点', @@ -41,10 +37,10 @@ export const registerNodeType = ( ) => { // 在nodeTypes中注册节点组件 (nodeTypes as any)[type] = component; - + // 在nodeTypeMap中添加类型映射 nodeTypeMap[type] = type; - + // 在nodeTypeNameMap中添加显示名称 nodeTypeNameMap[type] = displayName || type; }; diff --git a/src/pages/flowEditor/node/startNode/StartNode.tsx b/src/pages/flowEditor/node/startNode/StartNode.tsx index e270c51..ccafa6a 100644 --- a/src/pages/flowEditor/node/startNode/StartNode.tsx +++ b/src/pages/flowEditor/node/startNode/StartNode.tsx @@ -6,8 +6,10 @@ import { useStore } from '@xyflow/react'; interface StartNodeData { title?: string; parameters?: { - inputs?: any[]; - outputs?: any[]; + dataIns?: any[]; + dataOuts?: any[]; + apiIns?: any[]; + apiOuts?: any[]; }; showFooter?: boolean; diff --git a/src/pages/flowEditor/node/textUpdateNode/TextUpdaterNode.module.less b/src/pages/flowEditor/node/textUpdateNode/TextUpdaterNode.module.less deleted file mode 100644 index 99e34e4..0000000 --- a/src/pages/flowEditor/node/textUpdateNode/TextUpdaterNode.module.less +++ /dev/null @@ -1,8 +0,0 @@ -.text-updater-node { - //width: 150px; - //height: 80px; - padding: 20px; - border-radius: 15px; - border: 1px solid #cccccc; - background-color: #fff; -} \ No newline at end of file diff --git a/src/pages/flowEditor/node/textUpdateNode/TextUpdaterNode.tsx b/src/pages/flowEditor/node/textUpdateNode/TextUpdaterNode.tsx deleted file mode 100644 index a9f8a49..0000000 --- a/src/pages/flowEditor/node/textUpdateNode/TextUpdaterNode.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import React, { useCallback } from 'react'; -import style from './TextUpdaterNode.module.less'; -import { Handle, NodeProps, Position } from '@xyflow/react'; - -interface TextUpdaterNodeData { - data?: string; - id?: string; -} - const TextUpdaterNode: React.FC = (props) => { - const onChange = useCallback((evt: React.ChangeEvent) => { - console.log(evt.target.value); - }, []); - - return ( -
-
- - -
- - - - - - -
- ); -}; - -export default TextUpdaterNode; \ No newline at end of file