调整自己处理 ajax 的优先级

This commit is contained in:
liaoxuezhi 2019-08-28 11:34:13 +08:00
parent 7dff2fd9cb
commit 8384b97fc6
2 changed files with 7 additions and 3 deletions

View File

@ -611,6 +611,8 @@ export class DialogRenderer extends Dialog {
store.openDrawer(data);
} else if (action.actionType === 'reload') {
action.target && scoped.reload(action.target, data);
} else if (this.tryChildrenToHandle(action, data)) {
// do nothing
} else if (action.actionType === 'ajax') {
store
.saveRemote(action.api as string, data, {
@ -626,7 +628,7 @@ export class DialogRenderer extends Dialog {
action.reload && this.reloadTarget(action.reload, store.data);
})
.catch(() => {});
} else if (!this.tryChildrenToHandle(action, data) && onAction) {
} else if (onAction) {
let ret = onAction(e, action, data, throwErrors, true);
action.close && (ret && ret.then ? ret.then(this.handleSelfClose) : setTimeout(this.handleSelfClose, 200));
}

View File

@ -612,6 +612,8 @@ export class DrawerRenderer extends Drawer {
store.openDialog(data);
} else if (action.actionType === 'reload') {
action.target && scoped.reload(action.target, data);
} else if (this.tryChildrenToHandle(action, data)) {
// do nothing
} else if (action.actionType === 'ajax') {
store
.saveRemote(action.api as string, data, {
@ -627,8 +629,8 @@ export class DrawerRenderer extends Drawer {
action.reload && this.reloadTarget(action.reload, store.data);
})
.catch(() => {});
} else if (!this.tryChildrenToHandle(action, data) && onAction) {
const ret = onAction(e, action, data, throwErrors, true);
} else if (onAction) {
let ret = onAction(e, action, data, throwErrors, true);
action.close && (ret && ret.then ? ret.then(this.handleSelfClose) : setTimeout(this.handleSelfClose, 200));
}
}