From 4df0471b7dff0494625ff09969b1a13b5359a26e Mon Sep 17 00:00:00 2001
From: XingChuan <m17600301067@163.com>
Date: 星期一, 31 五月 2021 22:41:47 +0800
Subject: [PATCH] 统计表弹框UI优化;增加点击企业名称缩放至企业;二级表展示功能优化。

---
 src/components/table/components/tabHandover.vue |   80 ++++++++++++++++------------------------
 1 files changed, 32 insertions(+), 48 deletions(-)

diff --git a/src/components/table/components/tabHandover.vue b/src/components/table/components/tabHandover.vue
index 1599ed3..bc7816c 100644
--- a/src/components/table/components/tabHandover.vue
+++ b/src/components/table/components/tabHandover.vue
@@ -1,15 +1,10 @@
 <template>
-  <div>
+  <div class="tabHandover">
     <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>
+      <component :is="gcComp" :searchNameToPosition="searchNameToPosition"></component>
     </div>
   </div>
 </template>
@@ -22,9 +17,9 @@
 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'
+import Pipeline from '@components/table/components/Pipeline'
+import CorporateEmergency from '@components/table/components/CorporateEmergency'
+import { topicList } from '../../../conf/Topic'
 export default {
   name: 'tabHandover',
   components: {
@@ -33,81 +28,70 @@
     // SoilGroundwater,
     SolidWaste,
     PollutionSource,
-    EnvironmentalRisk
+    EnvironmentalRisk,
+    Pipeline,
+    CorporateEmergency
   },
   data () {
     return {
       titleProp: '',
       activeName: '姹℃煋婧�',
-      topicList: TopicList, // tab椤�
-      gcComp: PollutionSource, // 榛樿鏄剧ず姹℃煋婧愬唴瀹�
-      PollutionSourcetableDataList: null, // 姹℃煋婧愮粺璁℃暟鎹�
-      WasteWatertableDataList: null, // 搴熸按缁熻鏁版嵁
-      WasteGastableDataList: null, // 搴熸皵缁熻鏁版嵁
-      SolidWastetableDataList: null, // 鍥哄簾缁熻鏁版嵁
-      EnvironmentalRisktableDataList: null // 鐜椋庨櫓婧愮粺璁℃暟鎹�
+      topicList: topicList, // tab椤�
+      gcComp: PollutionSource
     }
-  },
-  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
+          this.gcComp = Pipeline
           break
+        case '浼佷笟搴旀��':
+          this.gcComp = CorporateEmergency
+          break
+      }
+    },
+    searchNameToPosition (e) {
+      if (e.target.innerHTML === '闆嗗洟鍏徃') {
+        return window.map.setView({ lat: 34.828558921813965, lng: 117.41676807403564 }, 5)
+      }
+      if (this.$store.state.companyPoints.filter(obj => obj.name === e.target.innerHTML).length > 0) {
+        const newList = this.$store.state.companyPoints.filter(obj => obj.name === e.target.innerHTML)[0]
+        window.map.setView({ lat: newList.Latitude, lng: newList.Longitude }, 15)
+      } else {
+        this.$message({
+          message: '娌℃湁鏌ヨ鍒拌浼佷笟锛�',
+          type: 'warning'
+        })
       }
     }
   }
 }
 </script>
 
-<style scoped>
-
+<style>
+.tabHandover .el-tabs__item{
+  font-size: .1rem;
+}
 </style>

--
Gitblit v1.8.0