<template>
    <a-row :gutter="[24, 18]">
        <a-col :span="24">
                <a-table :dataSource="listData" :columns="columns" bordered :pagination="paginationState"  @change="onTableChange"/>
        </a-col>
    </a-row>


</template>
<script setup>
import { ref,onBeforeMount } from 'vue'
import { usePagination } from '@/hooks'
// const listData=ref([ {title:1}])
// const paginationState=ref({
//             total: 0,
//         current: 1,
//         pageSize: 10,
//         showTotal: (total) => `总 ${total} 条数据`,
//         pageSizeOptions: ['10', '20', '30', '40'],
// })
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const columns = ref([
    { title: '名称', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '类型', dataIndex: 'transactionTime', key: 'transactionTime' },
    { title: '规则', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '最高抵扣', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '面额', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '折扣', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '生效时间/失效时间', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '状态', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '适用产品', dataIndex: 'flowNum', key: 'flowNum' },
    { title: '适用范围', dataIndex: 'flowNum', key: 'flowNum' },
])
onBeforeMount(()=>{
getPageList()

})
const getPageList=()=>{
    listData.value=[
        {flowNum:1}
    ]
}
/**
 * 分页
 */
function onTableChange({ current, pageSize }) {
    paginationState.current = current
    paginationState.pageSize = pageSize
    getPageList()
}
/**
 * 搜索
 */
function handleSearch() {
    resetPagination()
    getPageList()
}
/**
 * 重置
 */
function handleResetSearch() {
    searchFormData.value = {}
    resetPagination()
    getPageList()
}
</script>