mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:38:53 +08:00
resetOnQuickSaveFailed
This commit is contained in:
parent
0fdc0ab42d
commit
048f34ef9a
@ -173,6 +173,11 @@ export interface CRUDCommonSchema extends BaseSchema {
|
||||
*/
|
||||
quickSaveItemApi?: SchemaApi;
|
||||
|
||||
/**
|
||||
* 当快速编辑接口请求失败时,是否重置表格编辑状态
|
||||
*/
|
||||
resetOnQuickSaveFailed?: boolean;
|
||||
|
||||
/**
|
||||
* 保存排序的 api
|
||||
*/
|
||||
@ -360,7 +365,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
filterTogglable: false,
|
||||
filterDefaultVisible: true,
|
||||
loadDataOnce: false,
|
||||
loadDataOnceFetchOnFilter: true
|
||||
loadDataOnceFetchOnFilter: true,
|
||||
resetOnQuickSaveFailed: false
|
||||
};
|
||||
|
||||
control: any;
|
||||
@ -1055,7 +1061,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
primaryField,
|
||||
env,
|
||||
messages,
|
||||
reload
|
||||
reload,
|
||||
resetOnQuickSaveFailed
|
||||
} = this.props;
|
||||
|
||||
if (Array.isArray(rows)) {
|
||||
@ -1110,7 +1117,9 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
reload && this.reloadTarget(reload, data);
|
||||
this.search(undefined, undefined, true, true);
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
resetOnQuickSaveFailed && this.control.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user