|
|
|
@ -759,64 +759,83 @@ export default {
|
|
|
|
|
|
|
|
|
|
const idList= this.selectionList.map(item=>{ |
|
|
|
|
console.log('>>>>>>>>>',item); |
|
|
|
|
return{id:item.id,reservationCode:item.reservationCode,client:item.consignee} |
|
|
|
|
return item.id; |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const _arr = []; |
|
|
|
|
console.log(idList); |
|
|
|
|
if (idList.length > 0){ |
|
|
|
|
// this.fullscreenLoading = true; |
|
|
|
|
// this.dialogVisible = true; |
|
|
|
|
|
|
|
|
|
idList.forEach(item=>{ |
|
|
|
|
return _arr.push(handlePicture(item.id)); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('arr>>>>>>>>>>>>>>>>>>>>',_arr); |
|
|
|
|
function delayedTimer() { |
|
|
|
|
console.log('Delayed timer executed!'); |
|
|
|
|
} |
|
|
|
|
const timerId = setTimeout(delayedTimer, 500); |
|
|
|
|
Promise.all(_arr).then((response)=>{ |
|
|
|
|
|
|
|
|
|
console.log('response>>>>>>>>>>>>>>>>>>>>>',response); |
|
|
|
|
response.forEach((res, index) =>{ |
|
|
|
|
console.log('res>>>>>>>>>>>>>>>>>>>>>',res.data); |
|
|
|
|
if (res.data.size > 0){ |
|
|
|
|
const _item = idList[index]; |
|
|
|
|
const blob = new Blob([res.data], {type: 'application/zip'}); |
|
|
|
|
let a = document.createElement("a"); |
|
|
|
|
a.href = window.URL.createObjectURL(blob); |
|
|
|
|
// a.href = 'http://192.168.10.25:2888/D:/Test'; |
|
|
|
|
a.download = _item.client +'-'+_item.reservationCode +".zip"; |
|
|
|
|
// a.download = 'aaa' + ".zip"; |
|
|
|
|
a.style.display = "none"; |
|
|
|
|
document.body.appendChild(a); |
|
|
|
|
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 |
|
|
|
|
a.remove(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
for (let i = 0; i < 100; i++) { |
|
|
|
|
this.fileSize = i; |
|
|
|
|
} |
|
|
|
|
// this.dialogVisible = false; |
|
|
|
|
setTimeout(() => { |
|
|
|
|
clearTimeout(timerId); |
|
|
|
|
console.log('延迟执行完成'); |
|
|
|
|
this.fullscreenLoading = false; |
|
|
|
|
console.log("ids-------------->",idList); |
|
|
|
|
handlePicture(idList.join(",")).then(res=>{ |
|
|
|
|
if (res.data.size > 0){ |
|
|
|
|
// const _item = this.selectionList[index]; |
|
|
|
|
const blob = new Blob([res.data], {type: 'application/zip'}); |
|
|
|
|
let a = document.createElement("a"); |
|
|
|
|
a.href = window.URL.createObjectURL(blob); |
|
|
|
|
// a.href = 'http://192.168.10.25:2888/D:/Test'; |
|
|
|
|
// a.download = _item.client +'-'+_item.reservationCode +".zip"; |
|
|
|
|
a.download = (new Date()).valueOf() + ".zip"; |
|
|
|
|
a.style.display = "none"; |
|
|
|
|
document.body.appendChild(a); |
|
|
|
|
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 |
|
|
|
|
a.remove(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.$notify({ |
|
|
|
|
title: '提示', |
|
|
|
|
message: ('i', { style: 'color: teal'}, '开始下载...') |
|
|
|
|
}); |
|
|
|
|
}, 3000); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// const _arr = []; |
|
|
|
|
// console.log(idList); |
|
|
|
|
// if (idList.length > 0){ |
|
|
|
|
// // this.fullscreenLoading = true; |
|
|
|
|
// // this.dialogVisible = true; |
|
|
|
|
// |
|
|
|
|
// idList.forEach(item=>{ |
|
|
|
|
// |
|
|
|
|
// return _arr.push(handlePicture(item.id)); |
|
|
|
|
// }) |
|
|
|
|
// |
|
|
|
|
// |
|
|
|
|
// console.log('arr>>>>>>>>>>>>>>>>>>>>',_arr); |
|
|
|
|
// function delayedTimer() { |
|
|
|
|
// console.log('Delayed timer executed!'); |
|
|
|
|
// } |
|
|
|
|
// const timerId = setTimeout(delayedTimer, 500); |
|
|
|
|
// Promise.all(_arr).then((response)=>{ |
|
|
|
|
// |
|
|
|
|
// console.log('response>>>>>>>>>>>>>>>>>>>>>',response); |
|
|
|
|
// response.forEach((res, index) =>{ |
|
|
|
|
// console.log('res>>>>>>>>>>>>>>>>>>>>>',res.data); |
|
|
|
|
// if (res.data.size > 0){ |
|
|
|
|
// const _item = idList[index]; |
|
|
|
|
// const blob = new Blob([res.data], {type: 'application/zip'}); |
|
|
|
|
// let a = document.createElement("a"); |
|
|
|
|
// a.href = window.URL.createObjectURL(blob); |
|
|
|
|
// // a.href = 'http://192.168.10.25:2888/D:/Test'; |
|
|
|
|
// a.download = _item.client +'-'+_item.reservationCode +".zip"; |
|
|
|
|
// // a.download = 'aaa' + ".zip"; |
|
|
|
|
// a.style.display = "none"; |
|
|
|
|
// document.body.appendChild(a); |
|
|
|
|
// a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了 |
|
|
|
|
// a.remove(); |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// for (let i = 0; i < 100; i++) { |
|
|
|
|
// this.fileSize = i; |
|
|
|
|
// } |
|
|
|
|
// // this.dialogVisible = false; |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// clearTimeout(timerId); |
|
|
|
|
// console.log('延迟执行完成'); |
|
|
|
|
// this.fullscreenLoading = false; |
|
|
|
|
// |
|
|
|
|
// this.$notify({ |
|
|
|
|
// title: '提示', |
|
|
|
|
// message: ('i', { style: 'color: teal'}, '开始下载...') |
|
|
|
|
// }); |
|
|
|
|
// }, 3000); |
|
|
|
|
// }) |
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
// 在 3 秒之后,自动清除定时器 |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|