refactor(flowEditor): 抽离参数表格组件
- 从 EndNodeEditor 和 StartNodeEditor 中提取公共的参数表格逻辑 - 新增 ParamsTable 组件用于渲染参数表格 - 优化了参数表格的添加、编辑和删除功能- 统一了参数表格的样式和交互master
parent
9a4187a8c3
commit
2e5c6bc70b
@ -1,27 +1,28 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { NodeEditorProps } from './index';
|
import { NodeEditorProps } from './index';
|
||||||
import { Form, Input } from '@arco-design/web-react';
|
import { Typography } from '@arco-design/web-react';
|
||||||
|
import { IconUnorderedList } from '@arco-design/web-react/icon';
|
||||||
|
import ParamsTable from './ParamsTable';
|
||||||
|
|
||||||
|
|
||||||
const StartNodeEditor: React.FC<NodeEditorProps> = ({
|
const StartNodeEditor: React.FC<NodeEditorProps> = ({
|
||||||
node,
|
node,
|
||||||
nodeData,
|
nodeData,
|
||||||
updateNodeData
|
updateNodeData
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Form layout="vertical">
|
<>
|
||||||
<Form.Item label="节点标题">
|
<Typography.Title heading={5}><IconUnorderedList style={{ marginRight: 5 }} />输出参数</Typography.Title>
|
||||||
<Input
|
<ParamsTable
|
||||||
value={nodeData.title || ''}
|
initialData={nodeData.parameters.dataOuts || []}
|
||||||
onChange={(value) => updateNodeData('title', value)}
|
onUpdateData={(data) => {
|
||||||
/>
|
updateNodeData('parameters', {
|
||||||
</Form.Item>
|
...nodeData.parameters,
|
||||||
<Form.Item label="描述">
|
dataOuts: data
|
||||||
<Input.TextArea
|
});
|
||||||
value={nodeData.description || ''}
|
}}
|
||||||
onChange={(value) => updateNodeData('description', value)}
|
/>
|
||||||
/>
|
</>
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue