<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: '合同ID/名称', 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' },
    { 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>