派生自 wuyushui/SewerAndRainNetwork

XingChuan
2021-05-27 05302246665dbb14b26c5d46386bd82d89965396
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane v-for="(item,index) in topicList" :key="index" :label="item.name" :name="item.name"></el-tab-pane>
    </el-tabs>
    <div>
      <component :is="gcComp" :PollutionSourcetableDataList="PollutionSourcetableDataList" v-if="PollutionSourcetableDataList"
                              :WasteWatertableDataList="WasteWatertableDataList"
                              :WasteGastableDataList="WasteGastableDataList"
                              :SolidWastetableDataList="SolidWastetableDataList"
                              :EnvironmentalRisktableDataList="EnvironmentalRisktableDataList"
      ></component>
    </div>
  </div>
</template>
 
<script>
 
import WasteWater from '@components/table/components/WasteWater'
import SoilGroundwater from '@components/table/components/SoilGroundwater'
import WasteGas from '@components/table/components/WasteGas'
import SolidWaste from '@components/table/components/WasteSolid'
import PollutionSource from '@components/table/components/PollutionSource'
import EnvironmentalRisk from '@components/table/components/EnvironmentalRisk'
import mapApi from '@/api/mapApi'
 
import { TopicList } from '../../../conf/Topic'
export default {
  name: 'tabHandover',
  components: {
    WasteWater,
    // WasteGas,
    // SoilGroundwater,
    SolidWaste,
    PollutionSource,
    EnvironmentalRisk
  },
  data () {
    return {
      titleProp: '',
      activeName: '污染源',
      topicList: TopicList, // tab项
      gcComp: PollutionSource, // 默认显示污染源内容
      PollutionSourcetableDataList: null, // 污染源统计数据
      WasteWatertableDataList: null, // 废水统计数据
      WasteGastableDataList: null, // 废气统计数据
      SolidWastetableDataList: null, // 固废统计数据
      EnvironmentalRisktableDataList: null // 环境风险源统计数据
    }
  },
  mounted () {
    this.getStatisticsData(this.activeName)
  },
  methods: {
    refsDatatitle (item) {
      this.titleProp = item
    },
    async getStatisticsData (obj) {
      switch (obj) {
        case '污染源':
          this.PollutionSourcetableDataList = await mapApi.getPollutionSourceStatistics()
          break
        case '废水':
          this.WasteWatertableDataList = await mapApi.getWasteWaterStatistics()
          break
        case '废气':
          this.WasteGastableDataList = await mapApi.getWasteGasStatistics()
          break
        case '固废':
          this.SolidWastetableDataList = await mapApi.getSolidWasteStatistics()
          break
        case '环境风险':
          this.EnvironmentalRisktableDataList = await mapApi.getEnvironmentalRiskStatistics()
          break
      }
    },
    handleClick (tab, event) {
      switch (tab.label) {
        case '污染源':
          this.gcComp = PollutionSource
          this.getStatisticsData('污染源')
          break
        case '废水':
          this.gcComp = WasteWater
          this.getStatisticsData('废水')
          break
        case '废气':
          this.gcComp = WasteGas
          this.getStatisticsData('废气')
          break
        case '固废':
          this.gcComp = SolidWaste
          this.getStatisticsData('固废')
          break
        case '环境风险':
          this.gcComp = EnvironmentalRisk
          this.getStatisticsData('环境风险')
          break
        case '土壤及地下水':
          this.gcComp = SoilGroundwater
          break
        case '管线':
          // this.gcComp = AirQuality
          break
      }
    }
  }
}
</script>
 
<style scoped>
 
</style>