import { ColumnsType } from 'antd/lib/table'
import React from 'react'

function columns(){
    let arr: ColumnsType<any>= Array(60).fill('').map((i: string, index: number) => {
        return {
            title: `D${index + 1}`,
            dataIndex: `D${index + 1}`,
            key: `D${index + 1}`,
            width:150,
            align: 'center',
            render: () => {
                return <div style={{ display: 'flex', flexFlow: 'column', alignContent: 'center' }}>
                    <span>充：</span>
                    <span>增：</span>
                    <span>回：</span>
                </div>
            }
        }
    })
    let newArr:ColumnsType<any>= [
        {
            title: '时间',
            dataIndex: 'data1',
            key: 'data1',
            align: 'center',
            width:150,
        },
        {
            title: '主投书',
            dataIndex: 'data2',
            key: 'data2',
            align: 'center',
            width:150,
            ellipsis: true,
        },
        {
            title: '当天消耗',
            dataIndex: 'data3',
            key: 'data3',
            align: 'center',
            width:150,
        },
        {
            title: '当天新用户首日充值',
            dataIndex: 'data4',
            key: 'data4',
            align: 'center',
            width:150,
        },
        {
            title: <span>当天用户回本率<br />（ROI）</span>,
            dataIndex: 'data5',
            key: 'data5',
            align: 'center',
            width:150,
        },
        {
            title: '当天用户七日回本率',
            dataIndex: 'data6',
            key: 'data6',
            align: 'center',
            width:150,
        },
        {
            title: '当天用户30日回本率',
            dataIndex: 'data7',
            key: 'data7',
            align: 'center',
            width:150,
        },
        {
            title: '累计新用户首日总充值',
            dataIndex: 'data8',
            key: 'data8',
            align: 'center',
            width:200,
        },
        {
            title: '累计新用户回本率',
            dataIndex: 'data9',
            key: 'data9',
            align: 'center',
            width:150,
        },
        {
            title: '当天平台充值',
            dataIndex: 'data10',
            key: 'data10',
            align: 'center',
            width:150,
        },
        {
            title: '平台累计消耗',
            dataIndex: 'data11',
            key: 'data11',
            align: 'center',
            width:150,
        },
        {
            title: '平台累计充值',
            dataIndex: 'data12',
            key: 'data12',
            align: 'center',
            width:150,
        },
        {
            title: <span>总毛利额<br />（累计总充值-累计总消耗）</span>,
            dataIndex: 'data13',
            key: 'data13',
            align: 'center',
            width:350,
        },
        {
            title: '累计回本率',
            dataIndex: 'data14',
            key: 'data14',
            align: 'center',
            width:150,
        },
        {
            title: '平均ROI',
            dataIndex: 'data15',
            key: 'data15',
            align: 'center',
            width:150,
        },
        ...arr,
        {
            title: 'M3',
            dataIndex: 'M3',
            key: 'M3',
            align: 'center',
            width:150,
            render: () => {
                return <div style={{ display: 'flex', flexFlow: 'column', alignContent: 'center' }}>
                    <span>充：</span>
                    <span>增：</span>
                    <span>回：</span>
                </div>
            }
        },
        {
            title: 'M4',
            dataIndex: 'M4',
            key: 'M4',
            align: 'center',
            width:150,
            render: () => {
                return <div style={{ display: 'flex', flexFlow: 'column', alignContent: 'center' }}>
                    <span>充：</span>
                    <span>增：</span>
                    <span>回：</span>
                </div>
            }
        },
    ]
    return newArr
}
export { columns }