// 点击下载
download(value,flag){
let _this = this
this.axios({
method: 'get',
url: '/url/lengthMeasurementTwice',
params:{
machineId:_this.machineID[1],
language:_this.$store.state.lang,
startDate:value.day
}
}).then(function(res){
console.log(res.data)
let blob = new Blob([res.data], {
type: `application/msword` //word文档为msword,pdf文档为pdf,msexcel 为excel
});
let objectUrl = URL.createObjectURL(blob);
let link = document.createElement("a");
let fname = `我的文档.doc`; //下载文件的名字+后缀名
link.href = objectUrl;
link.setAttribute("download", fname);
document.body.appendChild(link);
link.click();
})
}