|
|
@@ -436,41 +436,33 @@ export default {
|
|
|
exportExcel (res) {
|
|
|
const data = Object.assign(this.queryData, { columnName: res, projectIds: this.selectList.join(',') })
|
|
|
this.$api.params.exportResult(data).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
|
|
|
- const link = document.createElement('a')
|
|
|
- link.style.display = 'none'
|
|
|
- link.href = url
|
|
|
- const excelName = new Date().getTime() + '.xlsx'
|
|
|
- link.setAttribute('download', excelName)
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- link.remove()
|
|
|
- this.diaType = -1
|
|
|
- this.$message.success('导出成功')
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
+ const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ const excelName = new Date().getTime() + '.xlsx'
|
|
|
+ link.setAttribute('download', excelName)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ link.remove()
|
|
|
+ this.diaType = -1
|
|
|
+ this.$message.success('导出成功')
|
|
|
})
|
|
|
},
|
|
|
exportExcelTotal (item) {
|
|
|
const data = { projectIds: this.selectList.join(',') }
|
|
|
this.$api.params.summaryExport(Object.assign(item, data)).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
|
|
|
- const link = document.createElement('a')
|
|
|
- link.style.display = 'none'
|
|
|
- link.href = url
|
|
|
- const excelName = new Date().getTime() + '.xlsx'
|
|
|
- link.setAttribute('download', excelName)
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- link.remove()
|
|
|
- this.diaType = -1
|
|
|
- this.$message.success('导出成功')
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
+ const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ const excelName = new Date().getTime() + '.xlsx'
|
|
|
+ link.setAttribute('download', excelName)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ link.remove()
|
|
|
+ this.diaType = -1
|
|
|
+ this.$message.success('导出成功')
|
|
|
})
|
|
|
}
|
|
|
}
|