From f9ccdc1663bc98b1e068ab47c58887e3b482bc6d Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期三, 11 十一月 2026 20:07:28 +0800
Subject: [PATCH] feat(H202): 新增货运车辆拥有情况导入与查看

---
 traffic-audit-web/src/views/DataImport.vue |  176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 163 insertions(+), 13 deletions(-)

diff --git a/traffic-audit-web/src/views/DataImport.vue b/traffic-audit-web/src/views/DataImport.vue
index 82abc05..34ad19d 100644
--- a/traffic-audit-web/src/views/DataImport.vue
+++ b/traffic-audit-web/src/views/DataImport.vue
@@ -26,7 +26,8 @@
             <div class="import-main">          <el-card shadow="hover" class="import-card" style="margin-bottom:15px">
             <div class="card-head">鎶ヨ〃鏈�</div>
             <el-date-picker v-model="period" type="month" placeholder="閫夋嫨鏈堜唤" value-format="yyyy-MM"
-                            style="width:240px" @change="onPeriodChange"></el-date-picker>
+                            style="width:240px" :picker-options="periodPickerOptions" @change="onPeriodChange"></el-date-picker>
+            <div v-if="periodHint" class="tip" style="margin-top:6px">{{ periodHint }}</div>
           </el-card>
 
                     
@@ -48,7 +49,7 @@
                     <span class="tpl-name">妯℃澘锛歿{ templateName }}</span>
                     <el-link v-if="templateUrl" type="primary" icon="el-icon-download" :underline="false"
                              @click="downloadTemplate">涓嬭浇妯℃澘</el-link>
-                    <span v-if="importType === 'cityTaxiAuth'" class="slow-tip">璇ョ被鍨嬬害 4 涓�+ 琛岋紝棰勮鑰楁椂 5 鍒嗛挓宸﹀彸</span>
+                    <span v-if="importType === 'cityTaxiAuth'" class="slow-tip">璇ョ被鍨嬬害 4 涓�+ 琛岋紝棰勮鑰楁椂 1 鍒嗛挓浠ュ唴</span>
                   </div>
                 </div>
                 <div v-if="isCityDirType(moduleSel[g.key])" class="module-file">
@@ -58,11 +59,17 @@
                 </div>
                 <div v-else-if="moduleSel[g.key] && !isDirOnlyType(moduleSel[g.key])" class="module-file">
                   <div class="file-name" :title="fileNamesText(moduleSel[g.key])">{{ fileNamesText(moduleSel[g.key]) || '鏈�夋嫨鏂囦欢' }}</div>
+                  <div v-if="moduleSel[g.key] === 'h202'" class="tip" style="margin:0 0 6px">閫夋嫨鏂囦欢澶瑰悗锛岃嚜鍔ㄨ瘑鍒苟瀵煎叆鐩綍鍐呯鍚� H202 鍛藉悕瑙勫垯鐨勫叏閮� .xlsx 鏂囦欢銆�</div>
                   <div class="file-btns">
                     <el-upload action="#" :auto-upload="false" :show-file-list="false" multiple :accept="acceptOf(moduleSel[g.key])"
                                :ref="'up' + g.key" :on-change="f => onFilePicked(g.key, f)" style="display:inline-block">
                       <el-button size="mini" type="primary" plain icon="el-icon-folder-opened" :disabled="importing">閫夋嫨鏂囦欢</el-button>
                     </el-upload>
+                    <input v-if="moduleSel[g.key] === 'h202'" :ref="'folder' + g.key" type="file" webkitdirectory directory multiple accept=".xlsx"
+                           style="display:none" @change="onFolderPicked(g.key, $event)">
+                    <el-button v-if="moduleSel[g.key] === 'h202'" size="mini" type="primary" icon="el-icon-folder-opened"
+                               :disabled="importing" title="閫夋嫨鏂囦欢澶瑰悗鑷姩鎵归噺瀵煎叆"
+                               @click="pickH202Folder(g.key)">閫夋嫨鏂囦欢澶瑰苟瀵煎叆</el-button>
                     <el-button size="mini" type="primary" icon="el-icon-upload2" :loading="importing" :disabled="importing || !fileCount(moduleSel[g.key])"
                                @click="importNow(g.key)">{{ fileCount(moduleSel[g.key]) > 1 ? '鎵归噺瀵煎叆 ' + fileCount(moduleSel[g.key]) + ' 涓枃浠�' : '绔嬪嵆瀵煎叆' }}</el-button>
                   </div>
@@ -81,6 +88,7 @@
               瀵煎叆缁撴灉锛坽{ period || '鍏ㄩ儴鎶ヨ〃鏈�' }}锛�
               <el-button type="text" icon="el-icon-refresh" style="float:right" @click="loadData">鍒锋柊</el-button>
             </div>
+            <div v-if="period" class="tip" style="margin-bottom:6px">浠呮樉绀哄綋鍓嶆姤琛ㄦ湡锛坽{ period }}锛夌殑瀵煎叆璁板綍锛涙妸涓婃柟鎶ヨ〃鏈熸竻绌哄彲鏌ョ湅鍏ㄩ儴鏈熸銆�</div>
             <div v-if="failBatches.length" class="tip" style="margin-bottom:6px">鍏� {{ failBatches.length }} 涓壒娆″瓨鍦ㄥけ璐ユ暟鎹紝澶辫触鏄庣粏鍏� {{ failRowsFlat.length }} 鏉★細</div>
             <el-table v-if="failBatches.length" :data="failRowsFlat" border size="small" v-loading="batchLoading" style="width:100%">
               <el-table-column label="瀵煎叆绫诲瀷" width="140">
@@ -98,6 +106,24 @@
               </el-table-column>
             </el-table>
             <div v-else class="empty-tip">鏆傛棤瀵煎叆澶辫触璁板綍</div>
+            <div v-if="warnRowsFlat.length" class="tip" style="margin:12px 0 6px">
+              鍏� {{ warnBatches.length }} 涓壒娆″惈鎻愰啋锛屽叡 {{ warnRowsFlat.length }} 鏉★紙涓嶉樆鏂鍏ワ紝渚涙牳瀵癸級锛�
+            </div>
+            <el-table v-if="warnRowsFlat.length" :data="warnRowsFlat" border size="small" style="width:100%">
+              <el-table-column label="瀵煎叆绫诲瀷" width="140">
+                <template slot-scope="s">{{ typeLabel(s.row.importType) }}</template>
+              </el-table-column>
+              <el-table-column prop="reportPeriod" label="鎶ヨ〃鏈�" width="90"></el-table-column>
+              <el-table-column label="鏂囦欢鍚�" min-width="200" show-overflow-tooltip>
+                <template slot-scope="s">{{ s.row.fileName }}</template>
+              </el-table-column>
+              <el-table-column label="浣嶇疆" width="230">
+                <template slot-scope="s"><span v-if="s.row.position">{{ s.row.position }}</span><span v-else>鈥�</span></template>
+              </el-table-column>
+              <el-table-column label="鎻愰啋鍐呭" min-width="300">
+                <template slot-scope="s">{{ s.row.reason }}</template>
+              </el-table-column>
+            </el-table>
           </el-card>
             </div>
                         <div class="import-side" :class="{ 'side-open': sideOpen }">
@@ -157,7 +183,8 @@
         </el-dialog>
         <!-- 瀵煎叆缁撴灉寮圭獥锛氬彲鎷栧姩銆佸唴瀹瑰尯婊氬姩銆佸簳閮ㄦ寜閽浐瀹氬彲瑙侊紙鍘� $alert 鍐呭闀挎椂搴曢儴鎸夐挳浼氳鎸ゅ嚭灞忓箷锛� -->
         <el-dialog :title="resultDialog.title" :visible.sync="resultDialog.visible" width="860px" top="5vh"
-                   append-to-body :close-on-click-modal="false" custom-class="import-result-dialog" v-dialog-drag>
+                   append-to-body :close-on-click-modal="true" :close-on-press-escape="true"
+                   custom-class="import-result-dialog" v-dialog-drag>
           <div v-if="resultDialog.level" class="ird-level" :class="'ird-' + resultDialog.level">
             {{ resultDialog.level === 'error' ? '瀵煎叆澶辫触' : (resultDialog.level === 'warning' ? '瀛樺湪闇�瑕佺‘璁ょ殑鍐呭' : '瀵煎叆鎴愬姛') }}
           </div>
@@ -175,8 +202,9 @@
 <script>
 import AppHeader from '@/components/AppHeader.vue'
 import api from '@/api'
+import { granularityOfMany, disabledDateFor, granularityHint, snapPeriod } from '@/utils/periodGranularity'
 const TYPE_LABELS = {
-  h2032: 'H203-2鏈堟姤', transportAuth: '杩愭斂杞﹁締', trackMileage: '杞ㄨ抗閲岀▼', scaleSplit: '瑙勪笂瑙勪笅鎷嗗垎',
+  h2032: 'H203-2鏈堟姤', h202: 'H202杞﹁締鎷ユ湁鎯呭喌', transportAuth: '杩愭斂杞﹁締', trackMileage: '杞ㄨ抗閲岀▼', scaleSplit: '瑙勪笂瑙勪笅鎷嗗垎',
   freightTurnover: '璐ц繍閲忓懆杞噺', passengerMonthly: 'H203-1鏃呭鏈堟姤', passengerIndividual: '涓綋瀹㈣繍閲�/鍛ㄨ浆閲�',
   passengerAuth: '鏃呭杩愭斂杞﹁締鏁�', energyMonthly: 'H204鑳借�楀鎶�', energyAuth: '鑳借�楄溅杈嗚繍鏀夸俊鎭�',
   investment: '鎶曡祫鏈堟姤锛堝杩愮珯鍦猴級', investmentLogistics: '鎶曡祫鏈堟姤锛堢墿娴佸洯鍖猴級', investmentSystem: '鎶曡祫绯荤粺瀵煎嚭',
@@ -190,7 +218,7 @@
   INVEST_SYSTEM: '鎶曡祫绯荤粺瀵煎嚭', CITY_BUS: '鍩庡競鍏氦鏈堟姤', CITY_TAXI: '宸℃父鍑虹鏈堟姤', CITY_TAXI_AUTH: '鍑虹杞﹁繍鏀胯溅杈�', WYC_TOTAL: '缃戠害杞︽�绘暟', WYC_ORDER: '缃戠害杞﹁鍗曞強鍏ㄧ渷鎬婚噺', WYC_ORDER_REPORT: '缃戠害杞﹁鍗曟姤鍛�'
 }
 const BATCH_TYPE_MAP = {
-  H2032: 'h2032', TRANSPORT_AUTH: 'transportAuth', TRACK_MILEAGE: 'trackMileage',
+  H2032: 'h2032', H202: 'h202', TRANSPORT_AUTH: 'transportAuth', TRACK_MILEAGE: 'trackMileage',
   SCALE_SPLIT: 'scaleSplit', FREIGHT_TURNOVER: 'freightTurnover',
   H2031: 'passengerMonthly', PASSENGER_AUTH: 'passengerAuth', PASSENGER_INDIVIDUAL: 'passengerIndividual',
   H204: 'energyMonthly', ENERGY_AUTH: 'energyAuth',
@@ -198,6 +226,7 @@
   WYC_TOTAL: 'wycTotal', WYC_ORDER: 'wycOrder', WYC_ORDER_REPORT: 'wycOrderReport',
   INVEST_SYSTEM: 'investmentSystem'
 }
+const H202_FOLDER_FILE_PATTERN = /^RP_JTB_FreightVehicle_.+\.xlsx$/i
 export default {
   components: { AppHeader },
   name: 'DataImport',
@@ -226,6 +255,7 @@
         {
           key: 'freight', name: '閬撹矾璐ц繍', types: [
             { value: 'h2032', label: '閬撹矾璐х墿杩愯緭鏈堝害鐢熶骇鎯呭喌' },
+            { value: 'h202', label: '鍏矾璐х墿钀ヨ繍杞﹁締鎷ユ湁鎯呭喌(H202)' },
             { value: 'transportAuth', label: '杩愭斂杞﹁締' },
             { value: 'trackMileage', label: '杞ㄨ抗閲岀▼' },
             { value: 'scaleSplit', label: '瑙勪笂瑙勪笅鎷嗗垎' },
@@ -283,15 +313,41 @@
     }
   },
   computed: {
+    selectedImportTypes() {
+      const out = []
+      if (this.importType) out.push(this.importType)
+      Object.keys(this.moduleSel || {}).forEach(k => { if (this.moduleSel[k]) out.push(this.moduleSel[k]) })
+      return out
+    },
+    periodGranularity() { return granularityOfMany(this.selectedImportTypes) },
+    periodPickerOptions() {
+      const d = disabledDateFor(this.periodGranularity)
+      return d ? { disabledDate: d } : {}
+    },
+    periodHint() { return granularityHint(this.periodGranularity) },
     // 骞存姤鏆備笉寮�鏀撅細闅愯棌鍏ュ彛锛堟暟鎹繚鐣欙紝鍚庣瀹炵幇鍚庡彲绉婚櫎 hidden锛�
     visibleGroups() { return this.groups.filter(g => !g.hidden) },
     failBatches() { return this.batches.filter(b => b.failRows > 0) },
+    // 鍚彁閱掔殑鎵规锛歟rrorDetail 閲屾湁銆屻�愭彁閱� N 澶勩�戙�嶆锛堟湭鐭ョ爜绛夛紝涓嶉樆鏂鍏ワ級
+    warnBatches() { return this.batches.filter(b => b.errorDetail && String(b.errorDetail).indexOf('銆愭彁閱� ') >= 0) },
     failRowsFlat() {
       const out = []
       for (const b of this.failBatches) {
-        const rows = this.parseFailDetails(b)
+        const rows = this.parseFailDetails({ errorDetail: this.failDetailText(b) })
         if (!rows.length) {
-          out.push({ importType: b.importType, reportPeriod: b.reportPeriod, fileName: b.fileName, position: '', reason: b.errorDetail || '璇ユ壒娆℃棤澶辫触鏄庣粏' })
+          out.push({ importType: b.importType, reportPeriod: b.reportPeriod, fileName: b.fileName, position: '', reason: this.failDetailText(b) || '璇ユ壒娆℃棤澶辫触鏄庣粏' })
+        } else {
+          rows.forEach(r => out.push({ importType: b.importType, reportPeriod: b.reportPeriod, fileName: b.fileName, position: r.position, reason: r.reason }))
+        }
+      }
+      return out
+    },
+    warnRowsFlat() {
+      const out = []
+      for (const b of this.warnBatches) {
+        const rows = this.parseFailDetails({ errorDetail: this.warnDetailText(b) })
+        if (!rows.length) {
+          out.push({ importType: b.importType, reportPeriod: b.reportPeriod, fileName: b.fileName, position: '', reason: this.warnDetailText(b) || '璇ユ壒娆″惈鎻愰啋' })
         } else {
           rows.forEach(r => out.push({ importType: b.importType, reportPeriod: b.reportPeriod, fileName: b.fileName, position: r.position, reason: r.reason }))
         }
@@ -301,6 +357,7 @@
     templateName() {
       const map = {
         h2032: '妯℃澘_浜や紒缁烪203-2琛╛閬撹矾璐х墿杩愯緭鏈堝害鐢熶骇鎯呭喌.xlsx',
+        h202: 'RP_JTB_FreightVehicle_鍏ㄧ渷.xlsx锛堝鍏ュ墠灏嗘枃浠跺悕鈥滃叏鐪佲�濆拰琛ㄥ唴 L3 鎶ヨ〃鏃ユ湡鏀逛负瀹為檯鍦板尯銆佹姤琛ㄦ湡鏈棩鏈燂級',
         transportAuth: '妯℃澘_杩愭斂杞﹁締.xlsx',
         trackMileage: '妯℃澘_杞ㄨ抗閲岀▼.xlsx',
         scaleSplit: '妯℃澘_瑙勪笂瑙勪笅鎷嗗垎杩愯緭閲�.xlsx',
@@ -327,6 +384,7 @@
     templateUrl() {
       const map = {
         h2032: '璐ц繍/妯℃澘_浜や紒缁烪203-2琛╛閬撹矾璐х墿杩愯緭鏈堝害鐢熶骇鎯呭喌.xlsx',
+        h202: '璐ц繍/RP_JTB_FreightVehicle_鍏ㄧ渷.xlsx',
         transportAuth: '璐ц繍/妯℃澘_杩愭斂杞﹁締.xlsx',
         trackMileage: '璐ц繍/妯℃澘_杞ㄨ抗閲岀▼.xlsx',
         scaleSplit: '璐ц繍/妯℃澘_瑙勪笂瑙勪笅鎷嗗垎杩愯緭閲�.xlsx',
@@ -347,6 +405,17 @@
         investmentSystem: '鎶曡祫/妯℃澘_鏌ヨ缁撴灉(鎶曡祫绯荤粺-瀹㈣繍+鐗╂祦 2026.7).xls'
       }
       return map[this.importType] || ''
+    }
+  },
+  watch: {
+    // 鏈熸绮掑害璺熺潃鏁版嵁绫诲瀷璧帮細閫夊埌鑳借�楀鎶ユ椂鑷姩鎶婃姤琛ㄦ湡瀵归綈鍒板搴︽湯鏈�
+    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: {
@@ -378,6 +447,7 @@
     endpoint(t) {
       const map = {
         h2032: '/import/h2032',
+        h202: '/import/h202',
         transportAuth: '/import/transportAuth',
         trackMileage: '/import/trackMileage',
         scaleSplit: '/import/scaleSplit',
@@ -398,6 +468,37 @@
         wycOrderReport: '/import/wycOrderReport'
       }
       return map[t] || ''
+    },
+    pickH202Folder(key) {
+      if (this.importing) { this.$message.warning('姝e湪瀵煎叆涓紝璇风◢鍊欏啀閫夋嫨鏂囦欢澶�'); return }
+      if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return }
+      const ref = this.$refs['folder' + key]
+      const input = Array.isArray(ref) ? ref[0] : ref
+      if (!input) { this.$message.error('鏂囦欢澶归�夋嫨鎺т欢鏈氨缁紝璇峰埛鏂伴〉闈㈠悗閲嶈瘯'); return }
+      input.value = ''
+      input.click()
+    },
+    onFolderPicked(key, event) {
+      const input = event && event.target
+      const selected = Array.from((input && input.files) || [])
+      if (input) input.value = ''
+      const type = this.moduleSel[key]
+      if (type !== 'h202' || !selected.length) return
+      if (this.importing) { this.$message.warning('姝e湪瀵煎叆涓紝璇风◢鍊欏啀閫夋嫨鏂囦欢澶�'); return }
+      if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return }
+      const fileList = selected
+        .filter(f => H202_FOLDER_FILE_PATTERN.test(f.name))
+        .sort((a, b) => String(a.webkitRelativePath || a.name).localeCompare(String(b.webkitRelativePath || b.name), 'zh-CN'))
+      const ignored = selected.length - fileList.length
+      if (!fileList.length) {
+        this.$message.warning('鎵�閫夋枃浠跺す涓病鏈夌鍚� H202 鍛藉悕瑙勫垯鐨� .xlsx 鏂囦欢')
+        return
+      }
+      this.$set(this.files, type, fileList)
+      this.$set(this.fileNames, type, fileList.map(f => f.name))
+      if (ignored > 0) this.$message.warning('宸插拷鐣� ' + ignored + ' 涓笉绗﹀悎 H202 鍛藉悕瑙勫垯鐨勬枃浠�')
+      this.importing = true
+      this.batchImport(type, key, fileList).finally(() => { this.importing = false })
     },
     onFilePicked(key, file) {
       const type = this.moduleSel[key]
@@ -550,16 +651,42 @@
     showImportResult(row) {
       if (!row || !row.status) return
       const msg = (row.message || '').toString()
-      if (row.status === 'success') {
-        const text = (msg && msg.indexOf('瀵煎叆') !== -1) ? msg : '鏁版嵁瀵煎叆鎴愬姛'
-        this.$message({ message: text, type: 'success', duration: 5000 })
-      } else {
+      if (row.status !== 'success') {
         this.showResultDialog({
           title: '鏁版嵁瀵煎叆澶辫触',
-          html: (msg || '鏁版嵁瀵煎叆澶辫触锛岃瑙佷笅鏂瑰け璐ヨ褰�').replace(/\n/g, '<br>'),
+          html: this.escapeHtml(msg || '鏁版嵁瀵煎叆澶辫触锛岃瑙佷笅鏂瑰け璐ヨ褰�').replace(/\n/g, '<br>'),
           level: 'error'
         })
+        return
       }
+      const lines = msg.split('\n').map(s => s.trim()).filter(s => s)
+      const head = lines.length ? lines[0] : '鏁版嵁瀵煎叆鎴愬姛'
+      // 鍏ㄩ儴鎴愬姛锛氬彧缁欎竴鏉$煭鎻愮ず锛屼笉寮圭獥锛堣兘鑰楃瓑鎴愬姛瀵煎叆涓嶈鎵撴壈锛夛紱
+      // 闀挎枃鏈杩� el-message 浼氳鎾戞垚妯疮灞忓箷鐨勯暱鏉★紝鎵�浠ヨ繖閲屼篃鍙彇棣栬銆�
+      const failMatch = msg.match(/澶辫触\s*(\d+)\s*鏉�/)
+      const failCount = failMatch ? Number(failMatch[1]) : 0
+      if (failCount > 0) {
+        // 鏈夊け璐ヨ锛氫繚鐣欒鎯呭脊绐楋紙鍚鍙凤級锛屾弧瓒�"瀵煎叆澶辫触瑕佸湪椤甸潰鏄剧ず琛屽彿"
+        this.showResultDialog({
+          title: '瀵煎叆瀹屾垚锛堥儴鍒嗗け璐ワ紝瑙佹槑缁嗭級',
+          html: lines.map(l => this.escapeHtml(l)).join('<br>'),
+          level: 'warning'
+        })
+        return
+      }
+      const warnMatch = msg.match(/浠ヤ笅\s*(\d+)\s*澶勪负鎻愰啋/)
+      let text = head
+      if (warnMatch) text += '锛涘彟鏈� ' + warnMatch[1] + ' 澶勬彁閱�'
+      this.$message({ message: text, type: warnMatch ? 'warning' : 'success', duration: 4000 })
+    },
+    /** 寮圭獥鍐呭鐢� v-html 娓叉煋锛岀粺涓�杞箟锛岄伩鍏嶆秷鎭噷鐨� < > & 鐮村潖 DOM */
+    escapeHtml(v) {
+      return String(v === null || v === undefined ? '' : v)
+        .replace(/&/g, '&amp;')
+        .replace(/</g, '&lt;')
+        .replace(/>/g, '&gt;')
+        .replace(/"/g, '&quot;')
+        .replace(/'/g, '&#39;')
     },
     importOne(row) {
       if (!this.period) { this.$message.warning('璇峰厛閫夋嫨鎶ヨ〃鏈�'); return Promise.resolve() }
@@ -572,7 +699,17 @@
         fd.append('category', row.type === 'investment' ? '瀹㈣繍绔欏満' : '鐗╂祦鍥尯')
       }
       return api.post(this.endpoint(row.type), fd, { headers: { 'Content-Type': 'multipart/form-data' }, timeout: 600000 })
-        .then(res => { row.status = 'success'; row.message = res.data || '瀵煎叆鎴愬姛' })
+        .then(res => {
+          // axios 鎷︽埅鍣ㄥ彧鎷嗗嚭 response.data锛堜笟鍔″寘 Result锛夛紝蹇呴』鑷鍒� code锛�
+          // 鍚庣瑙f瀽/鏍¢獙寮傚父鏃惰繑鍥� code=500 涓斿師鍥犲湪 message 閲岋紝鏃у啓娉曚細鎶婂け璐ユ樉绀烘垚銆屽鍏ユ垚鍔熴�嶃��
+          if (res && res.code !== undefined && res.code !== 200) {
+            row.status = 'fail'
+            row.message = res.message || '瀵煎叆澶辫触'
+          } else {
+            row.status = 'success'
+            row.message = (res && res.data) || '瀵煎叆鎴愬姛'
+          }
+        })
         .catch(e => { row.status = 'fail'; row.message = (e.response && e.response.data && e.response.data.message) || '瀵煎叆澶辫触' })
         .finally(() => {})
     },
@@ -723,6 +860,19 @@
       document.body.removeChild(a)
       URL.revokeObjectURL(url)
     },
+  /** 澶辫触鏄庣粏鏂囨湰锛堝幓鎺夈�屻�愭彁閱� N 澶勩�戙�嶅強鍏跺悗鐨勬彁閱掓锛� */
+    failDetailText(b) {
+      const t = String((b && b.errorDetail) || '')
+      const i = t.indexOf('銆愭彁閱� ')
+      return (i >= 0 ? t.slice(0, i) : t).trim()
+    },
+    /** 鎻愰啋鏄庣粏鏂囨湰锛堛�屻�愭彁閱� N 澶勩�戙�嶄箣鍚庣殑閮ㄥ垎锛� */
+    warnDetailText(b) {
+      const t = String((b && b.errorDetail) || '')
+      const i = t.indexOf('銆愭彁閱� ')
+      if (i < 0) return ''
+      return t.slice(i).replace(/^銆愭彁閱抃s*\d+\s*澶勩�慭s*/, '').trim()
+    },
   parseFailDetails(row) {
     if (!row || !row.errorDetail) return []
     const lines = String(row.errorDetail).split(/\r?\n/)

--
Gitblit v1.9.1