import { Badge, Tag } from "antd";
import { ColumnsType } from "antd/es/table";
const TransferType = {
    "TRANSFER": <Tag color="#87d068">在职继承</Tag>,
    "RESIGNED_TRANSFER": <Tag color="#f50">离职继承</Tag>
}

const LogStatus = { "ERROR": <Badge status="error" text="继承失败" />, "REFUSED": <Badge status="default" text="客户拒绝" />, "WAITING": <Badge status="processing" text='等待接待' />, "COMPLETE": <Badge status="success" text="接替完成" />, "LIMIT": <Badge status="warning" text="接替成员客户达到上限" /> }
export function TableConfigLog(): ColumnsType<any> {

    let arr: ColumnsType<any> = [
        {
            title: '任务ID',
            dataIndex: 'taskId',
            key: 'taskId',
            align: 'center',
            width: 80
        },
        {
            title: '企业ID',
            dataIndex: 'corpId',
            key: 'corpId',
            align: 'center',
            width: 90,
            ellipsis: true
        },
        {
            title: '接替人员',
            dataIndex: 'takeoverUserId',
            key: 'takeoverUserId',
            align: 'center',
            width: 100,
            ellipsis: true
        },
        {
            title: '原跟进成员',
            dataIndex: 'handoverUserId',
            key: 'handoverUserId',
            align: 'center',
            width: 100,
            ellipsis: true,
        },
        {
            title: "创建时间",
            dataIndex: "createTime",
            key: 'createTime',
            align: 'center',
            width: 100,
            ellipsis: true,
        },
        {
            title: "接替状态",
            dataIndex: "customerStatus",
            key: 'customerStatus',
            align: 'center',
            width: 100,
            ellipsis: true,
            render:(_,b)=>{
                return b?.customerStatus && LogStatus[b?.customerStatus]
            }
        },
        {
            title: "失败信息",
            dataIndex: "errorMsg",
            key: 'errorMsg',
            align: 'center',
            width: 100,
            ellipsis: true,
        }
    ]

    return arr
}