diff --git a/src/components/FlowEditor/nodeEditors/components/ParamsTable.tsx b/src/components/FlowEditor/nodeEditors/components/ParamsTable.tsx index 9097c8f..8e6c57b 100644 --- a/src/components/FlowEditor/nodeEditors/components/ParamsTable.tsx +++ b/src/components/FlowEditor/nodeEditors/components/ParamsTable.tsx @@ -13,15 +13,15 @@ interface TableDataItem { [key: string]: any; // 允许其他自定义字段 } -interface EndNodeTableProps { +interface ParamsTableProps { initialData: TableDataItem[]; onUpdateData: (data: TableDataItem[]) => void; } -const EndNodeTable: React.FC = ({ - initialData, - onUpdateData - }) => { +const ParamsTable: React.FC = ({ + initialData, + onUpdateData + }) => { const [data, setData] = useState([]); useEffect(() => { @@ -52,23 +52,31 @@ const EndNodeTable: React.FC = ({ title: '标识', dataIndex: 'id', render: (_: any, record: TableDataItem) => ( - handleSave({ ...record, id: value })} - /> + record.id === 'maxTime' ? ( + {record.id} + ) : ( + handleSave({ ...record, id: value })} + /> + ) ) }, { title: '数据类型', dataIndex: 'dataType', render: (_: any, record: TableDataItem) => ( - handleSave({ ...record, dataType: value })} + placeholder="请选择数据类型" + /> + ) ) }, { @@ -92,27 +100,41 @@ const EndNodeTable: React.FC = ({ title: '描述', dataIndex: 'desc', render: (_: any, record: TableDataItem) => ( - handleSave({ ...record, desc: value })} - /> + record.id === 'maxTime' ? ( + {record.desc} + ) : ( + handleSave({ ...record, desc: value })} + /> + ) ) }, { title: '默认值', dataIndex: 'defaultValue', render: (_: any, record: TableDataItem) => ( - handleSave({ ...record, defaultValue: value })} - /> + record.id === 'maxTime' ? ( + handleSave({ ...record, defaultValue: value })} + /> + ) : ( + handleSave({ ...record, defaultValue: value })} + /> + ) ) }, { title: '操作', dataIndex: 'op', render: (_: any, record: TableDataItem) => ( - ) @@ -168,4 +190,4 @@ const EndNodeTable: React.FC = ({ ); }; -export default EndNodeTable; \ No newline at end of file +export default ParamsTable; \ No newline at end of file