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

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id'
  },
  {
    label: '参数名称',
    prop: 'name',
  },
  {
    label: '参数编码',
    prop: 'code',
  },
  {
    label: '参数值',
    prop: 'value',
  },
  {
    label: '参数类型',
    prop: 'type',
    render(record) {
      return h(
        ElTag,
        {
          type: record.row.type == 0 ? 'primary' : 'warning',
        },
        {
          default: () => (record.row.type == 0 ? '系统' : '业务'),
        },
      );
    },
  },
  {
    label: '参数状态',
    prop: 'status',
    render(record) {
      return h(
        ElTag,
        {
          type: record.row.status ==1 ? 'success' : 'danger',
        },
        {
          default: () => (record.row.status ==1 ? '正常' : '禁用'),
        },
      );
    },
  },
  {
    label: '排序',
    prop: 'sort',
  },
  {
    label: '备注',
    prop: 'note',
  },
  {
    label: '创建人',
    prop: 'createUser',
  },
  {
    label: '创建时间',
    prop: 'createTime',
    width: 180,
  },
];
