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

export const columns = [
  {
    title: "用户名",
    key: "username",
  },
  {
    title: "真实姓名",
    key: "realname",
  },
  {
    title: "手机号",
    key: "phone",
  },
  {
    title: "电子邮箱",
    key: "email",
  },
  {
    title: "用户类型",
    key: "userType",
    render(row) {
      return h(
        NTag,
        {
          type: row.userType === 1 ? "success" : "info",
        },
        {
          default: () => (row.userType === 1 ? "员工" : "用户"),
        }
      );
    },
  },
  {
    title: "性别",
    key: "sex",
    render(row) {
      return h(
        NTag,
        {
          type: row.sex === 1 ? "success" : "info",
        },
        {
          default: () => (row.sex === 1 ? "男" : "女"),
        }
      );
    },
  },
];
