Skip to content

Commit

Permalink
fix:修复form-render的数据变化,不会返回列表为空的字段造成的自定义表格无法删除最后一条数据的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
昔梦 committed Jan 15, 2025
1 parent beeab0d commit 3a5f100
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/x-flow/src/components/NodeEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const NodeEditor: FC<INodeEditorProps> = (props: any) => {
if (node) {
// 更新节点的 data
if (
(node?.data?._nodeType === 'Switch' ||
node?.data?._nodeType === 'Parallel')
node?.data?._nodeType === 'Switch' ||
node?.data?._nodeType === 'Parallel'
) {
data['list'] = (data?.list || [])?.map((item, index) => {
if (item?._id) {
Expand All @@ -88,8 +88,8 @@ const NodeEditor: FC<INodeEditorProps> = (props: any) => {
}
});
}

node.data = { ...node.data, ...data };
const { _nodeType, _status } = node?.data;
node.data = { _nodeType, _status, ...data }; // form-render的list如果为空,不会返回list相应的字段,只能全部替换data
}
});
setNodes(newNodes, false);
Expand Down

0 comments on commit 3a5f100

Please sign in to comment.