import { h } from 'vue';
import { NTag } from 'naive-ui';

export const columns = [
  {
    title: '排名',
    dataIndex: 'ranking',
    key: 'ranking',
    width: 80,
  },
  {
    title: '玩家ID',
    dataIndex: 'player_id',
    key: 'player_id',
    width: 100,
  },
  {
    title: '昵称',
    dataIndex: 'nickName',
    key: 'nickName',
    width: 120,
  },
  {
    title: '所属渠道',
    dataIndex: 'platform',
    key: 'platform',
    render(row) {
      return row.platform === 1 ? '安卓' : '苹果';
    },
    width: 120,
  },
  {
    title: '充值金额',
    dataIndex: 'total',
    key: 'total',
    render(row) {
      return row.total;
    },
    width: 120,
  },
  {
    title: '当前钻石',
    dataIndex: 'diamond',
    key: 'diamond',
    render(row) {
      return row.diamond;
    },
    width: 120,
  },
  {
    title: '最近充值',
    dataIndex: 'lastRecharge',
    key: 'lastRecharge',
    render(row) {
      return h(
        NTag,
        {
          style: {
            marginRight: '6px',
          },
          type: row.lastRechargeTag,
          bordered: false,
        },
        {
          default: () => row.lastRecharge,
        }
      );
    },
    width: 150,
  },
  {
    title: '最近登录',
    dataIndex: 'lastRecharge',
    key: 'lastRecharge',
    render(row) {
      return h(
        NTag,
        {
          style: {
            marginRight: '6px',
          },
          type: row.lastLoginTag,
          bordered: false,
        },
        {
          default: () => row.lastLogin,
        }
      );
    },
    width: 150,
  },
  {
    title: '玩家等级',
    dataIndex: 'level',
    key: 'level',
    render(row) {
      return row.level;
    },
    width: 120,
  },
  {
    title: '最大关卡进度',
    dataIndex: 'maxPass',
    key: 'maxPass',
    render(row) {
      return row.maxPass;
    },
    width: 150,
  },
];
