派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-03-16 97a7d4a2a256b9171bca05e69d154996645b4722
src/components/table/components/WasteWater.vue
@@ -1,27 +1,26 @@
<template>
   <div class="waste-water">
<!--       <el-row>-->
<!--           <el-col>-->
           <el-table
                   class="tableBox"
                   :data="tableData"
                   :cell-style="rowClass"
                   style="width: 100%"
                   :header-cell-style="tableHeaderColor"
                   :cell-style="rowClass"
                   @cell-click="handle"
           >
               <el-table-column
                       width="30px"
                        label=""
               >
                 <template >
                 <el-popover :value= "show"
                 <el-popover
                         placement="bottom"
                         width="200"
                         trigger="click"
                             popper-class="popovers"
                        >
                   <ChemicalWastewater @isshow= "show=false"></ChemicalWastewater>
                   <i class="el-icon-caret-right"  slot="reference" v-if="!isShowIcon"  ></i>
                   <i class="el-icon-caret-bottom" slot="reference" v-else-if="isShowIcon"></i>
                   <ChemicalWastewater></ChemicalWastewater>
                   <i class="el-icon-caret-right"  slot="reference" v-if="!isShowIcon" @click="doIcon"></i>
<!--                   <i class="el-icon-caret-bottom" slot="reference" v-else-if="isShowIcon&&$index===1"></i>-->
<!--                       <i class="el-icon-caret-bottom" v-else-if="isShowIcon&&scope.row.index===1"></i>-->
<!--                       <i v-if="isShowIcon" class="el-icon-caret-bottom" slot="reference" @click="isbtn"></i>-->
<!--                   <i v-else class="el-icon-caret-right" slot="reference" @click="isbtn"></i>-->
@@ -85,8 +84,10 @@
                           placement="bottom-end"
                           width="200"
                           trigger="click"
                                   popper-class="popovers"
                           title="XXX1明细表"
                       >
                         <ChemicalWastewater></ChemicalWastewater>
                         <refinery></refinery>
                         <u slot="reference" style="color: #00ffff">{{row.normal}}</u>
                         <!--                       <i class="el-icon-caret-bottom" v-else-if="isShowIcon&&scope.row.index===1"></i>-->
                         <!--                       <i v-if="isShowIcon" class="el-icon-caret-bottom" slot="reference" @click="isbtn"></i>-->
@@ -113,6 +114,19 @@
                           prop="deficiency"
                           label="缺失"
                           width="60px">
                     <template slot-scope="{row,$index}">
                       <u v-if="$index!=1" >{{row.deficiency}}</u>
                       <el-popover v-else
                                   placement="bottom-end"
                                   width="200"
                                   trigger="click"
                                   title="天津石化监测点缺失报警明细"
                                   popper-class="popovers"
                       >
                         <MissingAlarm></MissingAlarm>
                         <u slot="reference" style="color: #00ffff">{{row.deficiency}}</u>
                       </el-popover>
                     </template>
                   </el-table-column>
               </el-table-column>
           </el-table>
@@ -124,9 +138,13 @@
<script>
import ChemicalWastewater from './componented/ChemicalWastewater'
import Refinery from '@components/table/components/componented/refinery'
import MissingAlarm from '@components/table/components/componented/MissingAlarm'
export default {
  name: 'WasteWater',
  components: {
    MissingAlarm,
    Refinery,
    ChemicalWastewater
  },
  data () {
@@ -192,31 +210,22 @@
    rowClass  () {
      return 'text-align: center;background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;width:64px'
    },
    // cellClick (row, column, cell, event) {
    //   console.log(row.index)
    //   if (row.index === 1) {
    //     this.isShowIcon = !this.isShowIcon
    //   }
    //   // console.log(column)
    //   // console.log(cell)
    //   // console.log(event)
    // },
    // isbtn () {
    //     this.isShowIcon = !this.isShowIcon
    //   // this.isShowIcon = !this.isShowIcon
    //   // console.log(1)
    // },
    tableCellClassName ({ row, column, rowIndex, columnIndex }) {
      row.index = rowIndex
      column.index = columnIndex
    // 获取点击的表格
    handle (row, column, event, cell) {
      console.log(row.UserName)
    },
    doIcon () {
      console.log(1)
      this.isShowIcon = !this.isShowIcon
    }
  }
}
</script>
<style >
<style scoped>
.popovers{
  width: auto !important;
  background-color: gray !important;
}
.popovers.el-popover{
padding:0;