mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 解决删除失败无法关闭弹窗的BUG
This commit is contained in:
parent
e1f0079585
commit
c6ad2f9a8e
@ -29,20 +29,29 @@ export const useDeleteData = <P = any, R = any>(
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
instance.cancelButtonLoading = true;
|
||||
const res = await api(params);
|
||||
done();
|
||||
if (!res) return reject(false);
|
||||
resolve(true);
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: i18n.global.t('commons.msg.operationSuccess'),
|
||||
});
|
||||
|
||||
await api(params)
|
||||
.then((res) => {
|
||||
done();
|
||||
if (!res) return reject(false);
|
||||
resolve(true);
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: i18n.global.t('commons.msg.operationSuccess'),
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
instance.confirmButtonLoading = false;
|
||||
instance.cancelButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
})
|
||||
.then(() => {})
|
||||
.then(() => {
|
||||
console.log('1111');
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user