From 791e70f228a6878d02d1b664588bdccf983b8811 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期一, 31 八月 2026 16:20:53 +0800
Subject: [PATCH] feat: 数据导入页重构——选择数据类型/模板下载并排/失败明细表格/导入进度抽屉侧栏

---
 traffic-audit-web/src/views/AuditResult.vue |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/traffic-audit-web/src/views/AuditResult.vue b/traffic-audit-web/src/views/AuditResult.vue
index 50c989a..fb821eb 100644
--- a/traffic-audit-web/src/views/AuditResult.vue
+++ b/traffic-audit-web/src/views/AuditResult.vue
@@ -1,9 +1,9 @@
 <template>
-  <el-container>
-    <el-header>浜ら�氱粺璁℃姤琛ㄥ鏍哥郴缁� - 瀹℃牳缁撴灉</el-header>
+  <el-container direction="vertical">
+    <app-header title="浜ら�氱粺璁℃姤琛ㄥ鏍哥郴缁� - 瀹℃牳缁撴灉"></app-header>
     <el-container>
       <el-aside width="200px">
-        <el-menu router default-active="/audit">
+        <el-menu ref="sideMenu" router :default-active="$route.path" @select="onMenuSelect">
           <el-menu-item index="/dashboard">宸ヤ綔鍙�</el-menu-item>
           <el-menu-item index="/import">鏁版嵁瀵煎叆</el-menu-item>
           <el-menu-item index="/data">鏁版嵁鏌ョ湅</el-menu-item>
@@ -12,7 +12,6 @@
           <el-menu-item index="/report">鎶ヨ〃鐢熸垚</el-menu-item>
           <el-menu-item index="/rules">瑙勫垯绠$悊</el-menu-item>
           <el-menu-item index="/users">鐢ㄦ埛绠$悊</el-menu-item>
-          <el-menu-item index="/login" @click="logout">閫�鍑虹櫥褰�</el-menu-item>
 </el-menu>
       </el-aside>
       <el-main :class="{ 'main-focus': focusMode }" style="display:flex;flex-direction:column;min-height:0">
@@ -228,10 +227,12 @@
   </el-container>
 </template>
 <script>
+import AppHeader from '@/components/AppHeader.vue'
 import api from '@/api'
 const DATA_TYPE_MAP = { H2032: 'h2032', H2031: 'h2031', CITY_BUS: 'cityBus', CITY_TAXI: 'cityTaxi' }
 const EXPLAIN_TYPES = ['H2032', 'H2031', 'CITY_BUS', 'CITY_TAXI']
 export default {
+  components: { AppHeader },
   name: 'AuditResult',
   data() {
     return {
@@ -335,7 +336,7 @@
       const fd = new FormData()
       fd.append('period', this.period)
       fd.append('reportType', this.reportType)
-      api.post('/audit/execute', fd)
+      api.post('/audit/execute', fd, { timeout: 120000 })
         .then(res => {
           const count = (res.data || []).length
           return api.get('/audit/ruleStats', { params: { period: this.period, reportType: this.reportType } })
@@ -360,7 +361,7 @@
         .then(() => api.get('/audit/results', { params: { period: this.period, reportType: this.reportType } }))
         .then(res => { this.applyResults(res.data) })
         .then(() => this.loadRuleStats())
-        .catch(() => { this.$message.error('瀹℃牳鎵ц澶辫触') })
+        .catch(e => { if (e && e._toast) return; this.$message.error('瀹℃牳鎵ц澶辫触') })
         .finally(() => { this.loading = false })
     },
     markAudited() {
@@ -369,7 +370,7 @@
       const fd = new FormData()
       fd.append('period', this.period)
       fd.append('reportType', this.reportType)
-      api.post('/audit/markAudited', fd)
+      api.post('/audit/markAudited', fd, { timeout: 60000 })
         .then(res => {
           if (res.data) {
             this.$message.success('宸叉爣璁拌鏈熴��' + this.reportType + '銆嶄负宸插鏍革紝鎶ヨ〃瀵煎嚭涓嶅啀鎻愮ず鏈鏍�')
@@ -379,7 +380,7 @@
           return api.get('/audit/results', { params: { period: this.period, reportType: this.reportType } })
         })
         .then(res => { this.applyResults(res.data) })
-        .catch(() => { this.$message.error('鏍囪澶辫触') })
+        .catch(e => { if (e && e._toast) return; this.$message.error('鏍囪澶辫触') })
         .finally(() => { this.marking = false })
     },
     queryResults() {
@@ -388,7 +389,7 @@
       api.get('/audit/results', { params: { period: this.period, reportType: this.reportType } })
         .then(res => { this.applyResults(res.data) })
         .then(() => this.loadRuleStats())
-        .catch(() => { this.$message.error('鏌ヨ澶辫触') })
+        .catch(e => { if (e && e._toast) return; this.$message.error('鏌ヨ澶辫触') })
         .finally(() => { this.loading = false })
     },
     toggleExplain(reportId) {
@@ -411,13 +412,13 @@
       fd.append('reportType', this.reportType)
       fd.append('reportId', reportId)
       fd.append('explanation', explanation)
-      api.post('/explain/save', fd)
+      api.post('/explain/save', fd, { timeout: 60000 })
         .then(() => {
           this.$message.success('浼佷笟瑙i噴宸蹭繚瀛�')
           this.$set(this.explainDrafts, reportId, explanation)
           this.results.forEach(r => { if (r.reportId === reportId) r.verifyExplanation = explanation })
         })
-        .catch(e => { this.$message.error((e.response && e.response.data && e.response.data.message) || '淇濆瓨澶辫触') })
+        .catch(e => { if (e && e._toast) return; this.$message.error((e.response && e.response.data && e.response.data.message) || '淇濆瓨澶辫触') })
         .finally(() => { this.savingExplainId = null })
     },
     resetDraft(reportId) {
@@ -449,9 +450,9 @@
       fd.append('id', row.id)
       fd.append('status', status)
       if (comment) fd.append('comment', comment)
-      api.post('/audit/review', fd)
+      api.post('/audit/review', fd, { timeout: 60000 })
         .then(() => { row.status = status; this.$message.success(status === 'CONFIRMED' ? '宸茬‘璁�' : '宸插拷鐣�') })
-        .catch(() => { this.$message.error('鎿嶄綔澶辫触') })
+        .catch(e => { if (e && e._toast) return; this.$message.error('鎿嶄綔澶辫触') })
     },
     updateBatchSelection() { this.batchSelection = this.filteredResults.filter(r => r._selected) },
     toggleSelectAll(value) {
@@ -477,9 +478,9 @@
         fd.append('id', item.id)
         fd.append('status', status)
         if (comment) fd.append('comment', comment)
-        api.post('/audit/review', fd)
+        api.post('/audit/review', fd, { timeout: 60000 })
           .then(() => { item.status = status; done++; if (done === list.length) this.$message.success('宸�' + (status === 'CONFIRMED' ? '纭' : '蹇界暐') + ' ' + done + ' 鏉�') })
-          .catch(() => { this.$message.error('閮ㄥ垎鎿嶄綔澶辫触') })
+          .catch(e => { if (e && e._toast) return; this.$message.error('閮ㄥ垎鎿嶄綔澶辫触') })
       })
     },
     clearFilters() { this.enterpriseFilter = ''; this.ruleFilter = '' },

--
Gitblit v1.9.1