Commit 3e1dfc0e authored by Asjoker's avatar Asjoker

异常日志-导出

parent 3bb08ee1
...@@ -336,21 +336,33 @@ export default { ...@@ -336,21 +336,33 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = Object.assign({}, this.queryParams) // const queryParams = Object.assign({}, this.queryParams)
// queryParams.operTime = queryParams.operTime ? this.$parseDate(new Date(queryParams.operTime), 'YYYYMM') : '' // // queryParams.operTime = queryParams.operTime ? this.$parseDate(new Date(queryParams.operTime), 'YYYYMM') : ''
delete queryParams.page // delete queryParams.page
delete queryParams.rows // delete queryParams.rows
queryParams.ids = this.ids.join(',') || null // queryParams.ids = this.ids.join(',') || null
exportErrLog(queryParams).then(response => { // exportErrLog(queryParams).then(response => {
this.download(response.msg) // this.download(response.msg)
}).catch(function() {}) // }).catch(function() {})
// this.$confirm('是否确认导出所有日志异常数据项?', '提示', { const queryParams = this.queryParams
// confirmButtonText: '确定', this.$confirm('是否确认导出所有日志异常数据项?', '提示', {
// cancelButtonText: '取消', confirmButtonText: '确定',
// type: 'warning' cancelButtonText: '取消',
// }).then(function() { type: 'warning'
// return exportErrLog(queryParams) }).then(function() {
// }) return exportErrLog(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '异常日志' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
// this.download(response.msg)
})
})
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment