<template>
  <div class="equipmentAnalyze box">
    <tit :title="'设备日均负载分析'">
      <div class="tit-r">选择月份：
        <el-date-picker size="mini" v-model="value2" type="month" placeholder="选择月" style="width: 1.2rem;">
        </el-date-picker>
      </div>
    </tit>
    <el-table :data="tableData" style="width: 100%;" height="92%" :stripe="true" :size="mini"
      :row-class-name="tableRowClassName">
      <el-table-column prop="name" label="设备名称">
        <template slot-scope="scope">
          <span style="color: #fff">{{ scope.row.name }}%</span>
        </template>
      </el-table-column>
      <el-table-column prop="address" label="空载">
        <template slot-scope="scope">
          <span :style="{ color: scope.row.address > 0 ? '#10EFBD' : 'rgba($color: #fff, $alpha: 0.2)' }">{{
            scope.row.address }}%</span>
        </template>
      </el-table-column>
      <el-table-column prop="address" label="轻载">
        <template slot-scope="scope">
          <span :style="{ color: scope.row.address > 0 ? '#00A2FF' : 'rgba($color: #fff, $alpha: 0.2)' }">{{
            scope.row.address }}%</span>
        </template>
      </el-table-column>
      <el-table-column prop="date" label="正常">
        <template slot-scope="scope">
          <span :style="{ color: scope.row.address > 0 ? '#fff' : 'rgba($color: #fff, $alpha: 0.2)' }">{{
            scope.row.address
          }}%</span>
        </template>
      </el-table-column>
      <el-table-column prop="address" label="过载">
        <template slot-scope="scope">
          <span :style="{ color: scope.row.address > 0 ? '#FBA62D' : 'rgba($color: #fff, $alpha: 0.2)' }">{{
            scope.row.address }}%</span>
        </template>
      </el-table-column>
      <el-table-column prop="address" label="重载">
        <template slot-scope="scope">
          <span :style="{ color: scope.row.address > 0 ? '#FB5E2D' : 'rgba($color: #fff, $alpha: 0.2)' }">{{
            scope.row.address }}%</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import tit from "./tit.vue";
export default {
  data() {
    return {
      value2: "",
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: 29,
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: 0,
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: 29,
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: 29,
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: 29,
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: 29,
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: 29,
      }]
    };
  },
  components: {
    tit
  },
  created() {

  },
  methods: {
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 === 0) {

        return 'trEven';
      } else {
        return '';
      }
    }
  },
};
</script>
<style></style>
<style lang="scss" scoped>
.equipmentAnalyze /deep/ .el-table,
.equipmentAnalyze /deep/ .el-table__expanded-cell {
  background-color: transparent;
  border: 0 !important;
}

.equipmentAnalyze /deep/ .el-table th,
.equipmentAnalyze /deep/ .el-table tr,
.equipmentAnalyze /deep/ .el-table td {
  background-color: transparent !important;
  border: 0 !important;
}
.equipmentAnalyze /deep/ .el-table td span{
  font-size: 0.14rem !important;
}

.equipmentAnalyze /deep/ .el-table::before {
  height: 0 !important;
}

.equipmentAnalyze /deep/ .trEven td {
  background: rgba($color: #0de5ff, $alpha: 0.1) !important;
}

.equipmentAnalyze /deep/ .el-input__inner {
  background: transparent !important;
  color: #fff !important;
  border-radius: 0;
  border-color: rgba($color: #fff, $alpha: 0.2) !important;
  height: 0.24rem !important;
}

.equipmentAnalyze /deep/ .el-input__icon{
  line-height: 0.24rem !important;  
}

.box {
  width: 6.78rem;
  height: 3.7rem;
  box-sizing: border-box;
  background: url("../../../../public/img/energySources/equipmentAnalyze.png");
  background-size: 100% 100%;
  padding: 0.54rem 0.22rem 0 0.22rem;
  position: relative;

  .tit-r {
    font-size: 0.14rem;
    color: #0096FF;
    margin-top: 0.04rem;
  }

}
</style>
