Skip to content

Commit

Permalink
fix: 调整 table setValue 当在 crud 中时由 crud 完成 setData (#11527)
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop authored Jan 21, 2025
1 parent 4cf711d commit bf3a494
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/amis/src/renderers/Cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,9 @@ export class CardsRenderer extends Cards {
targets.forEach(target => {
target.updateData(values);
});
} else if (this.props?.host) {
// 如果在 CRUD 里面,优先让 CRUD 去更新状态
return this.props.host.setData?.(values, replace, index, condition);
} else {
return store.updateData(values, undefined, replace);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/amis/src/renderers/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,9 @@ export class ListRenderer extends List {
targets.forEach(target => {
target.updateData(values);
});
} else if (this.props?.host) {
// 如果在 CRUD 里面,优先让 CRUD 去更新状态
return this.props.host.setData?.(values, replace, index, condition);
} else {
return store.updateData(values, undefined, replace);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/amis/src/renderers/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,9 @@ export class TableRendererBase<
targets.forEach(target => {
target.updateData(values);
});
} else if (this.props?.host) {
// 如果在 CRUD 里面,优先让 CRUD 去更新状态
return this.props.host.setData?.(values, replace, index, condition);
} else {
const data = {
...values,
Expand Down

0 comments on commit bf3a494

Please sign in to comment.