From dd5d72740e39884712bf7190f56627b427740af3 Mon Sep 17 00:00:00 2001 From: ZLY Date: Fri, 9 Jan 2026 16:33:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=8F=AA=E5=85=81=E8=AE=B8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nodeEditors/BasicNodeEditor.tsx | 10 ++- .../nodeEditors/components/ParamsTable.tsx | 71 +++++++++++-------- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/src/components/FlowEditor/nodeEditors/BasicNodeEditor.tsx b/src/components/FlowEditor/nodeEditors/BasicNodeEditor.tsx index 487b58e..901aa44 100644 --- a/src/components/FlowEditor/nodeEditors/BasicNodeEditor.tsx +++ b/src/components/FlowEditor/nodeEditors/BasicNodeEditor.tsx @@ -75,7 +75,8 @@ const BasicNodeEditor: React.FC = ({ const getCompInfo = () => { const flatData = getCurrentProjectStoreData(); - setCurrentCompInfo(flatData.find((item: any) => item.id === nodeData.compId)); + const compInfo = flatData.find((item: any) => item.id === nodeData.compId); + setCurrentCompInfo(compInfo); }; const getCompInstance = async () => { const res: any = await queryInstance(nodeData.compId); @@ -93,6 +94,10 @@ const BasicNodeEditor: React.FC = ({ getCompInfo(); getCompInstance(); }, []); + + // 判断是否为基础组件(基础组件只允许修改默认值) + const isBaseComponent = nodeData.type === 'BASIC'; + return (
@@ -124,7 +129,6 @@ const BasicNodeEditor: React.FC = ({ = ({ onChange={(value) => handleSave({ ...record, dataType: value })} placeholder="请选择数据类型" /> - ) - ) + ); + } }, { title: '数组类型', dataIndex: 'arrayType', - render: (_: any, record: TableDataItem) => ( - record.dataType === 'ARRAY' ? ( - handleSave({ ...record, arrayType: value })} + placeholder="请选择数组类型" + /> + ); + } + if (record.dataType === 'ARRAY' && readonly) { + return {record.arrayType}; + } + return
-
; + } }, { title: '描述', dataIndex: 'desc', render: (_: any, record: TableDataItem) => ( - record.id === 'maxTime' ? ( + record.id === 'maxTime' || readonly ? ( ) : ( = ({ title: '操作', dataIndex: 'op', render: (_: any, record: TableDataItem) => ( - record.id !== 'maxTime' && + !readonly && record.id !== 'maxTime' && @@ -297,14 +304,16 @@ const ParamsTable: React.FC = ({ return ( <> - + {!readonly && ( + + )} ); };