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/PollutionSource.vue |   77 ++++++++++++++++++++++++++++++++------
 1 files changed, 65 insertions(+), 12 deletions(-)

diff --git a/src/components/table/components/PollutionSource.vue b/src/components/table/components/PollutionSource.vue
index 474e1dc..2dd0df7 100644
--- a/src/components/table/components/PollutionSource.vue
+++ b/src/components/table/components/PollutionSource.vue
@@ -1,26 +1,51 @@
 <template>
     <div class="PollutionSource">
-        <el-table class="tableBox" :data="tableData" :header-cell-style="tableHeaderColor" :cell-style="rowClass" border>
+        <el-table class="tableBox" v-loading :data="tableData" :header-cell-style="tableHeaderColor" :cell-style="rowClass" border>
             <el-table-column width="30px" label="">
-                <template>
-                    <i class="el-icon-caret-right"></i>
-                    <span style="margin-left: 10px"></span>
+                <template slot-scope="{row,$index}">
+                  <el-popover placement="bottom" trigger="click" :disabled="!isShowIcon" popper-class="popovers">
+                    <SecondaryTablePollutionSource v-show="$index ===1"></SecondaryTablePollutionSource>
+                    <i class="el-icon-caret-right showBottomTableBtn" @click="showBottomTable" slot="reference"></i>
+                  </el-popover>
                 </template>
             </el-table-column>
             <el-table-column label="搴忓彿" width="60px" type="index"></el-table-column>
-            <el-table-column prop="UserName" label="浼佷笟鍚嶇О"></el-table-column>
-            <el-table-column prop="ProductionFacilities" label="鐢熶骇璁炬柦"></el-table-column>
-            <el-table-column prop="GovernanceFacilities" label="娌荤悊璁炬柦"></el-table-column>
+            <el-table-column prop="UserName" label="浼佷笟鍚嶇О">
+              <template slot-scope="{row}">
+                <u @click="searchNameToPosition" style="cursor: pointer">{{row.UserName}}</u>
+              </template>
+            </el-table-column>
+            <el-table-column prop="ProductionFacilities" label="鐢熶骇瑁呯疆锛堜釜锛�">
+              <template slot-scope="{row}">
+                <el-popover placement="bottom-end" trigger="click" title="澶╂触鐭冲寲鐩戞祴鐐圭己澶辨姤璀︽槑缁�" popper-class="popovers">
+                  <u slot="reference" style="color: #00ffff">{{row.ProductionFacilities}}</u>
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column prop="GovernanceFacilities" label="娌荤悊璁炬柦锛堜釜锛�"></el-table-column>
         </el-table>
     </div>
 </template>
 
 <script>
 import mapApi from '@/api/mapApi'
+
+import SecondaryTablePollutionSource from './componented/SecondaryTablePollutionSource'
+
 export default {
-  name: 'AirQuality',
+  name: 'PollutionSource',
+  components: {
+    SecondaryTablePollutionSource
+  },
+  props: {
+    searchNameToPosition: {
+      type: Function
+    }
+  },
   data () {
     return {
+      isActive: '',
+      isShowIcon: false,
       tableData: null
     }
   },
@@ -32,13 +57,41 @@
       // return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px'
     },
     // 琛ㄥご鏍峰紡璁剧疆
-    rowClass  () {
-      // return 'text-align: center;background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;width:64px'
+    rowClass (row, column) {
+      return 'height:.3rem'
+    },
+    showBottomTable (e) {
+      if (e.path[0].classList.contains('go') === true) {
+        e.path[0].classList.remove('go')
+        e.path[0].classList.add('aa')
+      } else {
+        const newList = document.querySelectorAll('i.showBottomTableBtn')
+        for (let i = 0; i < newList.length; i++) {
+          newList[i].classList.remove('go')
+        }
+        e.path[0].classList.remove('aa')
+        e.path[0].classList.add('go')
+      }
     }
   }
 }
 </script>
 
-<style scoped>
-
+<style scoped lang="less">
+.PollutionSource{
+  .el-icon-caret-right{
+    position: absolute;
+    top: .11rem;
+    left: .04rem;
+    font-size: .14rem;
+    cursor: pointer;
+  }
+}
+.aa{
+  transition: all .2s;
+}
+.go{
+  transform:rotate(90deg);
+  transition: all .2s;
+}
 </style>

--
Gitblit v1.8.0