<template>
  <div class="page">
    <content-box :pagination='pagination' :tableData='tableData' :loading='loading' @refreshTable='getData' />
  </div>
</template>
<script>
  import contentBox from "./components/content";
  import {
    mapState
  } from "vuex";
  import {
    message,
    clearObjValue
  } from "@/utils/common";
  export default {
    data() {
      return {
        search: {},
        params: {}
      }
    },
    components: {
      contentBox
    },
    computed: {
      ...mapState({
        tableData: (state) => state.entityArchivesBorrowing.tableData,
        pagination: (state) => state.entityArchivesBorrowing.pagination,
        // themeClass: (state) => state.allAdministration.themeClass,
        // ruleForm: (state) => state.allAdministration.ruleForm,
      }),
      loading: {
        get() {
          return this.$store.state.entityArchivesBorrowing.loading;
        },
        set(val) {
          this.$store.state.entityArchivesBorrowing.loading = val;
        },
      },
    },
    methods: {
      getData() {
        this.loading = true
        this.params = {
          page: this.pagination.pageNum,
          limit: this.pagination.pageSize,
        }
        this.$store.dispatch('entityArchivesBorrowing/getData', this.params).catch(err => {
          this.loading = false
        })
      }
    },
    created() {
      this.getData()
    }
  }

</script>

<style lang="scss" scoped>
  .page {

    padding: 10px;



  }

</style>
