import { Badge, Button, Popconfirm } from 'antd';
import React from 'react'
import './table.less'
export const expandedRowRender = () => {
    let status = { '-2': 'error', '-1': 'error', '0': 'success', '1': 'processing' }
    let texts = { '-2': '删除', '-1': '失败', '0': '发送中', '1': '成功' }
    let columns: any = [
        {
            title: '消息状态',
            dataIndex: 'executionStatus',
            key: 'executionStatus',
            align: 'center',
            render: (a: number, b: { failMsg: string }) => {
                return <div style={{ display: 'flex', flexFlow: 'column' }}>
                    <Badge status={status[a]} text={texts[a]} />
                    {(a === -1) && <span>描述：{b.failMsg}</span>}
                </div >
            }
        },
        {
            title: '执行时间',
            dataIndex: 'createTime',
            key: 'createTime',
            align: 'center',
            render: (a: string) => {
                return <div>{a}</div>
            }
        },
        {
            title: '预期送达人数',
            dataIndex: 'totalCount',
            key: 'totalCount',
            align: 'center',
            render: (a: string) => {
                return <span>{a}</span>
            }
        },
        {
            title: '发送成功人数',
            dataIndex: 'sendCount',
            key: 'sendCount',
            align: 'center',
            render: (a: string) => {
                return <span>{a}</span>
            }
        },
        {
            title: '发送失败人数',
            dataIndex: 'errCount',
            key: 'errCount',
            align: 'center',
            render: (a: string) => {
                return <span>{a}</span>
            }
        },
    ];
    return columns
};