

import WidthEllipsis from "@/components/widthEllipsis"
import { Popconfirm, Space } from "antd"
import React from "react"

function columnsPos(delHandle?: (id: number) => void) {

    let newArr: any = [
        {
            title: '游戏',
            dataIndex: 'gameName',
            key: 'gameName',
            align: 'center',
            width: 120,
            render: (a: string) => (<WidthEllipsis value={a} />)
        },
        {
            title: '游戏ID',
            dataIndex: 'gameId',
            key: 'gameId',
            align: 'center',
            width: 70,
            render: (a: string) => (<WidthEllipsis value={a} />)
        },
        {
            title: '玩家名称',
            dataIndex: 'username',
            key: 'username',
            width: 250,
            render: (a: string) => (<WidthEllipsis value={a} />)
        },
        {
            title: '玩家ID',
            dataIndex: 'userId',
            key: 'userId',
            align: 'center',
            width: 90,
            render: (a: string) => (<WidthEllipsis value={a} />)
        },
        {
            title: '玩家手机号',
            dataIndex: 'mobile',
            key: 'mobile',
            align: 'center',
            width: 100,
            render: (a: string) => (<WidthEllipsis value={a} />)
        },
        {
            title: '操作',
            dataIndex: 'cz',
            key: 'cz',
            render: (_: any, records: any) => {
                return <Space>

                    <Popconfirm
                        title="确定删除?"
                        onConfirm={() => delHandle?.(records.id)}
                    >
                        <a style={{ color: 'red', fontSize: 12 }}>删除</a>
                    </Popconfirm>
                </Space>
            }
        }
    ]
    return newArr
}


export default columnsPos