<template>
  <div class="main">
    <!-- <el-card style="margin-bottom: 5px">
      <t-search :search="search" @searchClick="searchClick" />
    </el-card> -->
    <el-card :body-style="{ padding: '5px 10px' }">
      <t-table :tableData="tableData" :tableLoading="tableLoading" @handleSelectionChange="handleSelectionChange" />
      <!-- <el-pagination @current-change="handleCurrentChange" @size-change="handleSizeChange"
        layout="total, prev, pager, next, sizes" :page-size="pagination.pageSize" :page-sizes="[10, 50, 100, 500,1000]"
        :current-page="pagination.pageNum" :total="pagination.total">
      </el-pagination> -->
    </el-card>
  </div>
</template>
<script>
import {getDiskCapacity} from "@/api/system-management/medium.js"
import tSearch from "./components/search";
import tTable from "./components/table";
import { mixin } from "@/mixins/common";
import { mapState, mapGetters, mapActions } from "vuex";
import { clearObjValue, dateFormatT, message } from "@/utils/common";
export default {
  mixins: [mixin],
  data() {
    return {
      search: {
        operatorChn: "",
        time: "",
      },
      tableData: [],
      pagination: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      tableLoading: false,
    };
  },
  components: {
    tSearch,
    tTable,
  },
  computed: {
    ...mapState({
      // tableData: (state) => state.operatorNote.tableData,
      // page: (state) => state.operatorNote.page,
    }),
  },
  methods: {
    getData() {
      this.tableLoading = true;
      getDiskCapacity().then((res) => {
          this.tableData = res.body.list;
        })
        .finally((res) => {
          this.tableLoading = false;
        });
    },
    searchClick(val) {
      switch (val) {
        case 1:
          this.getData();
          break;
        case 2:
          clearObjValue(this.search);
          break;
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleCurrentChange(val) {
      this.pagination.pageNum = val;
      this.getData();
    },
    handleSizeChange(val) {
      this.pagination.pageSize = val;
      this.getData();
    },
  },
  created() {
    this.getData();
  },
};
</script>
<style lang="scss" scoped>
.main {
  // padding: 10px;
}
</style>
