From f0f468497f9c3eaea46cb342d2a6bf9f0a3aee09 Mon Sep 17 00:00:00 2001 From: renpy Date: Wed, 19 Jul 2023 10:16:58 +0800 Subject: [PATCH] =?UTF-8?q?arr=20=20rrr=20=20=E6=A8=A1=E5=9D=97=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=BC=E5=87=BAexcel=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statistics/imsProducts/arr/index.vue | 25 ++++++++++++++++++- .../statistics/imsProducts/rrr/index.vue | 25 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) 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 },