feat(flowEditor): 添加基础节点组件并优化数据转换逻辑
- 在 flowEditor 目录下新增 basicNode 文件夹和 BasicNode 组件 - 更新 convertFlowData 函数,增加 nodeType 字段 - 在 FlowEditor 组件中注册 BasicNode 节点类型master
parent
b9b5ec2f19
commit
ebc6de6965
@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
import styles from '@/pages/flowEditor/node/style/base.module.less';
|
||||
import NodeContent from '@/pages/flowEditor/components/nodeContent';
|
||||
|
||||
interface BasicNodeData {
|
||||
title?: string;
|
||||
parameters?: {
|
||||
inputs?: any[];
|
||||
outputs?: any[];
|
||||
};
|
||||
showFooter?: boolean;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
const BasicNode = ({ data }: { data: BasicNodeData }) => {
|
||||
const title = data.title || '基础节点';
|
||||
return (
|
||||
<div className={styles['node-container']}>
|
||||
<div className={styles['node-header']} style={{ backgroundColor: '#ea911b' }}>
|
||||
{title}
|
||||
</div>
|
||||
|
||||
<NodeContent data={{ ...data }} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default BasicNode;
|
||||
Loading…
Reference in New Issue