import { gameClassifyEnum } from "@/components/QueryForm/const"
import WidthEllipsis from "@/components/widthEllipsis"
import { Statistic } from "antd"
import React from "react"
import '../../adlist/monitor/index.less'

function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {


    return [
        {
            label: '游戏信息',
            data: [
                {
                    title: '推广游戏名称', dataIndex: 'gameName', label: '游戏信息', align: 'center', width: 70, default: 1,
                    render: (a: string, b: any) => (<WidthEllipsis isCopy={a !== '总计'} value={a} />)
                },
                {
                    title: '推广游戏应用类型', dataIndex: 'gameClassify', label: '游戏信息', align: 'center', width: 85,
                    render: (a: string) => <WidthEllipsis value={gameClassifyEnum[a]} />
                }
            ]
        },
        {
            label: '消耗',
            data: [
                {
                    title: '消耗', dataIndex: 'cost', label: '消耗', align: 'center', width: 90, sorter: true, default: 2,
                    render: (a: string) => <Statistic value={a || 0} />
                }
            ]
        },
        {
            label: '用户数据',
            data: [
                {
                    title: '注册人数', dataIndex: 'regNum', label: '用户数据', align: 'center', width: 70, sorter: true, default: 3,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '注册成本', dataIndex: 'regCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 4,
                    render: (a: string) => <Statistic value={a || 0} />
                }
            ]
        },
        {
            label: '付费数据',
            data: [
                {
                    title: '新用户充值次数', dataIndex: 'newUserAmountCount', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户充值人数', dataIndex: 'newUserAmountNum', label: '付费数据', align: 'center', width: 70, default: 5,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户充值金额', dataIndex: 'newUserAmount', label: '付费数据', align: 'center', default: 6,
                    children: [
                        {
                            title: '总', 
                            dataIndex: 'newUserAmount',
                            key: 'newUserAmount', 
                            align: 'right', 
                            width: 70, 
                            className: 'adDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        },
                        {
                            title: '支付宝(自然量)', 
                            dataIndex: 'alipayAmount', 
                            key: 'alipayAmount', 
                            align: 'right', 
                            width: 80, 
                            className: 'payDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        },
                        {
                            title: '微信(自然量)', 
                            dataIndex: 'wxAmount', 
                            key: 'wxAmount', 
                            align: 'right', 
                            width: 70, 
                            className: 'payDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        },
                        {
                            title: '米大师(自然量)', 
                            dataIndex: 'miMasterAmount', 
                            key: 'miMasterAmount', 
                            align: 'right', 
                            width: 80, 
                            className: 'payDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        }
                    ]
                },
                {
                    title: '新用户充值成本', dataIndex: 'newUserRechargeCost', label: '付费数据', align: 'center', width: 80, default: 14,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户回收率', dataIndex: 'newUserRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true, default: 11,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '首日新用户充值次数', dataIndex: 'firstNewUserAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '首日新用户充值人数', dataIndex: 'firstNewUserAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 7,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 8,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '老用户充值次数', dataIndex: 'oldUserCount', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '老用户充值人数', dataIndex: 'oldUserNum', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '老用户充值金额', dataIndex: 'oldUserAmount', label: '付费数据', align: 'center', width: 80,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '账面充值次数', dataIndex: 'amountCount', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '账面充值人数', dataIndex: 'amountNum', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '账面充值金额', dataIndex: 'amount', label: '付费数据', align: 'center', width: 85,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户累计充值次数', dataIndex: 'newUserTotalAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户累计充值人数', dataIndex: 'newUserTotalAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 9,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户累计充值金额', dataIndex: 'newUserTotalAmount', label: '付费数据', align: 'center', default: 10,
                    children: [
                        {
                            title: '总', 
                            dataIndex: 'newUserTotalAmount',
                            key: 'newUserTotalAmount', 
                            align: 'right', 
                            width: 70, 
                            className: 'adDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        },
                        {
                            title: '支付宝累计(自然量)', 
                            dataIndex: 'natureNewUserTotalZfbAmount', 
                            key: 'natureNewUserTotalZfbAmount', 
                            align: 'right', 
                            width: 80, 
                            className: 'payDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        },
                        {
                            title: '微信累计(自然量)', 
                            dataIndex: 'natureNewUserTotalWxAmount', 
                            key: 'natureNewUserTotalWxAmount', 
                            align: 'right', 
                            width: 70, 
                            className: 'payDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        },
                        {
                            title: '米大师累计(自然量)', 
                            dataIndex: 'natureNewUserTotalMdsAmount', 
                            key: 'natureNewUserTotalMdsAmount', 
                            align: 'right', 
                            width: 80, 
                            className: 'payDataBackColorClass',
                            render: (a: string) => <Statistic value={a || 0} />
                        }
                    ]
                },
                {
                    title: '首日充值成本', dataIndex: 'firstNewUserRechargeCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 15,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '总充值成本', dataIndex: 'totalRechargeCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 12,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '总ROI', dataIndex: 'totalRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 13,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '首日付费率', dataIndex: 'firstAmountRate', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '新用户付费率', dataIndex: 'newUserRoi', label: '付费数据', align: 'center', width: 70,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '至今付费率', tips: '至今付费率（总）=新用户累计充值人数/注册人数', dataIndex: 'todayAmountRate', label: '付费数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '新用户付费比', dataIndex: 'newUserRate', label: '付费数据', align: 'center', width: 70,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '首日客单价', dataIndex: 'firstAvgAmount', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户客单价', dataIndex: 'newUserAvgAmount', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '至今客单价', tips: '至今客单价（总）=新用户累计充值金额/新用户累计充值次数', dataIndex: 'todayAvgAmount', label: '付费数据', align: 'center', width: 80, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '账面客单价', dataIndex: 'avgAmount', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                // {
                //     title: '复充率', dataIndex: 'userAgainRate', label: '付费数据', align: 'center', width: 70,
                //     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                // },


                {
                    title: '单日付费100+人数', dataIndex: 'hundredUserNum', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '单日付费100+成本', dataIndex: 'hundredUserNumCost', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '首日创角人数', dataIndex: 'firstRoleNum', label: '付费数据', align: 'center', width: 75, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '创角人数', dataIndex: 'roleNum', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '付费数据', align: 'center', width: 85, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '首日创角人数成本', dataIndex: 'firstRoleNumCost', label: '付费数据', align: 'center', width: 80, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '创角人数成本', dataIndex: 'roleNumCost', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '新用户累计创角人数成本', dataIndex: 'newUserTotalRoleNumCost', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '首日创角率', dataIndex: 'firstRoleNumRate', label: '付费数据', align: 'center', width: 75, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '创角率', dataIndex: 'roleNumRate', label: '付费数据', align: 'center', width: 75, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '新用户累计创角率', dataIndex: 'newUserTotalRoleNumRate', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },

                {
                    title: '新用户复充率', tips: '注册时间范围内用户，在充值时间内重复充值（即用户累计充值次数n≥2)。计算公式：复冲率=新用户复充人数/新用户累计充值人数', dataIndex: 'newUserAgainRate', label: '付费数据', align: 'center', width: 70,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                // {
                //     title: '当天复充率', dataIndex: 'todayAgainRate', label: '付费数据', align: 'center', width: 70, sorter: true,
                //     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                // },
                {
                    title: '新增注册ARPPU', dataIndex: 'regUserArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '首日付费ARPPU', dataIndex: 'firstAmountArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户付费ARPPU', dataIndex: 'newUserAmountArpu', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '至今付费ARPPU', dataIndex: 'todayAmountArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '账面ARPPU', dataIndex: 'amountArpu', label: '付费数据', align: 'center', width: 70,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                { title: '首日有效创角人数', dataIndex: 'firstEffectiveRoleNum', label: '付费数据', align: 'center', width: 80, sorter: true, },
                { title: '新用户累计有效创角人数', dataIndex: 'newUserTotalEffectiveRoleNum', label: '付费数据', align: 'center', width: 85, sorter: true, },
                { title: '有效创角人数', dataIndex: 'effectiveRoleNum', label: '付费数据', align: 'center', width: 70, sorter: true, },
                {
                    title: '首日有效创角率', dataIndex: 'firstEffectiveRoleRate', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} valueStyle={!a ? {} : a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '新用户累计有效创角率', dataIndex: 'newUserTotalEffectiveRoleNumRate', label: '付费数据', align: 'center', width: 100, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} valueStyle={!a ? {} : a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '有效创角率', dataIndex: 'effectiveRoleNumRate', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} valueStyle={!a ? {} : a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '首日有效创角成本', dataIndex: 'firstEffectiveRoleNumCost', label: '付费数据', align: 'center', width: 80, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '新用户累计有效创角成本', dataIndex: 'newUserTotalEffectiveRoleNumCost', label: '付费数据', align: 'center', width: 85, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '有效创角成本', dataIndex: 'effectiveRoleNumCost', label: '付费数据', align: 'center', width: 75, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                { title: '首日有效创角付费人数', dataIndex: 'firstEffectiveRoleAmountNum', label: '付费数据', align: 'center', width: 80, sorter: true, },
                { title: '新用户累计有效创角付费人数', dataIndex: 'newUserTotalEffectiveRoleAmountNum', label: '付费数据', align: 'center', width: 95, sorter: true, },
                {
                    title: '首日有效创角付费成本', dataIndex: 'firstEffectiveRoleAmountNumCost', label: '付费数据', align: 'center', width: 80, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '新用户累计有效创角付费成本', dataIndex: 'newUserTotalEffectiveRoleAmountNumCost', label: '付费数据', align: 'center', width: 95, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '首日有效创角付费比', dataIndex: 'firstEffectiveRoleAmountNumRate', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} valueStyle={!a ? {} : a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '新用户累计有效创角付费比', dataIndex: 'newUserTotalEffectiveRoleAmountNumRate', label: '付费数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} valueStyle={!a ? {} : a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '首日有效创角ARPU', dataIndex: 'firstEffectiveRoleArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '新用户累计有效创角ARPU', dataIndex: 'newUserTotalEffectiveRoleArpu', label: '付费数据', align: 'center', width: 80, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
            ]
        }
    ]
}


export default columns12