import React from "react"
import { Space, Tag } from "antd"
let columns = () => [
    {
        title: '开始时间',
        dataIndex: 'content',
        key: 'content',
        align: 'center',
        ellipsis: true,
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    },
    {
        title: '结束时间',
        dataIndex: 'createTime',
        key: 'createTime',
        align: 'center',
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    },
    {
        title: '小说',
        dataIndex: 'clickTimes',
        key: 'clickTimes',
        align: 'center',
        width: 80,
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    },
    {
        title: '消耗',
        dataIndex: 'labels',
        key: 'labels',
        align: 'center',
        width: 180,
        render: (a: any, b: any) => {
            return <Space>
                { 
                    a && a?.split(',')?.map((item:any, index: number) => {
                        let c1 = Math.floor(Math.random() * 210) + 1
                        let c2 = Math.floor(Math.random() * 210) + 1
                        let c3 = Math.floor(Math.random() * 210) + 1
                        return <span key={index} style={{color: `rgba(${c1},${c2},${c3},1)`}}>{item}</span>
                    })
                }
            </Space>
        }
    },
    {
        title: '点击率',
        dataIndex: 'novels',
        key: 'novels',
        align: 'center',
        width: 120,
        ellipsis: true,
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    },
    {
        title: '下单率',
        dataIndex: 'type',
        key: 'type',
        align: 'center',
        render: (a: any, b: any) => {
            return a && a === 1 ? <Tag color="#2db7f5">标题</Tag> : <Tag color="#108ee9">文案</Tag>
        }
    },
    {
        title: '下单成本',
        dataIndex: 'isCollected',
        key: 'isCollected',
        align: 'center',
        render: (a: any, b: any) => {
            return a ? <Tag color="#f50">已收藏</Tag> : <Tag color="error">未收藏</Tag>
        }
    },
    {
        title: 'ROI',
        dataIndex: 'creator',
        key: 'creator',
        align: 'center',
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    }
]

export default columns