forked from p96170835/amis
调整自己处理 ajax 的优先级
This commit is contained in:
parent
7dff2fd9cb
commit
8384b97fc6
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue