import { h } from 'vue';
import { ElTag } from 'element-plus';

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id',
    fixed: 'left',
    width: 50,
  },
  {
    label: '岗位名称',
    prop: 'name',
    minWidth: 100,
  },
  {
    label: '岗位状态',
    prop: 'status',
    minWidth: 100,
    render(record) {
      return h(
        ElTag,
        {
          type: record.row.status == 1 ? 'success' : 'danger',
        },
        {
          default: () => (record.row.status == 1 ? '正常' : '停用'),
        },
      );
    },
  },
  {
    label: '排序',
    prop: 'sort',
    minWidth: 100,
  },
  {
    label: '创建人',
    prop: 'createUser',
    minWidth: 100,
  },
  {
    label: '创建时间',
    prop: 'createTime',
    width: 180,
  },
];
