import WidthEllipsis from "@/components/widthEllipsis"
import { Badge, Progress, Statistic } from "antd"
import React from "react"
import { PRODUCT_TYPE_ENUM } from "../../const"

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


    return [
        {
            label: '基本信息',
            data: [
                {
                    title: '投手', dataIndex: 'pitcher', label: '基本信息', align: 'center', width: 120, default: 1,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '业务类型', dataIndex: 'productType', label: '基本信息', align: 'center', width: 80, default: 2,
                    render: (a: string) => (<WidthEllipsis value={PRODUCT_TYPE_ENUM[a as keyof typeof PRODUCT_TYPE_ENUM]} />)
                },
                {
                    title: '应用名称', dataIndex: 'appName', label: '基本信息', align: 'center', width: 80, default: 3,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '应用ID', dataIndex: 'appId', label: '基本信息', align: 'center', width: 80,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '小程序ID', dataIndex: 'mpId', label: '基本信息', align: 'center', width: 80, default: 4,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '消耗时间', dataIndex: 'dt', label: '基本信息', align: 'center', width: 80, default: 5,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '总消耗', dataIndex: 'cost', label: '基本信息', align: 'center', width: 90, default: 6, sorter: true,
                    className: 'padding_0',
                    render: (a: number) => <div style={{ height: 26, position: 'relative' }}>
                        <Progress
                            strokeColor={{
                                from: '#10c1e9',
                                to: '#6892d0',
                            }}
                            status="active"
                            showInfo={false}
                            percent={a ? a / 20000 * 100 : 0}
                        />
                        <span style={{ position: 'absolute', left: '50%', top: '50%', width: '100%', padding: '0 5px', transform: 'translate(-50%, -50%)' }}><Statistic style={{ fontWeight: 'bold' }} value={a || 0} precision={2} valueStyle={a >= 20000 ? { color: '#000', fontWeight: 'bold' } : { fontWeight: 'bold' }} /></span>
                    </div>
                },
                {
                    title: '消耗', dataIndex: 'costToday', label: '基本信息', align: 'center', width: 85, default: 7, sorter: true,
                    className: 'padding_0',
                    render: (a: number) => <div style={{ height: 26, position: 'relative' }}>
                        <Progress
                            strokeColor={{
                                from: '#ff5900',
                                to: '#ffd380',
                            }}
                            status="active"
                            showInfo={false}
                            percent={a ? a / 20000 * 100 : 0}
                        />
                        <span style={{ position: 'absolute', left: '50%', top: '50%', width: '100%', padding: '0 5px', transform: 'translate(-50%, -50%)' }}><Statistic value={a || 0} precision={2} valueStyle={a >= 20000 ? { color: '#000', fontWeight: 'bold' } : { fontWeight: 'bold' }} /></span>
                    </div>
                },
                {
                    title: '赔付金', dataIndex: 'payout', label: '基本信息', align: 'center', width: 80, default: 8, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '推广广告账号数量', tips: '消耗大于0', dataIndex: 'accountCount', label: '基本信息', align: 'center', width: 80, default: 9, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '推广广告数量', tips: '消耗大于0', dataIndex: 'adCount', label: '基本信息', align: 'center', width: 80, default: 10, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
            ]
        },
        {
            label: '基础数据',
            data: [
                {
                    title: '点击量', dataIndex: 'validClickCount', label: '基础数据', align: 'center', width: 80, default: 11, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '曝光量', dataIndex: 'viewCount', label: '基础数据', align: 'center', width: 80, default: 12, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '基础数据', align: 'center', width: 80, default: 13, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '点击均价', dataIndex: 'cpc', label: '基础数据', align: 'center', width: 80, default: 14, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '小游戏注册人数', dataIndex: 'miniGameRegisterUsers', label: '基础数据', align: 'center', width: 80, default: 15, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '小游戏注册成本', dataIndex: 'miniGameRegisterCost', label: '基础数据', align: 'center', width: 80, default: 16, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '小游戏注册率', dataIndex: 'miniGameRegisterRate', label: '基础数据', align: 'center', width: 80, default: 17, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.5 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
            ]
        },
        {
            label: 'D1数据',
            data: [
                {
                    title: '小游戏注册首日广告变现人数(平台上报)', dataIndex: 'miniGameFirstDayAdMonetizationUsers', label: 'D1数据', align: 'center', width: 100, default: 18, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活首日广告变现人数(平台上报)', dataIndex: 'adMonetizationPlaDedupActive1dPv', label: 'D1数据', align: 'center', width: 90, default: 19, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活首日广告变现次数(平台上报)', dataIndex: 'incomePv1dPla', label: 'D1数据', align: 'center', width: 90, default: 20, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '注册首日广告变现金额(平台上报)', dataIndex: 'miniGameFirstDayAdMonetizationAmount', label: 'D1数据', align: 'center', width: 90, default: 21, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '首日变现ARPPU', dataIndex: 'miniGameFirstDayAdPayingArppu', label: 'D1数据', align: 'center', width: 80, default: 22, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '首日变现ARPU', dataIndex: 'miniGameFirstDayAdPayingArpu', label: 'D1数据', align: 'center', width: 80, default: 23, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '首日广告变现成本(平台上报)', dataIndex: 'miniGameFirstDayAdPayingCost', label: 'D1数据', align: 'center', width: 80, default: 24, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '首日ROI', dataIndex: 'miniGameFirstDayAdPayingRoi', label: 'D1数据', align: 'center', width: 80, default: 25, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.5 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
            ]
        },
        {
            label: '24小时数据',
            data: [
                {
                    title: '激活首24小时广告变现人数(平台上报)', dataIndex: 'adPayingUsers24hPla', label: '24小时数据', align: 'center', width: 90, default: 26, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活首24小时广告变现次数(平台上报)', dataIndex: 'incomePv24hPla', label: '24小时数据', align: 'center', width: 90, default: 27, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活首24小时广告变现金额(平台上报)', dataIndex: 'incomeVal24hPla', label: '24小时数据', align: 'center', width: 90, default: 28, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '激活首24小时广告变现ARPPU(平台上报)', dataIndex: 'firstDayAdPurArppuCost24hPla', label: '24小时数据', align: 'center', width: 100, default: 29, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '24小时广告变现ARPU(平台上报)', dataIndex: 'firstDayAdPurArpuCost24hPla', label: '24小时数据', align: 'center', width: 90, default: 30, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '24小时广告变现成本', dataIndex: 'firstDayAdPurArpuCost24hPlaCost', label: '24小时数据', align: 'center', width: 80, default: 31, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '24小时广告变现ROI', dataIndex: 'firstDayAdPurArpuCost24hPlaRoi', label: '24小时数据', align: 'center', width: 80, default: 32, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.5 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
            ]
        },
        {
            label: 'D3数据',
            data: [
                {
                    title: '小游戏注册3日广告变现人数(平台上报)', dataIndex: 'minigame3dIncomeUv', label: 'D3数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活3日广告变现人数(平台上报)', dataIndex: 'regUserTotal', label: 'D3数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '小游戏注册3日广告变现次数(平台上报)', dataIndex: 'minigame3dIncomeCount', label: 'D3数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活3日广告变现次数(平台上报)', dataIndex: 'adMonetizationPlaDedupActive3dPv', label: 'D3数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '小游戏注册3日广告变现金额(平台上报)', dataIndex: 'miniGameAdMonetizationAmountD3', label: 'D3数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '3日广告变现ARPPU(平台上报)', dataIndex: 'adPurArppuDay3Cost', label: 'D3数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '3日广告变现ARPU(平台上报)', dataIndex: 'adPurArpuDay3Cost', label: 'D3数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '3日广告变现成本(平台上报)', dataIndex: 'adPurDay3Cost', label: 'D3数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '3日广告变现ROI', dataIndex: 'adPurDay3Roi', label: 'D3数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.5 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
            ]
        },
        {
            label: 'D7数据',
            data: [
                {
                    title: '小游戏注册7日广告变现人数(平台上报)', dataIndex: 'minigame7dIncomeUv', label: 'D7数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活7日变现人数(平台上报)', dataIndex: 'adMonetizationPlaDedupActive7dPv', label: 'D7数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '激活7日广告变现次数(平台上报)', dataIndex: 'minigame7dIncomeCount', label: 'D7数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '小游戏注册7日广告变现金额(平台上报)', dataIndex: 'miniGameRegD7Amount', label: 'D7数据', align: 'center', width: 90, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '7日广告变现ARPPU(平台上报)', dataIndex: 'miniGameRegD7Arppu', label: 'D7数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '7日广告变现ARPU(平台上报)', dataIndex: 'miniGameRegD7Arpu', label: 'D7数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '7日广告变现成本(平台上报)', dataIndex: 'miniGameRegD7Cost', label: 'D7数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '7日广告变现ROI', dataIndex: 'miniGameRegD7Roi', label: 'D7数据', align: 'center', width: 80, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.5 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                }
            ]
        },
        {
            label: 'D总数据',
            data: [
                {
                    title: '广告变现人数(平台上报)', dataIndex: 'miniGameAdMonetizationUsers', label: 'D总数据', align: 'center', width: 80, default: 33, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '广告变现次数(平台上报)', dataIndex: 'incomePvPla', label: 'D总数据', align: 'center', width: 80, default: 34, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} />
                },
                {
                    title: '广告变现金额(平台上报)', dataIndex: 'miniGameAdMonetizationAmount', label: 'D总数据', align: 'center', width: 80, default: 35, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '广告变现ARPPU(平台上报)', dataIndex: 'miniGameAdMonetizationArppu', label: 'D总数据', align: 'center', width: 80, default: 36, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '广告变现ARPU(平台上报)', dataIndex: 'miniGameAdMonetizationArpu', label: 'D总数据', align: 'center', width: 80, default: 37, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '广告变现成本(平台上报)', dataIndex: 'miniGameAdMonetizationCost', label: 'D总数据', align: 'center', width: 80, default: 38, sorter: true,
                    render: (a: number) => <Statistic value={a || 0} precision={2} />
                },
                {
                    title: '广告变现总ROI', dataIndex: 'miniGameAdMonetizationRoi', label: 'D总数据', align: 'center', width: 80, default: 39, sorter: true,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.5 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
            ]
        }
    ]
}

export default columns12