crud bulkAction 的 redirect 功能补充

This commit is contained in:
2betop 2019-12-26 16:29:01 +08:00
parent 7b125bb4f6
commit baf68d6b71

View File

@ -379,7 +379,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
onAction,
messages,
pageField,
stopAutoRefreshWhenModalIsOpen
stopAutoRefreshWhenModalIsOpen,
env
} = this.props;
if (!selectedItems.length && action.requireSelected !== false) {
@ -430,6 +431,9 @@ export default class CRUD extends React.Component<CRUDProps, any> {
action.reload
? this.reloadTarget(action.reload, store.data)
: this.search({[pageField || 'page']: 1}, undefined, true);
action.redirect &&
env.jumpTo(filter(action.redirect, store.data), action);
})
.catch(() => null);
} else if (onAction) {