import React from "react"

const orderTableConfig = (edit: (str: string) => void, ): any => {
    return [
        {
            title: 'ID',
            dataIndex: 'id',
            key: 'id',
            align: 'center',
            width: 50,
            ellipsis: true
        },
        {
            title: 'mpAppId',
            dataIndex: 'mpAppId',
            key: 'mpAppId',
            width: 160,
            align: 'center',
            ellipsis: true,
        },
        {
            title: '微信用户id',
            dataIndex: 'wxOpenId',
            key: 'wxOpenId',
            width: 160,
            align: 'center',
            ellipsis: true,
        },
        {
            title: 'openId',
            dataIndex: 'openId',
            key: 'openId',
            align: 'center',
            width: 90,
            ellipsis: true,
        },
        {
            title: '公众号名称',
            dataIndex: 'mpAppName',
            key: 'mpAppName',
            align: 'center',
            width: 90,
            ellipsis: true,
        },
        {
            title: '广告计划id',
            dataIndex: 'adid',
            key: 'adid',
            align: 'center',
            width: 160,
            ellipsis: true
        },
        {
            title: '广告创意id',
            dataIndex: 'cretiveid',
            key: 'cretiveid',
            align: 'center',
            width: 160,
            ellipsis: true,
        },
        {
            title: '创意样式',
            dataIndex: 'creativetype',
            key: 'creativetype',
            align: 'center',
            width: 90,
            ellipsis: true,
        },
        {
            title: '订单金额(元)',
            dataIndex: 'amount',
            key: 'amount',
            align: 'center',
            width: 120,
            ellipsis: true
        },
        {
            title: '回传状态',
            dataIndex: 'callBackStatus',
            key: 'callBackStatus',
            align: 'center',
            ellipsis: true,
            width: 90,
            render:(a:any)=>{
                let arr = ['未回传','已回传']
                return arr[a]
            }
        },
        {
            title: '是否首单',
            dataIndex: 'isFirstOrder',
            key: 'isFirstOrder',
            align: 'center',
            ellipsis: true,
            width: 90,
            render:(a:any)=>{
                return a ? '是':'否'
            }
        },
        {
            title: '订单号',
            dataIndex: 'orderId',
            key: 'orderId',
            align: 'center',
            width: 160,
            ellipsis: true,
        },
        {
            title: '订单时间',
            dataIndex: 'orderTime',
            key: 'orderTime',
            align: 'center',
            width: 160,
            ellipsis: true,
        },
        {
            title: '订单类型',
            dataIndex: 'orderType',
            key: 'orderType',
            align: 'center',
            width: 160,
            ellipsis: true,
            render:(a:any)=>{
                let arr = ['关注自然日订单','关注12小时内订单','关注24小时内订单']
                return arr[a]
            }
        },
        {
            title: '首次关注时间',
            dataIndex: 'regTime',
            key: 'regTime',
            align: 'center',
            width: 160,
            ellipsis: true,
        },
        {
            title: '操作',
            dataIndex: 'action',
            key: 'action',
            align: 'center',
            fixed:'right',
            width: 50,
            render: (a: any, b: any) => {
                return b?.callBackStatus === 0 ? <a onClick={()=>{edit(b?.id)}}>补单</a> :null
            }
        }
    ]
}
export default orderTableConfig