import { useAjax } from "@/Hook/useAjax" import { GameRechargeListProps, getGameRechargeCountApi, getGameRechargeListApi } from "@/services/gameData/stream" import React, { useEffect, useState } from "react" import TableData from "../../components/TableData" import QueryForm from "@/components/QueryForm" import columns12 from "./tableConfig" import { getPresets } from "@/components/QueryForm/const" import moment from "moment" import { Statistic, Table } from "antd" /** * 充值历史 * @returns */ const Recharge: React.FC = () => { /********************************/ const [queryForm, setQueryForm] = useState({ pageNum: 1, pageSize: 50, sourceSystem: 'ZX_ONE', costBeginDate: moment().format('YYYY-MM-DD'), costEndDate: moment().format('YYYY-MM-DD') }) const [totalData, setTotalData] = useState({}) const getGameRechargeList = useAjax((params) => getGameRechargeListApi(params)) const getGameRechargeCount = useAjax((params) => getGameRechargeCountApi(params)) /********************************/ useEffect(() => { getGameRechargeCount.run(queryForm).then((res) => { setTotalData(res) }) getGameRechargeList.run(queryForm) }, [queryForm]) return
{ const { costBeginDay, costEndDay, beginOrderTime, endOrderTime, ...params } = data let newQueryForm = JSON.parse(JSON.stringify(queryForm)) if (costBeginDay && costEndDay) { newQueryForm.costBeginDate = costBeginDay newQueryForm.costEndDate = costEndDay } else { delete newQueryForm.costBeginDate delete newQueryForm.costEndDate } if (beginOrderTime && endOrderTime) { newQueryForm.orderBeginDate = beginOrderTime newQueryForm.orderEndDate = endOrderTime } else { delete newQueryForm.orderBeginDate delete newQueryForm.orderEndDate } newQueryForm.pageNum = 1 setQueryForm({ ...newQueryForm, ...params }) }} isSource isGameIds isGameDimension isSysUserIds isAgentId isAccountId isAccountIds isConsumeDay={{ ranges: getPresets() }} isCreateDay={{}} />} isVirtually={false} scroll={{ x: 1000, y: 600 }} ajax={getGameRechargeList} fixed={{ left: 0, right: 0 }} dataSource={getGameRechargeList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + index.toString()) }))} total={getGameRechargeList?.data?.total} page={queryForm.pageNum} pageSize={queryForm.pageSize} title='充值历史' onChange={(props: any) => { let { pagination, sortData } = props let { current, pageSize } = pagination let newQueryForm = JSON.parse(JSON.stringify(queryForm)) if (sortData && sortData?.order) { newQueryForm['sortType'] = sortData?.order === 'ascend' ? 'asc' : 'desc' newQueryForm['sortFiled'] = sortData?.field } else { delete newQueryForm['sortType'] delete newQueryForm['sortFiled'] } newQueryForm.pageNum = current newQueryForm.pageSize = pageSize setQueryForm({ ...newQueryForm }) }} config={columns12()} configName={'充值历史'} summary={() => { return
总计
消耗
充值
回收率
}} />
} export default Recharge