From 2bd663b4488808814ea07685f527fc2eb51e5bfe Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期五, 28 八月 2026 17:36:13 +0800
Subject: [PATCH] fix: 菜单/布局统一——企业解释重复 components 键导致 app-header 未注册;规则管理/用户管理改为统一上下布局(顶部系统栏+登出),移除菜单内失效的退出登录项
---
traffic-audit-web/src/views/DataImport.vue | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/traffic-audit-web/src/views/DataImport.vue b/traffic-audit-web/src/views/DataImport.vue
index 457e52b..dd789fa 100644
--- a/traffic-audit-web/src/views/DataImport.vue
+++ b/traffic-audit-web/src/views/DataImport.vue
@@ -26,7 +26,7 @@
<el-card shadow="hover" class="import-card" style="margin-bottom:15px">
<div class="card-head">鏈湀瀵煎叆杩涘害锛坽{ period || '鏈�夋嫨鎶ヨ〃鏈�' }}锛�
- <el-button type="text" icon="el-icon-refresh" style="float:right" @click="loadOverview">鍒锋柊</el-button>
+ <el-button type="text" icon="el-icon-refresh" style="float:right" @click="loadData">鍒锋柊</el-button>
</div>
<div v-if="!period" class="tip">璇峰厛鍦ㄤ笂鏂归�夋嫨鎶ヨ〃鏈�</div>
<div v-else class="overview-grid">
@@ -170,7 +170,7 @@
<el-card shadow="never" style="margin-top:15px" class="batch-card">
<div slot="header" class="card-head">
瀵煎叆璁板綍锛坽{ period || '鍏ㄩ儴鎶ヨ〃鏈�' }}锛�
- <el-button type="text" icon="el-icon-refresh" style="float:right" @click="loadBatches">鍒锋柊</el-button>
+ <el-button type="text" icon="el-icon-refresh" style="float:right" @click="loadData">鍒锋柊</el-button>
</div>
<el-table :data="batches" border size="small" v-loading="batchLoading" style="width:100%">
<el-table-column prop="importType" label="瀵煎叆绫诲瀷" width="150">
@@ -394,7 +394,7 @@
this.importType = this.moduleSel[key] || ''
this.dirPath = (this.importType && localStorage.getItem('dirLast_' + this.importType)) || ''
},
- onPeriodChange() { this.loadOverview(); this.loadBatches() },
+ onPeriodChange() { this.loadData() },
endpoint(t) {
const map = {
h2032: '/import/h2032',
@@ -437,7 +437,7 @@
this.dirFiles = d.files || []
this.dirFilesTruncated = !!d.filesTruncated
})
- .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.dirLoading = false })
},
goDirParent() { if (this.dirParent) this.loadDirs(this.dirParent) },
@@ -505,6 +505,7 @@
})
.catch(e => {
this.dirImporting = false
+ if (e && e._toast) return
this.$message.error((e.response && e.response.data && e.response.data.message) || '鐩綍涓嶅瓨鍦ㄦ垨鏃犳硶璁块棶锛�' + dir)
})
},
@@ -585,6 +586,7 @@
this.afterImport()
})
.catch(e => {
+ if (e && e._toast) return
this.$message.error((e.response && e.response.data && e.response.data.message) || '鎵归噺瀵煎叆澶辫触')
})
.finally(() => { this.cityDirLoading = false })
@@ -655,13 +657,17 @@
run(0)
})
},
- afterImport() { this.loadOverview(); this.loadBatches() },
- loadOverview() {
- if (!this.period) return
- api.get('/import/batches', { params: { period: this.period, limit: 200 } })
+ afterImport() { this.loadData() },
+ loadData() {
+ if (this.batchLoading) return
+ this.batchLoading = true
+ const params = { limit: 200 }
+ if (this.period) params.period = this.period
+ api.get('/import/batches', { params })
.then(res => {
- const map = {}
const records = (res.data && res.data.records) || []
+ this.batches = records.slice(0, 50)
+ const map = {}
records.forEach(r => {
const key = this.batchKeyToType(r.importType)
if (!key) return
@@ -672,7 +678,8 @@
})
this.overview = map
})
- .catch(() => {})
+ .catch(e => { if (!e || !e._toast) this.$message.error('瀵煎叆璁板綍鍔犺浇澶辫触锛岃鍒锋柊閲嶈瘯') })
+ .finally(() => { this.batchLoading = false })
},
batchKeyToType(k) {
if (BATCH_TYPE_MAP[k]) return BATCH_TYPE_MAP[k]
@@ -724,8 +731,7 @@
}
},
mounted() {
- this.loadBatches()
- this.loadOverview()
+ this.loadData()
}
}
</script>
--
Gitblit v1.9.1