mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat:page增加onBulkChange
This commit is contained in:
parent
3890a174d4
commit
91edbf429a
@ -51,7 +51,7 @@ const result = async (req, res) => {
|
||||
? data
|
||||
: data.filter(function (item) {
|
||||
return browser ? ~item.browser.indexOf(browser) : false;
|
||||
})[0] || data[0]
|
||||
})[0]
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -558,14 +558,12 @@ export class FormItemWrap extends React.Component<FormItemProps> {
|
||||
ctx,
|
||||
!!(autoFill.api as BaseApiObject)?.silent
|
||||
);
|
||||
if (!result) return;
|
||||
|
||||
this.lastSearchTerm = getVariable(result, itemName) ?? term;
|
||||
this.lastSearchTerm =
|
||||
(result && getVariable(result, itemName)) ?? term;
|
||||
|
||||
if (autoFill?.fillMapping) {
|
||||
result = dataMapping(autoFill.fillMapping, result);
|
||||
}
|
||||
|
||||
result && onBulkChange?.(result);
|
||||
}
|
||||
}
|
||||
|
@ -284,6 +284,7 @@ export default class Page extends React.Component<PageProps> {
|
||||
bulkBindFunctions<Page /*为毛 this 的类型自动识别不出来?*/>(this, [
|
||||
'handleAction',
|
||||
'handleChange',
|
||||
'handleBulkChange',
|
||||
'handleQuery',
|
||||
'handleDialogConfirm',
|
||||
'handleDialogClose',
|
||||
@ -690,6 +691,10 @@ export default class Page extends React.Component<PageProps> {
|
||||
onChange?.apply(null, arguments);
|
||||
}
|
||||
|
||||
handleBulkChange(values: Object) {
|
||||
this.props.store?.updateData?.(values);
|
||||
}
|
||||
|
||||
renderHeader() {
|
||||
const {
|
||||
title,
|
||||
@ -789,6 +794,7 @@ export default class Page extends React.Component<PageProps> {
|
||||
onAction: this.handleAction,
|
||||
onQuery: initApi ? this.handleQuery : undefined,
|
||||
onChange: this.handleChange,
|
||||
onBulkChange: this.handleBulkChange,
|
||||
pageLoading: store.loading
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user