<template>
  <el-card class="box">
    <content-box :loading="loading" :tableData="tableData" :pagination="pagination" 
      @currentChange="handleCurrentChange" @sizeChange="handleSizeChange"/>
  </el-card>
</template>
<script>
import contentBox from "./components/content";
import { getTable } from "@/api/archives-management/archivalAppraisal.js";
export default {
  data() {
    return {
      loading: false,
      tableData: [],
      pagination: {
        pageSize: 10,
        pageNum: 1,
        total: 0,
      },
    };
  },
  components: {
    contentBox
  },
  methods: {
    getData() {
      this.loading = true;
      const params = {
        page: this.pagination.pageNum,
        limit: this.pagination.pageSize,
        logType: 'security_class',
      };
      getTable(params).then(res=>{
        this.loading = false;
        if(res.code === '100'){
          this.tableData = res.body.list
          this.pagination.total = res.body.total
        }
      }).catch(()=>{
        this.loading = false;
      })
    },
    handleCurrentChange(val){
       this.pagination.pageNum = val;
       this.getData()
    },
    handleSizeChange(val){
      this.pagination.pageSize = val;
      this.pagination.pageNum = 1;
      this.getData();
    }
  },
  created() {
    this.getData();
  }
};
</script>
<style lang="scss" scoped>
.box {
  background: #f6f8fc;
  height: 1000px;
}
</style>
