import { h } from 'vue';
import { ElTag } from 'element-plus';
import { BasicColumn } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    label: '岗位编码',
    prop: 'postCode',
  },
  {
    label: '岗位名称',
    prop: 'postName',
  },
  {
    label: '排序',
    prop: 'orderNum',
  },
  {
    label: '状态',
    prop: 'isEnable',
    render(record) {
      return h(
        ElTag,
        {
          type: record.row.isEnable ? 'success' : 'danger',
        },
        {
          default: () => (record.row.isEnable ? '启用' : '禁用'),
        },
      );
    },
  },
  {
    label: '创建时间',
    prop: 'createDate',
  },
];
