// 批量删除
var batchDelete = () => {
ElMessageBox.confirm("", "确认批量删除文件?", {
type: "warning",
center: true,
})
.then(() => {
multipleSelection.value.forEach((item) => {
var promiseList = new Set();
if (item.fileId >0) {
//并发请求,无序
let promise = function () {
return new Promise((resolve) => {
//删除接口
deleFilePermission().then((res) => {
if (res.code === 200) {
resolve();
}
});
});
};
promiseList.add(promise());
}
});
Promise.all(promiseList)
.then(() => {
//都成功进入
})
.catch(() =>{
//有一个失败进入
});
})
.catch(() => {});
};
Promise.all进行表单多选批量操作
最新推荐文章于 2023-07-17 22:03:59 发布