From 30c490673b85720bd5447a0b577f3e989ba50ac4 Mon Sep 17 00:00:00 2001
From: zhizhijie <zhizhijie@users.noreply.gitee.com>
Date: 星期二, 22 九月 2026 11:02:59 +0800
Subject: [PATCH] feat(数据查看): 拆分表空列不显示、口径上移为筛选(接口加 periodType)、12 类表表头补齐单位

---
 traffic-audit-web/src/views/DataView.vue |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/traffic-audit-web/src/views/DataView.vue b/traffic-audit-web/src/views/DataView.vue
index 33df725..cdf1f2f 100644
--- a/traffic-audit-web/src/views/DataView.vue
+++ b/traffic-audit-web/src/views/DataView.vue
@@ -27,6 +27,14 @@
               <el-option v-for="t in g.types" :key="t.value" :label="t.label" :value="t.value"></el-option>
             </el-option-group>
           </el-select>
+          <template v-if="hasPeriodType">
+            <span class="toolbar-label">鍙e緞</span>
+            <el-select v-model="periodType" size="small" style="width:110px" @change="doQuery">
+              <el-option label="鍏ㄩ儴" value=""></el-option>
+              <el-option label="褰撴湀" value="MONTH"></el-option>
+              <el-option label="绱" value="CUMULATIVE"></el-option>
+            </el-select>
+          </template>
           <el-input v-model="keyword" placeholder="浼佷笟/甯傚窞鍚嶇О" clearable style="width:180px" @keyup.enter.native="doQuery"></el-input>
           <el-button type="primary" size="small" @click="doQuery">鏌ヨ</el-button>
           <el-button size="small" icon="el-icon-full-screen" @click="toggleFullscreen">鍏ㄥ睆鏌ョ湅</el-button>
@@ -99,6 +107,7 @@
       activeModule: 'freight',
       type: 'h2032',
       period: '',
+      periodType: '',
       keyword: '',
       page: 1,
       size: 50,
@@ -110,6 +119,10 @@
     }
   },
   computed: {
+    // 瑙勪笂瑙勪笅鎷嗗垎绛夎〃鏈�"鍙e緞"鍒楋紙褰撴湀/绱锛夛紝鎶婂畠鍋氭垚涓婃柟绛涢�夎�屼笉鏄〃鏍煎垪
+    hasPeriodType() {
+      return (this.columns || []).some(c => c.prop === 'periodType')
+    },
     currentTypeLabel() {
       for (const g of this.modules) {
         const t = g.types.find(x => x.value === this.type)
@@ -140,8 +153,10 @@
     // 鏁版嵁鏌ョ湅缁熶竴鍒楄繃婊わ細鍐呴儴鏍囪瘑鍒椾笉灞曠ず锛涙姤琛ㄦ湡锛堢敱绛涢�夋潯浠朵綋鐜帮級涓庢墍灞炲湴鍖猴紙鍖哄垝浠g爜锛屽凡琚競宸炲垪鏇夸唬锛変笉灞曠ず
     keepColumn(c) {
       if (!c) return false
-      const hiddenProps = ['enterpriseCode', 'unifiedCreditCode', 'reportUnit', 'projectId', 'regionCode', 'reportPeriod']
-      const hiddenLabels = ['浼佷笟浠g爜', '缁熶竴绀句細淇$敤浠g爜', '濉姤鍗曚綅', '椤圭洰ID', '鎵�灞炲湴鍖�', '鎶ヨ〃鏈�']
+      // 鍙e緞鍒椾笂绉讳负绛涢�夛紱鎷嗗垎琛ㄨ揣杩愰噺涓夊垪婧愭枃浠舵湭鎻愪緵锛堝叏绌猴級鏁呬笉灞曠ず
+      const hiddenProps = ['enterpriseCode', 'unifiedCreditCode', 'reportUnit', 'projectId', 'regionCode', 'reportPeriod',
+        'periodType', 'aboveScaleFreight', 'belowScaleFreight', 'totalFreight']
+      const hiddenLabels = ['浼佷笟浠g爜', '缁熶竴绀句細淇$敤浠g爜', '濉姤鍗曚綅', '椤圭洰ID', '鎵�灞炲湴鍖�', '鎶ヨ〃鏈�', '鍙e緞']
       if (hiddenProps.indexOf(c.prop) >= 0 || hiddenLabels.indexOf(c.label) >= 0) return false
       return true
     },
@@ -156,6 +171,7 @@
     onTypeSelect() {
       const g = this.modules.find(x => x.types.some(t => t.value === this.type))
       if (g) this.activeModule = g.key
+      this.periodType = ''
       this.doQuery()
     },
     doQuery() {
@@ -171,13 +187,14 @@
           type: this.type,
           period: this.period || undefined,
           keyword: this.keyword || undefined,
+          periodType: this.periodType || undefined,
           page: this.page,
           size: this.size
         }
       }).then(res => {
         const d = res.data || {}
         this.records = d.records || []
-        this.columns = (d.columns || []).filter(c => ['enterpriseCode', 'unifiedCreditCode', 'reportUnit'].indexOf(c.prop) < 0 && ['浼佷笟浠g爜', '缁熶竴绀句細淇$敤浠g爜', '濉姤鍗曚綅'].indexOf(c.label) < 0)
+        this.columns = d.columns || []
         this.total = d.total || 0
         if (this.page > 1 && this.records.length === 0) {
           this.page = 1
@@ -213,6 +230,7 @@
           type: this.type,
           period: this.period || undefined,
           keyword: this.keyword || undefined,
+          periodType: this.periodType || undefined,
           page: nextPage,
           size: this.size
         }
@@ -226,7 +244,7 @@
         this.records = this.records.concat(addRows)
         this.page = nextPage
         if (d.total != null) this.total = d.total
-        if (d.columns && d.columns.length) this.columns = d.columns.filter(c => ['enterpriseCode', 'unifiedCreditCode', 'reportUnit'].indexOf(c.prop) < 0 && ['浼佷笟浠g爜', '缁熶竴绀句細淇$敤浠g爜', '濉姤鍗曚綅'].indexOf(c.label) < 0)
+        if (d.columns && d.columns.length) this.columns = d.columns
       }).catch(e => {
         if (e && e._toast) return
         this.$message.error('鍔犺浇鏇村澶辫触')

--
Gitblit v1.9.1