<template>
  <div class="evEnergyTable">
    <el-table :data="samples" style="width: 100%;" height="350">
      <el-table-column prop label="序号" align="left" type="index" width="150"></el-table-column>
      <el-table-column prop="date" label="日期" align="left">
        <template slot-scope="{row}">{{formatter(row.date)}}</template>
      </el-table-column>
      <el-table-column prop="outsiteTemp" label="室外平均温度(℃)" align="right">
        <template slot-scope="{row}">{{row.outsiteTemp.toFixed(1)}}</template>
      </el-table-column>
      <el-table-column prop="indoorTemp" label="室内平均温度(℃)" align="right">
        <template slot-scope="{row}">{{row.indoorTemp.toFixed(1)}}</template>
      </el-table-column>
      <el-table-column prop="energy" label="冷站能耗(kWh)" align="right">
        <template slot-scope="{row}">{{row.energy.toFixed(0)}}</template>
      </el-table-column>
      <el-table-column prop="e" label align="right"></el-table-column>
    </el-table>
  </div>
</template>
<script>
var moment = require("moment");
import "moment/locale/zh-cn";
export default {
  props: ["samples"],
  data() {
    return {};
  },
  methods: {
    formatter(date) {
      return moment.unix(date / 1000).format("YYYY.MM.DD");
    }
  },
  mounted() {}
};
</script>
<style lang="scss">
.evEnergyTable {
  .el-table thead {
    background: rgba(248, 249, 250, 1);
  }
}
</style>