import { h } from 'vue';

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