<template>
    <a-row :gutter="[24, 18]">
        <a-col :span="24">
   
                <a-form :model="searchFormData" labelAlign="left" class="x-search-bar">
                    <a-row :gutter="24">
                        <a-col :span="6">
                            <a-form-item label="合同ID" name="time">
                                <a-input v-model:value="searchFormData.time" />
                            </a-form-item>
                        </a-col>
                        <a-col class="align-left" :span="6">
                            <a-space>
                                <a-button @click="handleResetSearch">重置</a-button>
                                <a-button ghost type="primary" @click="handleSearch">
                                    查询
                                </a-button>
                            </a-space>
                        </a-col>
                    </a-row>
                </a-form>
    
        </a-col>
        <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' },
])
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>