Skip to content

Commit

Permalink
fix: editableTable处在formList内部取值问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
xg15472 committed Oct 23, 2024
1 parent 8fb0113 commit dbbfa9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions packages/antd/src/editable-table/editable-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export type EditableTableColumn = Omit<ColumnsType['0'], 'render'> & {
tableRowName: EditableTableName;
operation: FormListOperation;
index: number;
getTableRowData: () => TPlainObject;
}) => ReactElement | null;
/** table datasource children column 自定义渲染 */
tableChildrenColumnRender?: (
Expand Down Expand Up @@ -268,6 +269,12 @@ export const EditableTable = (props: EditableTableProps) => {
operation: record.operation,
tableRowName,
index,
getTableRowData: () => {
if (props.completeName) {
return form.getFieldValue([...props.completeName, record.name]);
}
return form.getFieldValue(tableRowName);
},
});
if (customRender) {
return customRender;
Expand All @@ -280,6 +287,12 @@ export const EditableTable = (props: EditableTableProps) => {
tableRowIndex: record.name,
tableRowName,
getTableRowData: () => {
if (props.completeName) {
return form.getFieldValue([
...props.completeName,
record.name,
]);
}
return form.getFieldValue(tableRowName);
},
})
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3506,7 +3506,7 @@ __metadata:
"@flatjs/cli": "npm:2.1.9"
"@hyperse/antd": "workspace:^"
"@hyperse/eslint-config-hyperse": "npm:^1.2.4"
"@hyperse/utils": "npm:^1.0.2"
"@hyperse/utils": "npm:^1.0.3"
"@tinymce/tinymce-react": "npm:5.1.1"
"@types/node": "npm:22.7.9"
"@types/react": "npm:^18.3.12"
Expand Down Expand Up @@ -3567,7 +3567,7 @@ __metadata:
languageName: node
linkType: hard

"@hyperse/utils@npm:^1.0.2, @hyperse/utils@workspace:^, @hyperse/utils@workspace:packages/utils":
"@hyperse/utils@npm:^1.0.3, @hyperse/utils@workspace:^, @hyperse/utils@workspace:packages/utils":
version: 0.0.0-use.local
resolution: "@hyperse/utils@workspace:packages/utils"
dependencies:
Expand Down

0 comments on commit dbbfa9c

Please sign in to comment.