先上代码
$('a[id^="budgetOneN"]').each(function() {
$(this).click(function() {
downZip($(this));//给每个a标签加事件
});
});
const getFile = url => {
return new Promise((resolve, reject) => {
axios({
method:'get',
url,
responseType: 'arraybuffer'
}).then(data => {
resolve(data.data)
}).catch(error => {
reject(error.toString())
})
})
}
function downZip(ele){
var array =new Array();
var arrayTwo =new Array();
var url =$(ele).attr("value");//路径
var name=$(ele).attr("date");//显示打包名称
alert(name);
array = url.split(',');
for(var i =0;i<array.length;i++){
arrayTwo[i] =array[i].substring(array[i].indexOf("&")+1);
}
handleBatchDownload(array,arrayTwo,