Merge pull request #464 from RickCole21/master

crud handlebulkaction 后 feedback层多加个ctx
This commit is contained in:
liaoxuezhi 2020-02-27 18:55:39 +08:00 committed by GitHub
commit 90926bfeb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -428,18 +428,19 @@ export default class CRUD extends React.Component<CRUDProps, any> {
(action.messages && action.messages.failed) ||
(messages && messages.saveFailed)
})
.then(async () => {
if (action.feedback && isVisible(action.feedback, store.data)) {
await this.openFeedback(action.feedback, store.data);
.then(async (payload: object) => {
const data = createObject(ctx, payload);
if (action.feedback && isVisible(action.feedback, data)) {
await this.openFeedback(action.feedback, data);
stopAutoRefreshWhenModalIsOpen && clearTimeout(this.timer);
}
action.reload
? this.reloadTarget(action.reload, store.data)
? this.reloadTarget(action.reload, data)
: this.search({[pageField || 'page']: 1}, undefined, true);
action.redirect &&
env.jumpTo(filter(action.redirect, store.data), action);
env.jumpTo(filter(action.redirect, data), action);
})
.catch(() => null);
} else if (onAction) {