import WidthEllipsis from "@/components/widthEllipsis"
import { Statistic } from "antd"
import React from "react"

function columns12(detailsHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {

    return [
        {
            label: '基本信息',
            data: [
                {
                    title: '角色名称', dataIndex: 'roleName', label: '基本信息', align: 'center', width: 85, default: 1,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '角色ID', dataIndex: 'roleId', label: '基本信息', align: 'center', width: 85, default: 2,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '日期', dataIndex: 'dt', label: '基本信息', align: 'center', width: 125, default: 3, sorter: true, 
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '游戏名称', dataIndex: 'superGameName', label: '基本信息', align: 'center', width: 85, default: 4,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '游戏ID', dataIndex: 'superGameId', label: '基本信息', align: 'center', width: 85, default: 5,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '区服名称', dataIndex: 'serverName', label: '基本信息', align: 'center', width: 80, default: 6,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '区服ID', dataIndex: 'serverId', label: '基本信息', align: 'center', width: 80, default: 7,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '公会名称', dataIndex: 'country', label: '基本信息', align: 'center', width: 90, default: 8,
                    render: (a: string) => (<WidthEllipsis value={a} />)
                },
                {
                    title: '角色聊天总数', dataIndex: 'roleChatCount', label: '基本信息', align: 'center', width: 60, sorter: true, default: 9,
                    render: (a: string) => <Statistic value={a || 0} />
                },
                {
                    title: '最近聊天时间', dataIndex: 'lastChatTime', label: '基本信息', align: 'center', width: 125, default: 10, sorter: true,
                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                },
                // {
                //     title: '操作', dataIndex: 'cz', label: '基本信息', align: 'center', width: 80, default: 11,
                //     render: (_: any, b: any) => {
                //         return <a onClick={() => detailsHandle(b)}>详情</a>
                //     }
                // }
            ]
        }
    ]
}

export default columns12