refactor: ♻️ 删除优化 loading 和取消删除

This commit is contained in:
hxr
2024-06-25 22:02:57 +08:00
parent f023808450
commit 1dcd4ab0cd
5 changed files with 73 additions and 39 deletions

View File

@@ -283,12 +283,20 @@ function handleDelete(deptId?: number) {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
DeptAPI.deleteByIds(deptIds).then(() => {
ElMessage.success("删除成功");
handleResetQuery();
});
});
}).then(
() => {
loading.value = true;
DeptAPI.deleteByIds(deptIds)
.then(() => {
ElMessage.success("删除成功");
handleResetQuery();
})
.finally(() => (loading.value = false));
},
() => {
ElMessage.info("已取消删除");
}
);
}
/** 关闭弹窗 */