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

export const columns = [
  {
    title: 'ID',
    key: 'id',
    width: 60,
  },
  {
    title: '玩家ID',
    key: 'playerId',
    width: 80,
  },
  {
    title: '服务器ID',
    key: 'serverId',
    width: 60,
  },
  {
    title: 'attrs',
    key:'attrs',
    width: 120,
  },
  {
    title: 'msg',
    key: 'msg',
    width: 200,
  },
  {
    title: '触发时间',
    key: 'time',
    width: 100,
  },
  {
    title: '触发模块',
    key: 'module',
    width: 100,
  },
  {
    title: '创建时间',
    key: 'createdAt',
    width: 120,
  },
  {
    title: '封禁状态',
    key: 'createdAt',
    width: 120,
    render(row) {
      return h(
        NTag,
        {
          style: {
            marginRight: '6px',
          },
          type: row.ban === 1 ? 'error' : 'info', //0正常 1封禁
          bordered: false,
        },
        {
          default: () => (row.ban === 1 ? '已封禁' : '正常'),
        }
      );
    },
  }
];
