From 05302246665dbb14b26c5d46386bd82d89965396 Mon Sep 17 00:00:00 2001
From: XingChuan <m17600301067@163.com>
Date: 星期四, 27 五月 2021 14:47:41 +0800
Subject: [PATCH] 更换报表数据请求方式
---
src/components/table/components/tabHandover.vue | 85 +++++++++++++++++++++++++++++-------------
1 files changed, 59 insertions(+), 26 deletions(-)
diff --git a/src/components/table/components/tabHandover.vue b/src/components/table/components/tabHandover.vue
index e451864..1599ed3 100644
--- a/src/components/table/components/tabHandover.vue
+++ b/src/components/table/components/tabHandover.vue
@@ -1,73 +1,106 @@
<template>
<div>
<el-tabs v-model="activeName" @tab-click="handleClick">
- <!-- <el-tab-pane label="搴熸按" name="first">
- <waste-water></waste-water>
- </el-tab-pane>
- <el-tab-pane label="搴熸皵" name="second">
- <waste-water></waste-water>
- </el-tab-pane>
- <el-tab-pane label="鍥哄簾" name="third">
- <solid-waste></solid-waste>
- </el-tab-pane>
- <el-tab-pane label="绌烘皵璐ㄩ噺" name="fourth">
- <AirQuality></AirQuality>
- </el-tab-pane> -->
<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"></component>
+ <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 WasteGas from '@components/table/components/WasteGas'
+import SoilGroundwater from '@components/table/components/SoilGroundwater'
+import WasteGas from '@components/table/components/WasteGas'
import SolidWaste from '@components/table/components/WasteSolid'
-import AirQuality from '@components/table/components/AirQuality'
+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,
- AirQuality
+ PollutionSource,
+ EnvironmentalRisk
},
data () {
return {
- activeName: 'first',
- topicList: TopicList,
- gcComp: AirQuality
+ 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) {
- console.log(tab.label)
switch (tab.label) {
case '姹℃煋婧�':
- this.gcComp = AirQuality
+ this.gcComp = PollutionSource
+ this.getStatisticsData('姹℃煋婧�')
break
case '搴熸按':
this.gcComp = WasteWater
+ this.getStatisticsData('搴熸按')
break
case '搴熸皵':
- this.gcComp = WasteWater
+ this.gcComp = WasteGas
+ this.getStatisticsData('搴熸皵')
break
case '鍥哄簾':
this.gcComp = SolidWaste
+ this.getStatisticsData('鍥哄簾')
break
case '鐜椋庨櫓':
- this.gcComp = AirQuality
+ this.gcComp = EnvironmentalRisk
+ this.getStatisticsData('鐜椋庨櫓')
break
case '鍦熷¥鍙婂湴涓嬫按':
- this.gcComp = AirQuality
+ this.gcComp = SoilGroundwater
break
case '绠$嚎':
- this.gcComp = AirQuality
+ // this.gcComp = AirQuality
break
}
}
--
Gitblit v1.8.0