<template>
  <div class="fullHeight">
    <div class="searchBox whiteBlock">
        <el-input
            v-model="queryStr"
            :placeholder="$t('message.personnelPosition.please_enter')"
            :clearable = "true"
            @change="inptValue"
          ></el-input>
          <el-button
            type="primary"
            plain
            @click="getPointList"
          >{{$t('message.personnelPosition.beaconManage.query')}}</el-button>
          <el-button
            type="warning"
            plain
            @click="toRefresh"
          >{{$t('message.personnelPosition.beaconManage.refresh')}}</el-button>
    </div>
    <div class="table_wrap whiteBlock">
      <el-table class="tables" :data="tableData">
        <el-table-column prop="checkingPointName" label="巡检点" align="center"></el-table-column>
        <el-table-column prop="position" label="巡检位置" align="center"></el-table-column>
        <el-table-column prop="checkingPointUserName" label="巡检人" align="center"></el-table-column>
        <el-table-column prop="createDate" label="巡检时间" align="center"></el-table-column>
      </el-table>
      <el-pagination
        class="pagerBox"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pageNo"
        :page-sizes="$store.state.PAGESIZRS"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next"
        :total="Number(total)"
        background
      ></el-pagination>
    </div>
  </div>
</template>

<script>
import {
getCheckPointApi
} from "@/assets/js/api/insect.js";
export default {
  data() {
    return {
      queryStr: '',
      tableData: [],
      total: 0,
      pageNo: 1,
      pageSize: 10
    };
  },
  mounted(){
    this.getPointList()
  },
  methods: {
    //查看条数
    handleSizeChange(val) {
      this.pageSize = val;
      this.getPointList();
    },
    //查看页
    handleCurrentChange(val) {
      this.pageNo = val;
      this.getPointList();
    },
    inptValue(val){
        console.log('输入的内容',val)
    },
    // 查询
    getPointList() {
      let data = new FormData();//new出来的对象
      data.append("queryStr",this.queryStr);
      data.append("projectSn",this.$store.state.projectSn);
      data.append("pageNo",this.pageNo);
      data.append("pageSize",this.pageSize);
        getCheckPointApi(data).then((res)=>{
            console.log('res111111111',res)
            this.tableData = res.result.records
            this.total = Number(res.result.total)
        })
    },
    // 刷新
    toRefresh() {
        this.queryStr = ''
        this.getPointList()
    }
  }
};
</script>

<style lang="less" scoped>
::v-deep .el-input {
    width:400px;
    margin-right: 15px;
}
</style>