派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-14 062f5d4a5c511f360c2d73a66b24ce84d5cb2d68
src/components/table/components/WasteWater.vue
@@ -3,9 +3,6 @@
           <el-table
                   class="tableBox"
                   :data="tableData"
                   style="width: 100%"
                   :header-cell-style="tableHeaderColor"
                   :cell-style="rowClass"
                   @cell-click="handle"
           >
               <el-table-column
@@ -21,8 +18,8 @@
                             popper-class="popovers"
                        >
                   <ChemicalWastewater v-show="$index ===1"></ChemicalWastewater>
                   <i class="el-icon-caret-right"  slot="reference" v-if="!isShowIcon" @click="doIcon($index)"></i>
                   <i class="el-icon-caret-bottom"  slot="reference" v-else @click="doIcon($index)"></i>
                   <i class="el-icon-caret-right" :class="{active: isActive === $index}" slot="reference" @click="doIcon($index)"></i>
<!--                   <i class="el-icon-caret-bottom"   slot="reference" v-else @click="doIcon($index)"></i>-->
                 </el-popover>
                   </template>
               </el-table-column>
@@ -41,11 +38,7 @@
                   <div v-else >{{scope.row.UserName}}</div>
                 </template>
               </el-table-column>
               <el-table-column
                       prop="WasteWaters"
                       label="外排废水量(m³)"
                       width="100px">
               </el-table-column>
               <el-table-column prop="WasteWaters" label="外排废水量(m³)"></el-table-column>
               <el-table-column label="COD  (t)">
                   <el-table-column
                           prop="AddOutPut"
@@ -82,7 +75,7 @@
                           width="200"
                           trigger="click"
                                   popper-class="popovers"
                           title="XXX1明细表"
                           title="监测点明细表"
                       >
                         <refinery></refinery>
                         <u slot="reference" style="color: #00ffff">{{row.normal}}</u>
@@ -146,6 +139,7 @@
  },
  data () {
    return {
      isActive: '',
      isShowIcon: false,
      tableData: [{
        UserName: '集团名称',
@@ -200,34 +194,33 @@
  },
  methods: {
    tableHeaderColor ({ row, column, owIndex, columnIndex }) {
      return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px'
    //  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'
      // return 'text-align: center;background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;width:64px'
    },
    // 获取点击的表格
    handle (row, column, event, cell) {
      console.log(row.UserName)
    },
    doIcon (index) {
      if (index === 1) {
        this.isShowIcon = !this.isShowIcon
      } else {
      if (index !== 1) {
        this.isShowIcon = false
        this.isActive = ''
        return
      }
      this.isShowIcon = !this.isShowIcon
      if (index === this.isActive) {
        this.isActive = ''
        return
      }
      this.isActive = index
    }
  }
}
</script>
<style scoped>
.popovers{
  width: auto !important;
  background-color: gray !important;
}
.popovers.el-popover{
padding:0;
}
<style>
</style>