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

function columns(){
    let arr: ColumnsType<any>= Array(7).fill('').map((i: string, index: number) => {
        return {
            title: `D${index + 1}`,
            dataIndex: `D${index + 1}`,
            key: `D${index + 1}`,
            width:250,
            align: 'center',
            render: () => {
                return <div style={{ display: 'flex', flexFlow: 'column', alignContent: 'center' }}>
                    <span>原：</span>
                    <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,
        },
        {
            title: '主投书',
            dataIndex: 'data3',
            key: 'data3',
            align: 'center',
            width:150,
        },
        {
            title: '当天消耗',
            dataIndex: 'data4',
            key: 'data4',
            align: 'center',
            width:150,
        },
        {
            title: '当日新用户累计充值',
            dataIndex: 'data5',
            key: 'data5',
            align: 'center',
            width:150,
        },
        {
            title: '回本率',
            dataIndex: 'data6',
            key: 'data6',
            align: 'center',
            width:150,
        },
        {
            title: '新增粉丝数',
            dataIndex: 'data7',
            key: 'data7',
            align: 'center',
            width:150,
        },
        {
            title: '新增粉丝成本',
            dataIndex: 'data8',
            key: 'data8',
            align: 'center',
            width:150,
        },
        {
            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: '平均充值金额',
            dataIndex: 'data13',
            key: 'data13',
            align: 'center',
            width:150,
        },
        {
            title: '平均充值次数',
            dataIndex: 'data14',
            key: 'data14',
            align: 'center',
            width:150,
        },
        ...arr
    ]
    return newArr
}
export { columns }