import ProgressTable from "@/components/ProgressTable"
import WidthEllipsis from "@/components/widthEllipsis"
import { Statistic } from "antd"
import React from "react"

function columns12() {

    let newArr: { label: string, data: any[] }[] = [
        {
            label: '玩家充值排行榜',
            data: [
                { title: '玩家ID', dataIndex: 'playerId', label: '玩家充值排行榜', align: 'center', width: 70 },
                { title: '玩家账号', dataIndex: 'playerAccountId', label: '玩家充值排行榜', align: 'center', width: 120, default: 1, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
                { title: '注册渠道', dataIndex: 'regAgentName', label: '玩家充值排行榜', align: 'center', width: 80, default: 2, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
                { title: '注册渠道ID', dataIndex: 'regAgentId', label: '玩家充值排行榜', align: 'center', width: 80 },
                { title: '注册时间', dataIndex: 'regUserTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 3, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
                { title: '注册游戏', dataIndex: 'regGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 4, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
                { title: '玩家操作系统', dataIndex: 'playerOs', label: '玩家充值排行榜', align: 'center', width: 70, default: 5 },
                {
                    title: '当天充值金额', dataIndex: 'todayTotalAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 6, sorter: true, 
                    className: 'progress',
                    render: (a: number) => {
                        return <ProgressTable
                            strokeColor={{
                                from: '#108ee9',
                                to: '#87d068',
                            }}
                            percent={a ? a / 2000 * 100 : 0}
                            value={a || 0}
                            valueStyle={a >= 1000 ? { color: '#000', fontWeight: 500 } : { fontWeight: 500 }}
                        />
                    },
                },
                { title: '首充金额', dataIndex: 'firstAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 7, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
                { title: '最近充值金额', dataIndex: 'lastAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 8, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
                {
                    title: '累计充值金额', dataIndex: 'totalAmount', label: '玩家充值排行榜', align: 'center', width: 100, default: 9, sorter: true, className: 'progress',
                    render: (a: number) => {
                        return <ProgressTable
                            strokeColor={{
                                from: '#ff5900',
                                to: '#ffd380',
                            }}
                            percent={a ? a / 10000 * 100 : 0}
                            value={a || 0}
                            valueStyle={a >= 5000 ? { color: '#000', fontWeight: 500 } : { fontWeight: 500 }}
                        />
                    },
                },
                { title: '平均单价', dataIndex: 'avgAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 10, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
                { title: '累计充值次数', dataIndex: 'totalAmountCount', label: '玩家充值排行榜', align: 'center', width: 70, default: 11, sorter: true },
                // { title: '玩家等级标签', dataIndex: '13', label: '玩家充值排行榜', align: 'center', width: 70, default: 14 },
                { title: '最近充值游戏', dataIndex: 'lastAmountGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 12, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
                { title: '最近充值时间', dataIndex: 'lastAmountTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 13, render: (a: string, b: any) => (<WidthEllipsis value={a} />) }
            ]
        },
    ]

    return newArr
}

export default columns12