diff --git a/src/views/statistics/imsProducts/arr/index.vue b/src/views/statistics/imsProducts/arr/index.vue index 6188827..bf94758 100644 --- a/src/views/statistics/imsProducts/arr/index.vue +++ b/src/views/statistics/imsProducts/arr/index.vue @@ -3,7 +3,7 @@ - + Excel @@ -110,6 +110,29 @@ export default { this.findStationList() }, methods: { + handleExcel() { + if (this.dataSource.length>0) { + let params = { + ...this.queryParam, + } + getFileAction("/webStatistics/arrExport", params).then(res => { + if (res.code && res.code == 500) { + this.$message.warning("This operation fails. Contact your system administrator") + } else { + const blob = new Blob([res], { type: "application/vnd.ms-excel" }) + let link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = "ARR" + document.body.appendChild(link) + link.click() + URL.revokeObjectURL(link.href) + document.body.removeChild(link) + } + }) + } else { + this.$message.warning("No downloadable data") + } + }, handleBack(flag) { this.isFileDetail = flag }, diff --git a/src/views/statistics/imsProducts/rrr/index.vue b/src/views/statistics/imsProducts/rrr/index.vue index c3488af..f6100ae 100644 --- a/src/views/statistics/imsProducts/rrr/index.vue +++ b/src/views/statistics/imsProducts/rrr/index.vue @@ -3,7 +3,7 @@ - + Excel @@ -110,6 +110,29 @@ export default { this.findStationList() }, methods: { + handleExcel() { + if (this.dataSource.length>0) { + let params = { + ...this.queryParam, + } + getFileAction("/webStatistics/rrrExport", params).then(res => { + if (res.code && res.code == 500) { + this.$message.warning("This operation fails. Contact your system administrator") + } else { + const blob = new Blob([res], { type: "application/vnd.ms-excel" }) + let link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = "RRR" + document.body.appendChild(link) + link.click() + URL.revokeObjectURL(link.href) + document.body.removeChild(link) + } + }) + } else { + this.$message.warning("No downloadable data") + } + }, handleBack(flag) { this.isFileDetail = flag },