  <template>
  <div class="table-wrapper">
    <span class="title">运行操作</span>
    <el-table
      :data="tableData"
      style="width: 100%"
      max-height="160"
    >
      <el-table-column
        prop="name"
        label="水泵本体设备"
        width="180"
      >
      </el-table-column>
      <el-table-column
        prop="problem"
        label="启停"
        width="180"
      >
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          name: "1#水泵",
          problem: "关闭",
        },
        {
          name: "1#水泵",
          problem: "开启",
        },
      ],
    };
  },
    mounted() {
    let interval = setInterval(() => {
      let temp = {
        name: Math.random() > 0.5 ? "1#水泵" : "2#水泵",
        problem:
          Math.random() > 0.5 ? "开启" : "关闭",
      };
      this.tableData.unshift(temp);
      console.log(this.tableData);
    }, 3000);
    this.$once("hook:beforeDestroy", () => {
      clearInterval(interval);
    });
  },
};
</script>
<style lang='scss' scoped>
.table-wrapper {
  padding-top: 20px;
  margin-left: 110px;
  height: 80%;
  margin-top: 10px;
  ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td {
    background-color: rgba(9, 12, 14, 0.2);
    color: #fff;
  }
} /* 删除表格下横线 */
.table-wrapper ::v-deep .el-table::before {
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0px;
  border: none;
}
.table-wrapper ::v-deep .el-table,
.el-table__expanded-cell {
  background-color: transparent;
  border: none;
}
.table-wrapper ::v-deep .el-table tr {
  background-color: transparent !important;
  border: none;
}
.table-wrapper ::v-deep .el-table th {
  background-color: transparent !important;
  border: none;
  color: #4adefe;
  font-size: 16px;
}
.table-wrapper ::v-deep .el-table td,
.el-table th.is-leaf {
  background-color: transparent !important;
  color: #f3db5c;
  font-size: 15px;
  border: none;
}
.table-wrapper ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.title {
  /* font-weight:; */
  /* padding-bottom: 15px; */
  font-size: 18px;
  color: #4adefe;
}
</style>
