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: 'agentId', label: '推广渠道充值排行榜', align: 'center', width: 60,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '推广渠道名称', dataIndex: 'agentName', label: '推广渠道充值排行榜', align: 'center', width: 150, default: 1,
                    render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                },
                {
                    title: '投手', dataIndex: 'pitcher', label: '推广渠道充值排行榜', align: 'center', width: 70, default: 2,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '推广媒体', dataIndex: 'type', label: '推广渠道充值排行榜', align: 'center', width: 70, default: 3,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '当天充值金额', dataIndex: 'todayAmount', label: '推广渠道充值排行榜', align: 'center', width: 100, default: 4, sorter: true,
                    className: 'progress',
                    render: (a: number) => {
                        return <ProgressTable
                            strokeColor={{
                                from: '#108ee9',
                                to: '#87d068',
                            }}
                            percent={a ? a / 10000 * 100 : 0}
                            value={a || 0}
                            valueStyle={a >= 7000 ? { color: '#000', fontWeight: 500 } : { fontWeight: 500 }}
                        />
                    },
                },
                {
                    title: '累计充值金额', dataIndex: 'totalRechargeAmount', label: '推广渠道充值排行榜', align: 'center', width: 100, default: 5, sorter: true,
                    className: 'progress',
                    render: (a: number) => {
                        return <ProgressTable
                            strokeColor={{
                                from: '#ff5900',
                                to: '#ffd380',
                            }}
                            percent={a ? a / 200000 * 100 : 0}
                            value={a || 0}
                            valueStyle={a >= 160000 ? { color: '#000', fontWeight: 500 } : { fontWeight: 500 }}
                        />
                    },
                },
                {
                    title: '新用户累计充值人数', dataIndex: 'totalRechargeNum', label: '推广渠道充值排行榜', align: 'center', width: 80, default: 6, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户累计充值次数', dataIndex: 'totalRechargeCount', label: '推广渠道充值排行榜', align: 'center', width: 80, default: 7, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '平均客单价', dataIndex: 'avgAmount', label: '推广渠道充值排行榜', align: 'center', width: 100, default: 8, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '累计消耗', dataIndex: 'totalCost', label: '推广渠道充值排行榜', align: 'center', width: 100, default: 9, sorter: true,
                    className: 'progress',
                    render: (a: number) => {
                        return <ProgressTable
                            strokeColor={{
                                from: '#e7a0f5',
                                to: '#d161f7',
                            }}
                            percent={a ? a / 100000 * 100 : 0}
                            value={a || 0}
                            valueStyle={a >= 100000 ? { color: '#000', fontWeight: 500 } : { fontWeight: 500 }}
                        />
                    },
                },
                {
                    title: '回本率', dataIndex: 'roi', label: '推广渠道充值排行榜', align: 'center', width: 100, default: 10, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} valueStyle={a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                }
            ]
        },
    ]

    return newArr
}

export default columns12