//导出元数据
exportExcel(){
let _this = this;
_this.$http({
method: 'post',
url: '/admin/cms/resourcelist/export_metadata',
// headers里面设置token
headers: {
'Content-Type': 'application/json; charset=UTF-8'
},
data:{
id: _this.orderIds
},
// 二进制流文件,一定要设置成blob,默认是json
responseType: 'blob'
}).then(res => {
if(_this.newArr.length == 0){
_this.$message.error('请至少选择一个!');
return false;
}else{
const link = document.createElement('a');
const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' });
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
link.setAttribute('download', `图书库列表元数据信息表.xlsx`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
})
},