<template>
  <div>
    <el-table v-loading='tableLoading' :data="tableData" border tooltip-effect="dark" size="mini">
      <el-table-column prop="createdBy" align="center" width="90" show-overflow-tooltip label="记录人"></el-table-column>
      <el-table-column prop="gathertime" align="center" show-overflow-tooltip label="采集时间"></el-table-column>
      <el-table-column prop="gatherwen" align="center" show-overflow-tooltip label="采集点温度℃"></el-table-column>
      <el-table-column prop="gathershi" align="center" show-overflow-tooltip label="采集点湿度RH"></el-table-column>
      <el-table-column prop="outwen" align="center" show-overflow-tooltip label="室外温度℃"></el-table-column>
      <el-table-column prop="outshi" align="center" show-overflow-tooltip label="室外湿度RH"></el-table-column>
      <el-table-column prop="createTime" align="center" show-overflow-tooltip label="录入日期"></el-table-column>
      <el-table-column prop="remarks" align="center" show-overflow-tooltip label="备注"></el-table-column>
      <el-table-column align="center" label="操作">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="del(scope.row)" style="color:#FF4949">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination @current-change="handleCurrentChange" @size-change="handleSizeChange"
      layout="total, prev, pager, next, sizes" :page-size="pagination.pageSize" :page-sizes="[10, 20, 30, 50]"
      :current-page="pagination.pageNum" :total="pagination.total">
    </el-pagination>
  </div>
</template>
<script>
  export default {
    props: {
      tableData: {
        type: Array,
        default: () => [],
      },
      pagination: {
        type: Object,
        default: () => {},
      },
      tableLoading: {
        type: Boolean,
        default: () => false,
      },
    },
    data() {
      return {}
    },
    methods: {
      del(row) {},
      handleCurrentChange(val) {
        this.pagination.pageNum = val;
        this.$emit("refreshTable");
      },
      handleSizeChange(val) {
        this.pagination.pageSize = val;
        this.pagination.pageNum = 1;
        this.$emit("refreshTable");
      },
    }
  }

</script>
