From 9483eb4f6d7a75261dbde71ace7878df2f7eda07 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期三, 11 十一月 2026 20:10:10 +0800
Subject: [PATCH] docs(交接): 更新H202等验收状态

---
 traffic-audit-web/src/views/DataView.vue |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/traffic-audit-web/src/views/DataView.vue b/traffic-audit-web/src/views/DataView.vue
index d72dc3a..092ee9f 100644
--- a/traffic-audit-web/src/views/DataView.vue
+++ b/traffic-audit-web/src/views/DataView.vue
@@ -10,16 +10,23 @@
           <el-menu-item index="/explain">浼佷笟瑙i噴</el-menu-item>
           <el-menu-item index="/audit">瀹℃牳缁撴灉</el-menu-item>
           <el-menu-item index="/report">鎶ヨ〃鐢熸垚</el-menu-item>
+          <el-submenu index="/special-stats">
+            <template slot="title">涓撻」缁熻</template>
+            <el-menu-item index="/holiday-stat">鑺傚亣鏃�</el-menu-item>
+          </el-submenu>
           <el-menu-item index="/rules">瑙勫垯绠$悊</el-menu-item>
           <el-menu-item index="/users">鐢ㄦ埛绠$悊</el-menu-item>
-</el-menu>
+          <el-menu-item v-if="operatorIsAdmin" index="/system-config">绯荤粺閰嶇疆</el-menu-item>
+        </el-menu>
       </el-aside>
       <el-main>
         <h3>瀵煎叆鏁版嵁鏌ョ湅</h3>
         <div class="toolbar">
           <template v-if="!isRollup">
             <span class="toolbar-label">鎶ヨ〃鏈�</span>
-            <el-date-picker v-model="period" type="month" placeholder="鎶ヨ〃鏈燂紙鍏ㄩ儴锛�" value-format="yyyy-MM" clearable style="width:150px" @change="doQuery"></el-date-picker>
+            <el-date-picker v-model="period" type="month" placeholder="鎶ヨ〃鏈燂紙鍏ㄩ儴锛�" value-format="yyyy-MM" clearable
+                            style="width:150px" :picker-options="periodPickerOptions" @change="doQuery"></el-date-picker>
+            <span v-if="periodHint" class="toolbar-hint">{{ periodHint }}</span>
           </template>
           <span class="toolbar-sep"></span>
           <span class="toolbar-label">鏁版嵁绫诲瀷</span>
@@ -83,6 +90,7 @@
 <script>
 import AppHeader from '@/components/AppHeader.vue'
 import api from '@/api'
+import { granularityOfImportType, disabledDateFor, granularityHint, snapPeriod } from '@/utils/periodGranularity'
 export default {
   components: { AppHeader },
   name: 'DataView',
@@ -92,6 +100,7 @@
         {
           key: 'freight', name: '閬撹矾璐ц繍', types: [
             { value: 'h2032', label: '閬撹矾璐х墿杩愯緭鏈堝害鐢熶骇鎯呭喌' },
+            { value: 'h202', label: '鍏矾璐х墿钀ヨ繍杞﹁締鎷ユ湁鎯呭喌(H202)' },
             { value: 'transportAuth', label: '杩愭斂杞﹁締' },
             { value: 'trackMileage', label: '杞ㄨ抗閲岀▼' },
             { value: 'scaleSplit', label: '瑙勪笂瑙勪笅鎷嗗垎' },
@@ -149,6 +158,12 @@
     }
   },
   computed: {
+    periodGranularity() { return granularityOfImportType(this.type) },
+    periodPickerOptions() {
+      const d = disabledDateFor(this.periodGranularity)
+      return d ? { disabledDate: d } : {}
+    },
+    periodHint() { return granularityHint(this.periodGranularity) },
     canRollup() {
       return (this.rollupTypes || []).some(t => t.type === this.type)
     },
@@ -183,6 +198,17 @@
         count++
       }
       return cols.map((c, i) => Object.assign({}, c, { fixed: i < count }))
+    }
+  },
+  watch: {
+    // 閫夊埌鑳借�楋紙瀛f姤锛夋椂鎶婃姤琛ㄦ湡瀵归綈鍒板搴︽湯鏈�
+    periodGranularity() {
+      const snapped = snapPeriod(this.period, this.periodGranularity)
+      if (snapped && snapped !== this.period) {
+        this.period = snapped
+        const hint = granularityHint(this.periodGranularity)
+        if (hint) this.$message.warning(hint + '锛堝凡鑷姩璋冩暣涓� ' + snapped + '锛�')
+      }
     }
   },
   methods: {
@@ -380,6 +406,7 @@
     //  - 鍏朵綑鏁板�煎崈鍒嗕綅銆佷繚鐣欎袱浣嶅皬鏁帮紱鏁存暟鍘熸牱銆�
     formatCell(v, prop) {
       if (v === null || v === undefined || v === '') return '-'
+      if (this.type === 'h202' && /Value$/.test(String(prop || ''))) return this.formatExactDecimal(v)
       const s = typeof v === 'string' ? v.trim() : v
       if (typeof v !== 'number' && !/^-?\d+(\.\d+)?$/.test(String(s))) return v
       const n = Number(s)
@@ -389,6 +416,17 @@
       if (/(rate|yoy|mom|growth|ratio|percent|share)/.test(key)) return (n * 100).toFixed(2) + '%'
       if (Number.isInteger(n)) return n.toLocaleString('zh-CN')
       return n.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
+    },
+    // H202 values arrive as exact decimal strings. Format without Number() to preserve source precision.
+    formatExactDecimal(v) {
+      const text = String(v === null || v === undefined ? '' : v).trim()
+      if (!/^-?\d+(?:\.\d+)?$/.test(text)) return v
+      const negative = text.charAt(0) === '-'
+      const unsigned = negative ? text.slice(1) : text
+      const parts = unsigned.split('.')
+      const integer = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
+      const fraction = (parts[1] || '').replace(/0+$/, '')
+      return (negative ? '-' : '') + integer + (fraction ? '.' + fraction : '')
     }
   },
   mounted() {

--
Gitblit v1.9.1