import { FundStatusEnum } from "@/services/launchAdq/enum"
import { Badge, Space, Tooltip } from "antd"
import React from "react"
import './index.less'
export function columnsMp(edit:(params: any)=>void): any {
    return [
        {
            title: 'ID',
            dataIndex: 'id',
            key: 'id',
            align: 'center',
            width: 55,
            fixed:'left'
        },
        {
            title: '广告主ID',
            dataIndex: 'accountId',
            key: 'accountId',
            align: 'center',
            width: 100,
            fixed:'left'
        },
        {
            title: '类型',
            dataIndex: 'sourceType',
            key: 'sourceType',
            align: 'center',
            width: 70,
            render: (a: any, b: any) => {
                return <span>{a == 0 ? '微信' : 'QQ'}</span>
            }
        },
        {
            title: '备注',
            dataIndex: 'remark',
            key: 'remark',
            align: 'center',
            width: 200,
            ellipsis:true,
        },
        // {
        //     title: '公众号信息',
        //     dataIndex: 'wechatAccountName',
        //     key: 'wechatAccountName',
        //     width: 150,
        //     align: 'center',
        //     render: (a: any, b: any) => {
        //         return <div className="verticalCenter">
        //             <div><strong>{a}</strong></div>
        //             <div style={{ color: "rgb(136, 136, 136)", fontSize: 13 }}>{b?.wechatAccountId}</div>
        //         </div>
        //     }
        // },
        {
            title: '企业名称',
            dataIndex: 'corporationName',
            key: 'corporationName',
            width: 150,
            align: 'center',
            ellipsis: true
        },
        // {
        //     title: '服务商ID列表',
        //     dataIndex: 'agencyIdList',
        //     key: 'agencyIdList',
        //     width: 130,
        //     align: 'center',
        //     render: (a: any) => {
        //         return <Tooltip title={a}>
        //             <div className="name-wrapper">
        //                 <p>{ a }</p>
        //             </div>
        //         </Tooltip>
        //     }
        // },
        {
            title: '行业ID',
            dataIndex: 'systemIndustryId',
            key: 'systemIndustryId',
            width: 130,
            align: 'center',
            render: (a: any) => {
                return <Tooltip title={a}>
                    <div className="name-wrapper">{ a }</div>
                </Tooltip>
            }
        },
        {
            title: '是否有效',
            dataIndex: 'enabled',
            key: 'enabled',
            align: 'center',
            width:60,
            render: (a: any, b: any) => {
                return  <Badge status={a ? "processing" :"error" } text={a? '是' : '否'} />
            }
        },
        {
            title: '授权时间',
            dataIndex: 'createTime',
            key: 'createTime',
            align: 'center',
            width: 120
        },
        {
            title: '日限额(分)',
            dataIndex: 'dailyBudget',
            key: 'dailyBudget',
            align: 'center',
            width: 100
        },
        {
            title: '资金状态',
            dataIndex: 'fundStatus',
            key: 'fundStatus',
            align: 'center',
            width:100,
            render:(a: string | number)=>{
             return FundStatusEnum[a]
            }
        },
        {
            title: '操作',
            dataIndex: 'cz',
            key: 'cz',
            align: 'center',
            width: 80,
            fixed:'right',
            render:(a: any,b: any)=>{
                return <Space>
                    <a onClick={()=>{edit(b)}}>备注</a>
                </Space>
            }
        },
    ]
}