<template>
  <div>
    <div class="tableDistance">
      <el-table
        :data="tableData"
        :border="true"
        style="width: 100%"
        v-loading="loading"
      >
        <el-table-column prop="year" label="年度">
          <!-- <template slot-scope="scope"> -->
          <!-- <span>{{ parseTime(scope.row.begainTime, "{y}-{m}-{d}") }}</span> -->
          <!-- </template> -->
        </el-table-column>
        <el-table-column prop="assignCount" label="调派次数">
          <!-- <template slot-scope="scope"> -->
          <!-- <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span> -->
          <!-- </template> -->
        </el-table-column>
        <el-table-column prop="acceptAssignCount" label="接受调派次数">
        </el-table-column>
        <el-table-column prop="unacceptAssignCount" label="未接受调派次数">
        </el-table-column>
      </el-table>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.current"
        :limit.sync="queryParams.size"
        @pagination="getList"
      />
    </div>
  </div>
</template>
<script>
import { getList } from "@/api/deployMsg";
export default {
  props: {
    //检查员id
    inspectorId: {
      type: Number,
    },
  },
  data() {
    return {
      loading: false,
      tableData: [],
      // 总条数
      total: 0,
      queryParams: {
        inspectorId: undefined,
        current: 1,
        size: 10,
      },
    };
  },
  created() {
    this.queryParams.inspectorId = this.inspectorId;
    this.getList();
  },
  methods: {
    getList() {
      this.loading = true;
      getList(this.queryParams).then((res) => {
        this.tableData = res.result.records;
        this.total = res.result.total;
        this.loading = false;
      });
    },
  },
};
</script>
<style lang="scss" scoped></style>
