(vue)导出数据
// 导出数据
exportModelOne(row) {
downloadApplicationDataFile(row.id, { taskCategory: row.taskCategory }).then((res) => {
const data = res
// 创建一个新的url,此url指向新建的Blob对象
const url = window.URL.createObjectURL(new Blob([data]))
// 创建a标签,并隐藏a标签
const link = document.createElement('a')
link.style.display = 'none'
// a标签的href属性指定下载链接
link.href = url
// setAttribute() 方法添加指定的属性,并为其赋指定的值
// 后缀格式.csv/.xsls要和需要和后端返回格式相同,这里以.csv为例
link.setAttribute('download', row.taskName + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
},