Commit 4a7afa45 by danmo

二维码批量下载

1 parent dab865a9
......@@ -139,8 +139,9 @@ export function downloadBatch(ids) {
params: {
ids,
},
responseType: 'blob'
})
return process.env.VUE_APP_BASE_API + service + '/downloadBatch/?ids=' + ids
//return process.env.VUE_APP_BASE_API + service + '/downloadBatch/?ids=' + ids
}
/**
......
......@@ -140,10 +140,19 @@ export default {
type: 'warning',
})
.then(() => {
downloadBatch(this.ids + '')
return downloadBatch(this.ids + '')
// window.open(downloadBatch(this.ids))
})
.catch(function() {})
}).then((res) =>{
if (res!=null) {
let blob = new Blob([res], {type: 'application/zip'});
let url = window.URL.createObjectURL(blob);
const link = document.createElement('a'); // 创建a标签
link.href = url;
link.download = '批量员工活码.zip'; // 重命名文件
link.click();
URL.revokeObjectURL(url); // 释放内存
}
}).catch(function() {})
},
},
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!