import React, { FC, useRef } from "react";
import clientApi from "@/package/SimpleTrade/api/client";
import MyTable from "@/components/MyTable";
import { Button, Input, notification, Popconfirm } from "antd";
import { CopyOutlined } from "@ant-design/icons";
import { copy, getTime, splitAddress } from "@/utils";
import { Withdraw_Check } from "@/package/SimpleTrade/types/enum";
const WithdrawRecord: FC = () => {
const tableRefs = useRef(null)
const columns = [
{
title: '账号ID',
dataIndex: 'a_mt4_login'
},
{
title: '交易ID',
dataIndex: 'tx_hash',
render: (tx_hash) => (
{splitAddress(tx_hash, 5)}
copy(tx_hash)}>
)
},
{
title: '链ID',
dataIndex: 'chain_id'
},
{
title: '提币地址',
dataIndex: 'to_address',
render: (to_address) => (
{splitAddress(to_address, 5)}
copy(to_address)}>
)
},
{
title: '数量',
dataIndex: 'amount'
},
{
title: '币种',
dataIndex: 'symbol'
},
{
title: '提现状态',
dataIndex: 'status'
},
{
title: '处理时间',
dataIndex: 'handle_time',
render: (time) => (
{getTime(time * 1000)}
)
},
{
title: '操作',
dataIndex: 'operations',
align: 'center',
key: Date.now(),
render: (_, item) => {
return item.check_status === 1 ? (
handleOrder(item, Withdraw_Check.WithdrawCheckReject)}
>
handleOrder(item, Withdraw_Check.WithdrawCheckAgree)}
>
) : (<>>)
}
}
]
// 搜索栏配置项
const searchConfigList = [
{
key: 'name',
slot: ,
initialValue: ''
}
]
const handleOrder = async (item, type: Withdraw_Check) => {
const res: any = await clientApi.withdraw_check({
id: item.id,
status: type
})
if (res.code === 0) {
notification.success({
message: type === Withdraw_Check.WithdrawCheckAgree ? '已同意' : '已拒绝'
})
tableRefs.current?.update()
}
}
return (
)
};
export default WithdrawRecord;