mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 20:42:55 +08:00
feat(数据集): 数据集导出Excel
This commit is contained in:
parent
31d304122b
commit
0947155d75
@ -462,21 +462,27 @@ export default {
|
|||||||
this.showExport = false
|
this.showExport = false
|
||||||
},
|
},
|
||||||
exportDatasetRequest() {
|
exportDatasetRequest() {
|
||||||
if (this.table.id) {
|
this.$refs['exportForm'].validate((valid) => {
|
||||||
this.table.row = 100000
|
if (valid) {
|
||||||
this.table.filename = this.exportForm.name
|
if (this.table.id) {
|
||||||
this.table.expressionTree = this.exportForm.expressionTree
|
this.table.row = 100000
|
||||||
exportDataset(this.table).then((res) => {
|
this.table.filename = this.exportForm.name
|
||||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
this.table.expressionTree = this.exportForm.expressionTree
|
||||||
const link = document.createElement('a')
|
exportDataset(this.table).then((res) => {
|
||||||
link.style.display = 'none'
|
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||||
link.href = URL.createObjectURL(blob)
|
const link = document.createElement('a')
|
||||||
link.download = this.exportForm.name + '.xlsx' // 下载的文件名
|
link.style.display = 'none'
|
||||||
document.body.appendChild(link)
|
link.href = URL.createObjectURL(blob)
|
||||||
link.click()
|
link.download = this.exportForm.name + '.xlsx' // 下载的文件名
|
||||||
document.body.removeChild(link)
|
document.body.appendChild(link)
|
||||||
})
|
link.click()
|
||||||
}
|
document.body.removeChild(link)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user