Skip to content

Commit

Permalink
Merge pull request #1615 from alibaba/xflow
Browse files Browse the repository at this point in the history
fix:修复节点面板node.data问题
  • Loading branch information
lhbxs authored Jan 16, 2025
2 parents 3c1ab3e + e0d60e4 commit c91f8fb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/x-flow/src/components/NodeEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ const NodeEditor: FC<INodeEditorProps> = (props: any) => {
const [asyncSchema, setAsyncSchema] = useState<Schema>({});

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(() => {
Expand Down Expand Up @@ -88,8 +94,8 @@ const NodeEditor: FC<INodeEditorProps> = (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);
Expand Down

0 comments on commit c91f8fb

Please sign in to comment.