traffic-audit-web/src/views/DataImport.vue
@@ -1,3 +1,4 @@
<template>
  <el-container direction="vertical">
    <app-header title="交通统计报表审核系统 - 数据导入"></app-header>
    <el-container>
@@ -36,7 +37,7 @@
                                <div class="module-sel-row">
                  <el-select v-model="moduleSel[g.key]" placeholder="选择数据类型" style="width:260px"
                             @change="onModuleChange(g.key)" clearable>
                    <el-option v-for="t in g.types" :key="t.value" :label="t.label" :value="t.value"></el-option>
                    <el-option v-for="t in typeList(g)" :key="t.value" :label="t.label" :value="t.value"></el-option>
                  </el-select>
                  <div v-if="importType" class="tpl-box">
                    <span class="tpl-name">模板:{{ templateName }}</span>
@@ -113,7 +114,7 @@
                <div v-else class="overview-grid">
                  <div class="ov-row" v-for="g in visibleGroups" :key="g.key">
                    <div class="ov-group">{{ g.name }}</div>
                    <div class="ov-item" v-for="t in g.types" :key="t.value" :class="overviewState(t.value).cls">
                    <div class="ov-item" v-for="t in typeList(g)" :key="t.value" :class="overviewState(t.value).cls">
                      <div class="ov-name">{{ t.label }}</div>
                      <div class="ov-status">{{ overviewState(t.value).text }}</div>
                    </div>
@@ -133,7 +134,7 @@
            <div v-if="clearScope === 'types'" class="clear-types">
              <el-select v-model="clearTypes" multiple filterable collapse-tags placeholder="选择要清空的数据类型" style="width:100%">
                <el-option-group v-for="g in clearableGroups()" :key="g.key" :label="g.name">
                  <el-option v-for="t in g.types" :key="t.value" :value="t.value"
                  <el-option v-for="t in typeList(g)" :key="t.value" :value="t.value"
                             :label="t.label + '(' + overviewState(t.value).text + ')'"></el-option>
                </el-option-group>
              </el-select>
@@ -225,7 +226,7 @@
            { value: 'cityTaxi', label: '巡游出租汽车运营服务情况月报' },
            { value: 'cityTaxiAuth', label: '出租车运政车辆' },
            { value: 'wycTotal', label: '网约车总数' },
            { value: 'wycOrder', label: '网约车订单及全省总量' },
            { value: 'wycOrder', label: '网约车订单及全省总量', hidden: true },
            { value: 'wycOrderReport', label: '网约车订单报告' }
          ]
        },
@@ -333,7 +334,20 @@
    typeLabel(t) { return TYPE_LABELS[t] || t },
    downloadTemplate() {
      if (!this.templateUrl) return
      window.open('/api/templates/' + this.templateUrl)
      const name = this.templateUrl.split('/').pop()
      api.get('/templates/' + this.templateUrl, { responseType: 'blob' })
        .then(res => {
          const blob = res instanceof Blob ? res : new Blob([res])
          const url = window.URL.createObjectURL(blob)
          const a = document.createElement('a')
          a.href = url
          a.download = name
          document.body.appendChild(a)
          a.click()
          window.URL.revokeObjectURL(url)
          document.body.removeChild(a)
        })
        .catch(() => this.$message.error('模板下载失败,请稍后重试'))
    },
    onModuleChange(key) {
      this.importType = this.moduleSel[key] || ''
@@ -570,6 +584,10 @@
    clearableGroups() {
      return this.groups.filter(g => !g.hidden)
    },
    // 单个数据类型也可隐藏(hidden: true):入口、概览、清空下拉统一过滤
    typeList(g) {
      return (g && g.types ? g.types : []).filter(t => !t.hidden)
    },
    confirmClear() {
      if (!this.period) { this.$message.warning('请先选择报表期'); return }
      if (this.clearing) return