<template>
  <div>
    <el-table v-loading='loading' :data='tableData' border tooltip-effect="dark">
      <el-table-column width="350" show-overflow-tooltip align="center" prop="labelId" label="档案盒编号"></el-table-column>
      <el-table-column prop="boxName" width="150" align="center" show-overflow-tooltip label="档案盒类型"></el-table-column>
      <el-table-column show-overflow-tooltip align="center" prop="" label="状态">
        <template slot-scope="scope">
          <el-tag effect="dark" v-if="scope.row.state === 0" type="danger" size="mini">未入库</el-tag>
          <el-tag effect="dark" v-if="scope.row.state === 1" type="success" size="mini">已入库</el-tag>
        </template>
      </el-table-column>
      <el-table-column show-overflow-tooltip align="center" prop="storageTime" label="入库时间"></el-table-column>
      <el-table-column show-overflow-tooltip align="center" prop="boxPosition" label="位置"></el-table-column>
      <el-table-column show-overflow-tooltip align="center" prop="archiveNum" label="档案数量">
        <template slot-scope="scope">
          <el-tag effect="dark" type="primary" size="mini">{{scope.row.archiveNum ? scope.row.archiveNum : 0}}</el-tag>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination @current-change="handleCurrentChange" @size-change="handleSizeChange"
      layout="total, prev, pager, next, sizes" :page-size="pagination.pageSize" :page-sizes="[10, 20, 30, 50]"
      :current-page="pagination.pageNum" :total="pagination.total">
    </el-pagination>
  </div>
</template>
<script>
  export default {
    props: {
      loading: {
        type: Boolean,
        default: () => false,
      },
      tableData: {
        type: Array,
        default: () => [],
      },
      pagination: {
        type: Object,
        default: () => {},
      },
    },
    data() {
      return {

      }
    },
    methods: {
      handleCurrentChange(val) {
        this.pagination.pageNum = val;
        this.$emit("refreshTable");
      },
      handleSizeChange(val) {
        this.pagination.pageSize = val;
        this.pagination.pageNum = 1;
        this.$emit("refreshTable");
      },
    }
  }

</script>
<style lang='scss' scoped>

</style>
