import { h } from 'vue';
import { NTag } from 'naive-ui';
export const columns = [
  {
    type: 'selection',
    width: 50,
    fixed: 'left',
  },
  {
    title: 'ID',
    key: 'id',
    fixed: 'left',
    width: 50,
  },
  {
    title: '标题',
    key: 'title',
    width: 300,
  },
  {
    title: '类型',
    key: 'type',
    width: 100,
    render(record) {
      return h(
        NTag,
        {
          type: record.type == 1 ? 'processing' : 'success',
        },
        {
          default: () => (record.type == 1 ? '通知' : '公告'),
        },
      );
    },
  },
  {
    title: '状态',
    key: 'status',
    width: 100,
    render(record) {
      return h(
        NTag,
        {
          type: record.status == 1 ? 'success' : 'error',
        },
        {
          default: () => (record.status == 1 ? '正常' : '禁用'),
        },
      );
    },
  },
  {
    title: '点击率',
    key: 'clickNum',
    width: 100,
  },
  {
    title: '创建人',
    key: 'createUser',
    width: 100,
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 180,
  },
];
