mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
chore: 调整弹窗错误提示逻辑,显示后 3 秒消失 (#9868)
This commit is contained in:
parent
7e03085faf
commit
95787b98ef
@ -398,6 +398,7 @@ export default class Dialog extends React.Component<DialogProps> {
|
||||
statusStore && isAlive(statusStore) && statusStore.resetAll();
|
||||
if (isAlive(store)) {
|
||||
store.reset();
|
||||
store.clearMessage();
|
||||
store.setEntered(false);
|
||||
if (typeof lazySchema === 'function') {
|
||||
store.setSchema('');
|
||||
@ -938,7 +939,8 @@ export class DialogRenderer extends Dialog {
|
||||
store.updateMessage(reason.message, true);
|
||||
store.markBusying(false);
|
||||
|
||||
if (reason.constructor?.name === ValidateError.name) {
|
||||
// 通常都是数据错误,过 3 秒自动清理错误信息
|
||||
// if (reason.constructor?.name === ValidateError.name) {
|
||||
clearTimeout(this.clearErrorTimer);
|
||||
this.clearErrorTimer = setTimeout(() => {
|
||||
if (this.isDead) {
|
||||
@ -946,7 +948,7 @@ export class DialogRenderer extends Dialog {
|
||||
}
|
||||
store.updateMessage('');
|
||||
}, 3000);
|
||||
}
|
||||
// }
|
||||
});
|
||||
|
||||
return true;
|
||||
|
@ -448,6 +448,7 @@ export default class Drawer extends React.Component<DrawerProps> {
|
||||
statusStore && isAlive(statusStore) && statusStore.resetAll();
|
||||
if (isAlive(store)) {
|
||||
store.reset();
|
||||
store.clearMessage();
|
||||
store.setEntered(false);
|
||||
if (typeof lazySchema === 'function') {
|
||||
store.setSchema('');
|
||||
@ -891,12 +892,13 @@ export class DrawerRenderer extends Drawer {
|
||||
store.updateMessage(reason.message, true);
|
||||
store.markBusying(false);
|
||||
|
||||
if (reason.constructor?.name === ValidateError.name) {
|
||||
// 通常都是数据错误,过 3 秒自动清理错误信息
|
||||
// if (reason.constructor?.name === ValidateError.name) {
|
||||
clearTimeout(this.clearErrorTimer);
|
||||
this.clearErrorTimer = setTimeout(() => {
|
||||
store.updateMessage('');
|
||||
}, 3000);
|
||||
}
|
||||
// }
|
||||
});
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user