<template>
  <!-- 分页组件 -->
  <el-pagination
    :background="true"
    :current-page="pageable.current"
    :page-size="pageable.size"
    :page-sizes="[10, 50, 100, 200, 500, 1000]"
    :total="pageable.total"
    :size="globalStore?.assemblySize ?? 'default'"
    layout="total, sizes, prev, pager, next, jumper"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  />
</template>

<script setup name="Pagination">
  import { useGlobalStore } from '@/stores/modules/global';
  const globalStore = useGlobalStore();

  defineProps({
    pageable: {
      type: Object,
      required: true,
    },
    handleSizeChange: {
      type: Function,
      required: true,
    },
    handleCurrentChange: {
      type: Function,
      required: true,
    },
  });
</script>
