<template>
  <div class="thermometerTab">
    <el-table v-loading="loading" :data="childrenDataList">
      <el-table-column label="所属设备名称" align="center" prop="beyondDevicename"/>
      <el-table-column label="设备名称" align="center" prop="detectorName"/>
      <el-table-column label="设备编号" align="center" prop="number"/>
<!--      <el-table-column label="所属企业" align="center" prop="beyondEnterpriseName"/>-->
      <el-table-column label="温度(℃)" align="center" prop="value" />
      <el-table-column label="上报时间" align="center" prop="time"/>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>

</template>

<script>
  import { redisList, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";

export default {
  props:{
    childrenQueryParams: {}
  },
  name: "ThermometerData",
  components: {
  },
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 10
      },
      loading: true,
      childrenDataList: [],
      total: 0

    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      this.loading = true;
      /*this.childrenQueryParams.pageNum = this.queryParams.pageNum;
      this.childrenQueryParams.pageSize =  this.queryParams.pageSize;
      this.childrenQueryParams.deviceType = '4';*/
      this.queryParams.deviceType = '4';
      this.queryParams.iotNo = this.childrenQueryParams.deviceNum;
      this.queryParams.deviceName = this.childrenQueryParams.deviceName;
      redisList(this.queryParams).then(response => {
          this.childrenDataList = response.rows;
          this.total = response.total;
          this.loading = false;
      });
    },
    thermometerQuery(){
      this.queryParams.pageNum = 1;
      this.getList();
    }

  }
};
</script>
<style>
  .thermometerTab{
    margin-bottom: 20px;
  }
</style>
