import { Tooltip } from "antd"
import React from "react"
import style from './index.less'
import { BidModeEnum, OptimizationGoalEnum, PromotedObjectType, SiteSetEnum } from "@/services/launchAdq/enum";
let columns = () => {

    return [
        {
            title: '媒体账户',
            dataIndex: 'adAccountId',
            key: 'adAccountId',
            align: 'center',
            width: 100,
            fixed: 'left'
        },
        {
            title: '广告名称',
            dataIndex: 'adgroupName',
            key: 'adgroupName',
            align: 'center',
            width: 120,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>{b?.sysAdGroupData?.adgroupName}</span>
            }
        },
        {
            title: '推广目标',
            dataIndex: 'promotedObjectType',
            key: 'promotedObjectType',
            align: 'center',
            width: 120,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>{PromotedObjectType[a]}</span>
            }
        },
        {
            title: '推广版位',
            dataIndex: 'sysAdGroupData',
            key: 'sysAdGroupData',
            align: 'center',
            width: 120,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>{a?.siteSet?.map((item: string) => SiteSetEnum[item]).toString()}</span>
            }
        },
        {
            title: '投放日期',
            dataIndex: 'beginDate',
            key: 'beginDate',
            align: 'center',
            width: 200,
            render: (a: any, b: any) => {
                return <span>{b?.sysAdGroupData?.endDate ? b?.sysAdGroupData?.beginDate + '~' + b?.sysAdGroupData?.endDate : b?.sysAdGroupData?.beginDate + '~ 长期投放'}</span> 
            }
        },
        {
            title: '投放时段',
            dataIndex: 'date_set1',
            key: 'date_set1',
            align: 'center',
            width: 100,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>全天投放</span>
            }
        },
        {
            title: '每日预算',
            dataIndex: 'dailyBudget',
            key: 'dailyBudget',
            align: 'center',
            width: 100,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>{b?.sysAdGroupData?.dailyBudget || '不限'}</span>
            }
        },
        {
            title: '出价方式',
            dataIndex: 'bidMode',
            key: 'bidMode',
            align: 'center',
            width: 90,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>{BidModeEnum[b?.sysAdGroupData?.bidMode]}</span>
            }
        },
        {
            title: '出价',
            dataIndex: 'bidAmount',
            key: 'bidAmount',
            align: 'center',
            width: 100,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>{b?.sysAdGroupData?.bidAmount}</span>
            }
        },
        {
            title: '优化目标',
            dataIndex: 'optimizationGoal',
            key: 'optimizationGoal',
            align: 'center',
            width: 100,
            render: (a: any, b: any) => {
                return <span style={{ fontSize: "12px" }}>{OptimizationGoalEnum[b?.sysAdGroupData?.optimizationGoal]}</span>
            }
        },
        // {
        //     title: '创意名称',
        //     dataIndex: 'remark',
        //     key: 'remark',
        //     align: 'center',
        //     width: 120,
        //     render: (a: any, b: any) => {
        //         return <div className={style.twoText}>
        //             <Tooltip title={b?.idea?.name}>
        //                 <span style={{ fontSize: "12px" }}>{b?.idea?.name}</span>
        //             </Tooltip>
        //         </div>
        //     }
        // },
        {
            title: '落地页名称',
            dataIndex: 'pageData',
            key: 'pageData',
            align: 'center',
            width: 120,
            render: (a: any, b: any) => {
                return <div className={style.twoText}>
                    <Tooltip title={a?.pageName}>
                        <span style={{ fontSize: "12px" }}>{a?.pageName}</span>
                    </Tooltip>
                </div>
            }
        },
        {
            title: '定向名称',
            dataIndex: 'targetingData',
            key: 'targetingData',
            align: 'center',
            width: 200,
            render: (a: any, b: any) => {
                return <div className={style.twoText}>
                    {
                        a?.targetingName ? <Tooltip title={a?.targetingName}>
                            <span style={{ fontSize: "12px" }}>{a?.targetingName}</span>
                        </Tooltip> : '<空>'
                    }
                </div>
            }
        },
        // {
        //     title: '商品',
        //     dataIndex: 'human_info_goods',
        //     key: 'human_info_goods',
        //     align: 'center',
        //     width: 200,
        //     render: (a: any, b: any) => {
        //         if (a) {
        //             let data = a?.data
        //             if (data && data?.length > 0) {
        //                 return <span style={{ fontSize: "12px" }}>{data[0]?.productName + '-' + data[0]?.author}</span>
        //             }
        //             return '--'
        //         } else {
        //             return '--'
        //         }

        //     }
        // }
    ]
}

export default columns