import { Tooltip } from "antd"
import React from "react"
import style from './index.less'
let columns = () => [
    {
        title: '广告标题',
        dataIndex: 'title',
        key: 'title',
        width: 200,
        fixed: 'left',
        render: (a: any, b: any) => {
            return <Tooltip title={a}><div className={style.oneText}>{a}</div></Tooltip>
        }
    },
    {
        title: '广告文案',
        dataIndex: 'content',
        key: 'content',
        width: 200,
        fixed: 'left',
        render: (a: any, b: any) => {
            return <Tooltip title={a}><div className={style.oneText}>{a}</div></Tooltip>
        }
    },
    {
        title: '标签',
        dataIndex: 'labelInfos',
        key: 'labelInfos',
        render: (a: any, b: any) => {
            return <div>
                {
                    a?.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} >
                            <span style={{ color: `rgba(${c1},${c2},${c3},1)`, }}>{item?.label}</span>
                            {
                                index < a?.length - 1 && <span style={{ color: '#000' }}>&nbsp;,&nbsp;</span>
                            }
                        </span>
                    })
                }
            </div>
        }
    },
    {
        title: '上传作者',
        dataIndex: 'creator',
        key: 'creator',
        align: 'center',
        width: 90,
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    },
    {
        title: '上传时间',
        dataIndex: 'createTime',
        key: 'createTime',
        align: 'center',
        width: 130,
        render: (a: any, b: any) => {
            return <span style={{fontSize: "12px"}}>{a}</span>
        }
    }
]

export default columns