<template>
  <div class="page">
    <LayoutTable :data='tableData' :config='tableConfig' />
  </div>
</template>

<script>
import table from '@/assets/mixins/table';

export default {
  mixins: [table],
  data() {
    return {
      config: {
        search: [
          {
            name: 'name',
            type: 'text',
            label: '任务名称',
          },
          {
            name: 'status',
            type: 'select',
            label: '任务状态',
          },
        ],
        columns: [
          {
            type: 'selection',
            width: 60,
          },
          {
            prop: 'name',
            label: '任务名称',
          },
          {
            prop: 'excuteHost',
            label: '执行主机',
          },
          {
            prop: 'excuteContainer',
            label: '执行容器',
          },
          {
            prop: 'excuteStrategy',
            label: '执行策略',
            formatter: this.formatter
          },
          {
            prop: 'lastExcuteHost',
            label: '最后执行主机',
          },
          {
            prop: 'lastExcuteTime',
            label: '最后执行时间',
            formatter: this.formatterDate
          },
          {
            prop: 'status',
            label: '执行状态',
            formatter: this.formatter
          },
          {
            label: '操作',
            width: 180,
            formatter: (row)=> {
              return (
                <table-buttons row={row} onEdit={this.toEdit} onDel={this.toDel} />
              )
            },
          },
        ],
      },
    }
  }
}
</script>


