CRUD 一次性加载逻辑优化

This commit is contained in:
2betop 2020-06-15 15:40:40 +08:00
parent f62a7a20d0
commit ea52e58ceb

View File

@ -630,6 +630,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
this.search(
dialogAction.__from ? {[pageField || 'page']: 1} : undefined,
undefined,
true,
true
);
} else if (
@ -757,7 +758,15 @@ export default class CRUD extends React.Component<CRUDProps, any> {
evalExpression(stopAutoRefreshWhen, data)
)) &&
(this.timer = setTimeout(
silentPolling ? this.silentSearch : this.search,
silentPolling
? this.silentSearch.bind(this, undefined, undefined, true)
: this.search.bind(
this,
undefined,
undefined,
undefined,
true
),
Math.max(interval, 3000)
));
return value;
@ -765,8 +774,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
: source && store.initFromScope(data, source);
}
silentSearch(values?: object) {
return this.search(values, true);
silentSearch(values?: object, clearSelection?: boolean, forceReload = false) {
return this.search(values, true, clearSelection, forceReload);
}
handleChangePage(page: number, perPage?: number) {