import { h } from 'vue';
import { NTag } from 'naive-ui';
import { formatNanoSeconds } from '@/utils/dateUtil';

export const columns = [
  {
    title: 'ID',
    key: 'id',
    width: 60,
  },
  {
    title: '玩家ID',
    key: 'player_id',
    width: 80,
  },
  {
    title: '服务器ID',
    key: 'server_id',
    width: 60,
  },
  {
    title: '记录ID',
    key: 'origin_id',
    width: 60,
  },
  {
    title: '记录时间',
    key:'origin_time',
    width: 120,
    render: (rows) => {
      return formatNanoSeconds(rows.origin_time);
    },
  },
  // {
  //   title: '记录年月',
  //   key:'year_month',
  //   width: 80,
  // },
  {
    title: 'dps',
    key:'dps',
    width: 60,
  },
  {
    title: '技能倍率',
    key:'rate',
    width: 60,
  },
  {
    title: '伤害估值',
    key:'valuation',
    width: 60,
  },
  {
    title: '实际伤害',
    key:'damage',
    width: 60,
  },
  {
    title: '实际伤害/估值伤害',
    key:'ratio',
    width: 60,
  },
  {
    title: '角色信息',
    key:'role_info',
    width: 80,
  },
  {
    title: '源数据',
    key:'alarm_data',
    width: 80,
  },
  {
    title: '封禁状态',
    key: 'ban',
    width: 120,
    render(row) {
      return h(
        NTag,
        {
          style: {
            marginRight: '6px',
          },
          type: row.ban === 1 ? 'error' : 'info', //0正常 1封禁
          bordered: false,
        },
        {
          default: () => (row.ban === 1 ? '已封禁' : '正常'),
        }
      );
    },
  }
];
