|
|
@@ -367,9 +367,26 @@ export default {
|
|
|
id:id,
|
|
|
type:type
|
|
|
}
|
|
|
- this.$api.downloadzip(parm).then(res=>{
|
|
|
- // console.log(res.data)
|
|
|
- })
|
|
|
+ if(val.length>0){
|
|
|
+ this.$api.downloadzip(parm).then(res=>{
|
|
|
+ if(res.data.code == 0){
|
|
|
+ var elink = document.createElement('a');
|
|
|
+ let blob=new Blob([res.data], {type: 'application/zip'});
|
|
|
+ let objUrl=URL.createObjectURL(blob);
|
|
|
+ let file_name=res.headers['content-disposition'].split('=')[1];
|
|
|
+ elink.download = file_name;
|
|
|
+ elink.style.display = 'none';
|
|
|
+ elink.href = objUrl;
|
|
|
+ document.body.appendChild(elink);
|
|
|
+ elink.click();
|
|
|
+ document.body.removeChild(elink);
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message.error('请选择数据');
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created(){
|