import WidthEllipsis from "@/components/widthEllipsis"
import { Statistic } from "antd"
import React from "react"
import '../../gameData/flowingWater/index.less'

function columns12() {

    let newArr: { label: string, data: any[] }[] = [
        {
            label: '游戏',
            data: [
                {
                    title: '超父游戏', dataIndex: 'super_game_name', label: '游戏', align: 'center', width: 90, default: 1,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '游戏', dataIndex: 'parent_game_name', label: '游戏', align: 'center', width: 90, default: 2,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
            ]
        },
        {
            label: '区服信息',
            data: [
                {
                    title: '主服名称', dataIndex: 'main_server_name', label: '区服信息', align: 'center', width: 70, default: 5,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '合服的子服ID列表', dataIndex: 'son_server_ids', label: '区服信息', align: 'center', width: 120, default: 7,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '最原始子服名称列表', dataIndex: 'source_server_ids_name', label: '区服信息', align: 'center', width: 130, default: 8,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '最原始子服ID列表', dataIndex: 'source_server_ids', label: '区服信息', align: 'center', width: 120, default: 9,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '区服名称', dataIndex: 'server_name', label: '区服信息', align: 'center', width: 70, default: 3,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '区服ID', dataIndex: 'server_id', label: '区服信息', align: 'center', width: 70, default: 4,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '开服时间', dataIndex: 'dt', label: '区服信息', align: 'center', width: 140, default: 10,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '开服天数', dataIndex: 'start_day', label: '区服信息', align: 'center', width: 60,  default: 11, sorter: true,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '区服攻击力', dataIndex: 'server_combat_num', label: '区服信息', align: 'right', width: 90, 
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '合服列表名', dataIndex: 'son_server_ids_name', label: '区服信息', align: 'center', width: 90, default: 6,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                // {
                //     title: '合服名称', dataIndex: 'boss_server_name', label: '区服信息', align: 'center', width: 70,
                //     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                // },
                // {
                //     title: '合服ID', dataIndex: 'boss_server_id', label: '区服信息', align: 'center', width: 70,
                //     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                // },
                // {
                //     title: '合服时间', dataIndex: 'merge_time', label: '区服信息', align: 'center', width: 140,
                //     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                // },
                {
                    title: '合服次数', dataIndex: 'sum_server_count', label: '区服信息', align: 'center', width: 60, default: 12,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '最小原始子服开服时间', dataIndex: 'min_server_start_time', label: '区服信息', align: 'center', width: 140,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '最小原始子服开服距今天数',
                    dataIndex: 'min_server_start_days',
                    align: 'center',
                    label: '区服信息',
                    width: 130,
                    sorter: true,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
            ]
        },
        {
            label: '用户信息',
            data: [
                {
                    title: '新用户人数', dataIndex: 'new_user_count', label: '用户信息', align: 'center', width: 70, default: 13,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '创角人数', dataIndex: 'create_role_count', label: '用户信息', align: 'center', width: 70, default: 14,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '角色数量', dataIndex: 'role_count', label: '用户信息', align: 'center', width: 70, default: 15,
                    render: (a: string) => <Statistic value={a || 0} />
                },
            ]
        },
        {
            label: '付费数据',
            data: [
                {
                    title: '总付费人数', dataIndex: 'total_num', label: '付费数据', align: 'center', width: 80, default: 16,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '总付费金额', dataIndex: 'total_amount', label: '付费数据', align: 'center', width: 85, default: 17,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '付费ARPPU', dataIndex: 'total_arppu', label: '付费数据', align: 'center', width: 80, default: 18,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '付费率', dataIndex: 'amount_rate', label: '付费数据', align: 'center', width: 80, default: 19,
                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                },
                {
                    title: '今天付费人数', dataIndex: 'ba1_num', label: '付费数据', align: 'center', width: 70, default: 20, className: "redColorClass",
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '今天付费次数', dataIndex: 'ba1_count', label: '付费数据', align: 'center', width: 65, default: 21, className: "redColorClass",
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '今天付费金额', dataIndex: 'ba1', label: '付费数据', align: 'center', width: 75, default: 22, className: "redColorClass",
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '昨天付费人数', dataIndex: 'ba2_num', label: '付费数据', align: 'center', width: 70, default: 23, className: "orangeColorClass",
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '昨天付费次数', dataIndex: 'ba2_count', label: '付费数据', align: 'center', width: 65, default: 24, className: "orangeColorClass",
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '昨天付费金额', dataIndex: 'ba2', label: '付费数据', align: 'center', width: 75, default: 25, className: "orangeColorClass",
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '前天付费人数', dataIndex: 'ba3_num', label: '付费数据', align: 'center', width: 65, default: 26, className: 'volcanoColorClass',
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '前天付费次数', dataIndex: 'ba3_count', label: '付费数据', align: 'center', width: 65, default: 27, className: 'volcanoColorClass',
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '前天付费金额', dataIndex: 'ba3', label: '付费数据', align: 'center', width: 75, default: 28, className: 'volcanoColorClass',
                    render: (a: string) => <Statistic value={a || 0} />
                },
            ]
        },
        {
            label: '活跃数据',
            data: [
                {
                    title: '今日活跃人数', dataIndex: 'ba1_active_num', label: '活跃数据', align: 'center', width: 65, default: 29,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '昨天活跃人数', dataIndex: 'ba2_active_num', label: '活跃数据', align: 'center', width: 65, default: 30,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '前天活跃人数', dataIndex: 'ba3_active_num', label: '活跃数据', align: 'center', width: 65, default: 31,
                    render: (a: string) => <Statistic value={a || 0} />
                },
            ]
        },
        {
            label: '角色信息',
            data: [
                {
                    title: '角色信息',
                    dataIndex: 'roleInfo',
                    label: '角色信息',
                    align: 'center',
                    default: 32,
                    children: [
                        {
                            title: '角色排名',
                            dataIndex: 'rank_num',
                            key: 'rank_num',
                            width: 65,
                            align: 'center',
                            className: "h5BiomassClass green2ColorClass",
                            render: (a: any, b: any) => {
                                return <div className='h5BiomassTable'>
                                    {b?.role_rank_date?.map((item: any, index: number) => {
                                        return <div key={'cc' + index}>
                                            <div><span>{item.rank_num}</span></div>
                                        </div>
                                    })}
                                </div>
                            }
                        },
                        {
                            title: '角色ID',
                            dataIndex: 'role_id',
                            key: 'role_id',
                            width: 100,
                            align: 'center',
                            className: "h5BiomassClass green2ColorClass",
                            render: (a: any, b: any) => {
                                return <div className='h5BiomassTable'>
                                    {b?.role_rank_date?.map((item: any, index: number) => {
                                        return <div key={'cc' + index}>
                                            <div><span><WidthEllipsis value={item.role_id} /></span></div>
                                        </div>
                                    })}
                                </div>
                            }
                        },
                        {
                            title: '角色名称',
                            dataIndex: 'role_name',
                            key: 'role_name',
                            width: 65,
                            align: 'center',
                            className: "h5BiomassClass green2ColorClass",
                            render: (a: any, b: any) => {
                                return <div className='h5BiomassTable'>
                                    {b?.role_rank_date?.map((item: any, index: number) => {
                                        return <div key={'cc' + index}>
                                            <div><span><WidthEllipsis value={item.role_name} /></span></div>
                                        </div>
                                    })}
                                </div>
                            }
                        },
                        {
                            title: '角色等级',
                            dataIndex: 'role_level',
                            key: 'role_level',
                            width: 65,
                            align: 'center',
                            className: "h5BiomassClass green2ColorClass",
                            render: (a: any, b: any) => {
                                return <div className='h5BiomassTable'>
                                    {b?.role_rank_date?.map((item: any, index: number) => {
                                        return <div key={'cc' + index}>
                                            <div><span>{item.role_level}</span></div>
                                        </div>
                                    })}
                                </div>
                            }
                        },
                        {
                            title: '国家',
                            dataIndex: 'country',
                            key: 'country',
                            width: 70,
                            align: 'center',
                            className: "h5BiomassClass green2ColorClass",
                            render: (a: any, b: any) => {
                                return <div className='h5BiomassTable'>
                                    {b?.role_rank_date?.map((item: any, index: number) => {
                                        return <div key={'cc' + index}>
                                            <div><WidthEllipsis value={item.country} /></div>
                                        </div>
                                    })}
                                </div>
                            }
                        },
                        {
                            title: '角色攻击力',
                            dataIndex: 'combat_num',
                            key: 'combat_num',
                            width: 90,
                            align: 'right',
                            className: "h5BiomassClass green2ColorClass",
                            render: (a: any, b: any) => {
                                return <div className='h5BiomassTable'>
                                    {b?.role_rank_date?.map((item: any, index: number) => {
                                        return <div key={'cc' + index}>
                                            <div><span><Statistic value={item.combat_num || 0} /></span></div>
                                        </div>
                                    })}
                                </div>
                            }
                        },
                        {
                            title: '角色累计充值金额',
                            dataIndex: 'total_amount',
                            key: 'total_amount',
                            width: 70,
                            align: 'right',
                            className: "h5BiomassClass green2ColorClass",
                            render: (a: any, b: any) => {
                                return <div className='h5BiomassTable'>
                                    {b?.role_rank_date?.map((item: any, index: number) => {
                                        return <div key={'cc' + index}>
                                            <div><span><Statistic value={item.total_amount || 0} /></span></div>
                                        </div>
                                    })}
                                </div>
                            }
                        },
                    ]
                }
            ]
        }
    ]

    return newArr
}

export default columns12