import React, { useRef } from 'react'; import Table, { ProColumns, ActionType } from '@/components/Table'; import { getWithdrawList, solveWithdraw } from '@/services/withdraw'; import { fetchTableData } from '@/utils/table'; import { getBalanceAmount } from '@/utils/formatBalance'; import BigNumber from 'bignumber.js'; import ConfirmButton from '@/components/Table/ConfirmButton'; const WithdrawList = () => { const handleConfirm = async (uuid) => { await solveWithdraw({ uuid: uuid }); }; const tableRef = useRef(); const columns: ProColumns[] = [ { title: '提现订单号', dataIndex: 'uuid', ellipsis: true, }, { title: '金额', dataIndex: 'price', width: '10%', hideInSearch: true, }, { title: '位数', dataIndex: 'decimals', width: '10%', hideInSearch: true, }, { title: '发送地址', dataIndex: 'form_address', hideInSearch: true, ellipsis: true, }, { title: '接受地址', dataIndex: 'to_address', hideInSearch: true, ellipsis: true, }, { title: '游戏币类型', dataIndex: 'bc_type', width: '10%', }, { title: '时间', dataIndex: 'time', valueType: 'dateRange', ellipsis: true, }, { title: '操作', valueType: 'option', width: 150, render: (_, row) => [ { handleConfirm(row.uuid); }} />, ], }, ]; return (
{ console.log('params = ', params); const res = await fetchTableData(getWithdrawList, params); for (const key in res.data) { if (Object.prototype.hasOwnProperty.call(res.data, key)) { const element = res.data[key]; element.price = getBalanceAmount( new BigNumber(element.price), element.decimals, ).toNumber(); } } return res; }} /> ); }; export default WithdrawList;