From e0d60e46da7df244403a0c87ba4cf59ed378b3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E6=A2=A6?= Date: Thu, 16 Jan 2025 10:02:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=9D=A2=E6=9D=BFnode.data=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/x-flow/src/components/NodeEditor/index.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/x-flow/src/components/NodeEditor/index.tsx b/packages/x-flow/src/components/NodeEditor/index.tsx index 3e0329770..bca9c7d86 100644 --- a/packages/x-flow/src/components/NodeEditor/index.tsx +++ b/packages/x-flow/src/components/NodeEditor/index.tsx @@ -27,7 +27,13 @@ const NodeEditor: FC = (props: any) => { const [asyncSchema, setAsyncSchema] = useState({}); async function getSchema() { - const shema = await getSettingSchema(id, nodeType,nodeSetting,data,form).catch(() => ({})); + const shema = await getSettingSchema( + id, + nodeType, + nodeSetting, + data, + form + ).catch(() => ({})); setAsyncSchema(shema); } useEffect(() => { @@ -88,8 +94,8 @@ const NodeEditor: FC = (props: any) => { } }); } - const { _nodeType, _status } = node?.data; - node.data = { _nodeType, _status, ...data }; // form-render的list如果为空,不会返回list相应的字段,只能全部替换data + const { _nodeType, _status, _isCandidate, title, desc } = node?.data; + node.data = { _nodeType, _status, _isCandidate, title, desc, ...data }; // form-render的list如果为空,不会返回list相应的字段,只能全部替换data } }); setNodes(newNodes, false);