派生自 wuyushui/SewerAndRainNetwork

chenyabin
2021-04-07 cd80929f0ae8882a98cfe3936b2a96bded1c12d8
src/components/BaseNav/PublicBounced/GasComponents/PublicTable.vue
@@ -1,48 +1,79 @@
<template>
  <div class="public-table">
    <el-table
        :data="tableData"
        style="width: 100%">
      <el-table-column
          prop="date"
          label="日期"
          width="180">
      </el-table-column>
      <el-table-column
          prop="name"
          label="姓名"
          width="180">
      </el-table-column>
      <el-table-column
          prop="address"
          label="地址">
      </el-table-column>
    </el-table>
  <div class="win">
    <!-- 四个角的边框效果 -->
    <div class="border_corner border_corner_left_top"></div>
    <div class="border_corner border_corner_right_top"></div>
    <div class="border_corner border_corner_left_bottom"></div>
    <div class="border_corner border_corner_right_bottom"></div>
    <div class="main">
      <div class="main-table">
        <el-table :data="listData" style="width: 100%" stripe='stripe'
                  tooltip-effect="dark" :row-class-name="tableRowClassName">
          <el-table-column v-for="(item, index) in listLabel" :key="index" :prop="item.prop"
                           :label="item.label"></el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'PublicTable',
  props: ['displayContentTable'],
  data () {
    return {
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
      listData: [],
      listLabel: [
        {
          label: '序号',
          prop: 'StoragePlaceId'
        },
        {
          label: '类别',
          prop: 'StoragePlaceTypeName'
        },
        {
          label: '固废名称',
          prop: 'StoragePlaceName'
        },
        {
          label: '代码',
          prop: 'StorageZDMJ'
        },
        {
          label: '产生量(t)',
          prop: 'StorageZCL'
        },
        {
          label: '贮存量(t)',
          prop: 'StorageZCNL'
        },
        {
          label: '产生装置',
          prop: 'StorageType'
        }
      ]
    }
  },
  mounted () {
    this.$nextTick(() => {
      this.displayContentTable.forEach(item => {
        this.listData = item
      })
    })
  },
  methods: {
    tableRowClassName ({
      row,
      rowIndex
    }) {
      if (rowIndex % 2 === 0) {
        return 'warning-row'
      } else if (rowIndex % 2 === 1) {
        return 'success-row'
      }
      return ''
    }
  }
}
@@ -50,4 +81,53 @@
<style lang="less" scoped>
.win {
  position: relative;
  background-color: rgba(33, 41, 69, 0.9);
  //width: 6rem;
  height: 1.5rem;
}
.main {
  .main-table {
    width: 100%;
  }
}
.border_corner {
  z-index: 999;
  position: absolute;
  width: 14px;
  height: 14px;
  background: rgba(0, 0, 0, 0);
  border: 1px solid #47d5ea;
}
.border_corner_left_top {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}
.border_corner_right_top {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}
.border_corner_left_bottom {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}
.border_corner_right_bottom {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}
</style>