From 2b39c4eb64b194e23f338873e4467eda2b18ccc3 Mon Sep 17 00:00:00 2001
From: zhizhijie <zhizhijie@users.noreply.gitee.com>
Date: 星期二, 22 九月 2026 11:28:56 +0800
Subject: [PATCH] feat(报表生成): 汇总大表导出结果落盘缓存,无新导入即秒回复用

---
 traffic-audit-web/src/views/AuditResult.vue |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/traffic-audit-web/src/views/AuditResult.vue b/traffic-audit-web/src/views/AuditResult.vue
index 7db2d4f..f1a2bfd 100644
--- a/traffic-audit-web/src/views/AuditResult.vue
+++ b/traffic-audit-web/src/views/AuditResult.vue
@@ -609,8 +609,26 @@
     },
     exportExcel() {
       if (!this.period) { this.$message.warning('璇烽�夋嫨鎶ヨ〃鏈�'); return }
-      const q = 'period=' + this.period + '&reportType=' + this.reportType + '&onlyVerify=' + (this.issueScope !== 'all') + '&status=' + (this.statusScope || 'all')
-      window.open('/api/audit/export?' + q)
+      const params = {
+        period: this.period,
+        reportType: this.reportType,
+        onlyVerify: this.issueScope !== 'all',
+        status: this.statusScope || 'all'
+      }
+      api.get('/audit/export', { params, responseType: 'blob' })
+        .then(res => this.downloadBlob(res, '瀹℃牳缁撴灉_' + this.period + '.xlsx'))
+        .catch(() => this.$message.error('瀵煎嚭澶辫触锛氳纭璇ユ姤琛ㄦ湡宸叉湁瀹℃牳缁撴灉'))
+    },
+    downloadBlob(res, fileName) {
+      const blob = res instanceof Blob ? res : new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
+      const url = window.URL.createObjectURL(blob)
+      const a = document.createElement('a')
+      a.href = url
+      a.download = fileName
+      document.body.appendChild(a)
+      a.click()
+      window.URL.revokeObjectURL(url)
+      document.body.removeChild(a)
     },
     review(row, status) {
       if (status === 'IGNORED') {

--
Gitblit v1.9.1