<template>
  <div class="flex h-full w-full flex-col">
    <Search></Search>
    <div
      class="main flex w-full flex-1 items-center justify-center rounded-[4px] bg-white p-[20px]"
    >
      <div class="h-full w-full" v-if="tableData.length">
        <TableHeader>
          <el-button size="small" slot="left" type="primary">导出</el-button>
        </TableHeader>
        <y-table
          ref="MyTable"
          :loading="loading"
          :data="tableData"
          :column="column"
          border
          tooltip-effect="dark"
          :max-height="600"
          :row-key="(row) => row.id"
          @selection-change="handleSelectionChange"
        ></y-table>
        <Pagination
          :total="total"
          :current.sync="current"
          :size.sync="size"
          @get="getData"
        ></Pagination>
      </div>
      <el-empty
        v-else
        description="请检索数据"
        :image="require('@/assets/img/empty.png')"
      ></el-empty>
    </div>
  </div>
</template>

<script>
import Search from "./components/Search.vue";
import TableHeader from "@/components/TableHeader.vue";
export default {
  components: {
    Search,
    TableHeader,
  },
  data() {
    return {
      loading: false,
      size: 10,
      total: 0,
      current: 1,
      tableData: [],
      column: [],
      selectionRows: [],
    };
  },
  methods: {
    getData() {},
    handleSelectionChange(rows) {
      this.selectionRows = rows;
    },
  },
};
</script>

<style lang="less" scoped></style>
