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

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id'
  },
  {
    label: '任务名称',
    prop: 'jobName',
  },
  {
    label: '任务组名',
    prop: 'jobGroup',
  },
  {
    label: '任务触发器',
    prop: 'jobTrigger',
  },
  {
    label: '任务信息',
    prop: 'jobMessage',
  },
  {
    label: '执行状态',
    prop: 'status',
    render(record) {
      let typeText = ''
      switch (record.row.status) {
        case 0:
          typeText='未发布'
          break;
        case 1:
          typeText='运行中'
          break;
        case 2:
          typeText='暂停'
          break;
        case 3:
          typeText='删除'
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    label: '执行时间',
    prop: 'startTime',
  },
];
