<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="订单号" name="orderNum">
                                <a-input v-model:value="searchFormData.orderNum" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item label="子账号" name="proName">
                                <a-input v-model:value="searchFormData.proName"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item label="账单时间" name="time">
                                <a-range-picker 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: '流水号', 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' },
])
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>