

import { Row, Col, Popconfirm } from "antd"
import { DeleteOutlined, EditOutlined } from "@ant-design/icons"
import WidthEllipsis from "@/components/widthEllipsis"
import React from "react"

function columnsPos(editPack: (data: any) => void, del: (id: number) => void) {

    let newArr: any = [
        {
            title: 'VIP档位',
            dataIndex: 'vipLevel',
            key: 'vipLevel',
            align: 'center',
            width: 90
        },
        {
            title: '超父游戏名称',
            dataIndex: 'superGameName',
            key: 'superGameName',
            align: 'center',
            width: 90,
            render: (a: string, b: any) => (<WidthEllipsis value={a} />)
        },
        {
            title: '游戏名称',
            dataIndex: 'parentGameName',
            key: 'parentGameName',
            align: 'center',
            width: 90,
            render: (a: string, b: any) => (<WidthEllipsis value={a} />)
        },
        {
            title: '最小充值金额（包含）',
            dataIndex: 'rechargeMoneyMin',
            key: 'rechargeMoneyMin',
            align: 'center',
            width: 100
        },
        {
            title: '最大充值金额（不包含）',
            dataIndex: 'rechargeMoneyMax',
            key: 'rechargeMoneyMax',
            align: 'center',
            width: 120
        },
        {
            title: '创建人',
            dataIndex: 'createName',
            key: 'createName',
            align: 'center',
            width: 100,
            render: (a: string, b: any) => (<WidthEllipsis value={a} />)
        },
        {
            title: '创建时间',
            dataIndex: 'createTime',
            key: 'createTime',
            align: 'center',
            width: 135,
            render: (a: string, b: any) => (<WidthEllipsis value={a} />)
        },
        {
            title: '更新人',
            dataIndex: 'updateName',
            key: 'updateName',
            align: 'center',
            width: 100,
            render: (a: string, b: any) => (<WidthEllipsis value={a} />)
        },
        {
            title: '更新时间',
            dataIndex: 'updateTime',
            key: 'updateTime',
            align: 'center',
            width: 135,
            render: (a: string, b: any) => (<WidthEllipsis value={a} />)
        },
        {
            title: '操作',
            dataIndex: 'cz',
            key: 'cz',
            align: 'center',
            width: 100,
            fixed: 'right',
            render: (a: string, b: any) => (
                <Row justify='center' gutter={[10, 0]}>
                    <Col><a style={{ fontSize: "12px" }} onClick={() => { editPack(b) }}><EditOutlined /> 修改</a></Col>
                    <Col>
                        <Popconfirm
                            title="确定删除?"
                            onConfirm={() => { del(b.id) }}
                            okText="是"
                            cancelText="否"
                        >
                            <a style={{ fontSize: "12px", color: 'red' }}><DeleteOutlined /> 删除</a>
                        </Popconfirm>
                    </Col>
                </Row>
            )
        }
    ]
    return newArr
}


export default columnsPos