import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'

/**
 * 表格列配置
 */
export const getTableColumns = (): TableColumnData[] => [
  {
    title: 'ID',
    dataIndex: 'id',
    width: 80,
  },
  {
    title: '规则名称',
    dataIndex: 'name',
    width: 180,
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '描述',
    dataIndex: 'description',
    width: 200,
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '抑制类型',
    dataIndex: 'type',
    width: 100,
    slotName: 'type',
  },
  {
    title: '启用状态',
    dataIndex: 'enabled',
    width: 100,
    slotName: 'enabled',
  },
  {
    title: '优先级',
    dataIndex: 'priority',
    width: 80,
  },
  {
    title: '作用范围',
    dataIndex: 'policy_id',
    width: 120,
    slotName: 'policy',
  },
  {
    title: '关键配置',
    dataIndex: 'config',
    width: 200,
    slotName: 'config',
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '匹配条件',
    dataIndex: 'matchers',
    width: 100,
    slotName: 'matchers',
  },
  {
    title: '命中次数',
    dataIndex: 'hit_count',
    width: 100,
  },
  {
    title: '已抑制',
    dataIndex: 'suppressed_count',
    width: 100,
  },
  {
    title: '最后命中',
    dataIndex: 'last_hit_at',
    width: 160,
    slotName: 'last_hit_at',
  },
  {
    title: '创建时间',
    dataIndex: 'created_at',
    width: 160,
    slotName: 'created_at',
  },
  {
    title: '操作',
    dataIndex: 'operations',
    width: 220,
    slotName: 'operations',
    fixed: 'right',
  },
]
