import { h } from 'vue';
import { NImage, NTag } from 'naive-ui';
export const columns = [
  {
    type: 'selection',
    width: 50,
    fixed: 'left',
  },
  {
    title: 'ID',
    key: 'id',
    width: 50,
    fixed: 'left',
  },
  {
    title: '租户名称',
    key: 'name',
    width: 150,
  },
  {
    title: '租户编码',
    key: 'code',
    width: 100,
  },
  {
    title: '租户图片',
    key: 'image',
    render(record) {
      return h(NImage, {
        width: 48,
        src: record.image,
        shape: 'square',
        fit: 'fill',
      });
    },
    width: 100,
  },
  {
    title: '统一社会信用代码',
    key: 'license',
    width: 160,
  },
  {
    title: '租户限额',
    key: 'number',
    width: 100,
  },
  {
    title: '租户人数',
    key: 'userNum',
    width: 100,
  },
  {
    title: '到期时间',
    key: 'expireTime',
    width: 180,
  },
  {
    title: '联系人姓名',
    key: 'contactUser',
    width: 140,
  },
  {
    title: '联系人电话',
    key: 'contactMobile',
    width: 140,
  },
  {
    title: '联系人姓名',
    key: 'contactUser',
    width: 140,
  },
  {
    title: '联系人邮箱',
    key: 'contactEmail',
    width: 200,
  },
  {
    title: '租户网址',
    key: 'contactSite',
    width: 140,
    render(record) {
      return h(
        'a',
        {
          href: record.contactSite,
          target: '_blank',
        },
        '点击查看网址',
      );
    },
  },
  {
    title: '状态',
    key: 'status',
    width: 100,
    render(record) {
      return h(
        NTag,
        {
          type: record.status == 1 ? 'success' : 'error',
        },
        {
          default: () => (record.status == 1 ? '正常' : '禁用'),
        },
      );
    },
  },
  {
    title: '创建人',
    key: 'createUser',
    width: 100,
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 180,
  },
];
