/* eslint-disable prettier/prettier */
import { BeforeRequestType, ContentConfig } from "/@/components/PageContent";
import { isBeyondTime } from "/@/views/reportCollection/_utils";
import apis from "./apis";

const options = [
  { value: "0", label: "待执行" },
  { value: "1", label: "执行中" },
  { value: "2", label: "执行完成" }
]

const columns = [
  {
    prop: 'id',
    label: 'ID',
    minWidth: '80px'
  },
  {
    prop: 'rep_name',
    label: '报表名称',
    minWidth: '155px'
  },
  {
    prop: 'status',
    label: "状态",
    cellRenderer({ row }) {
      return options.find(({ value }) => String(row.status) === value)?.label || "--"
    }
  },
  {
    prop: 'start',
    label: '开始时间',
    minWidth: '155px'
  },
  {
    prop: 'end',
    label: '结束时间',
    minWidth: '155px'
  },
  {
    label: "操作",
    fixed: "right",
    slot: "operation",
    width: 90
  }
]


const contentConfig: ContentConfig = {
  columns,
  showTitle: false,
  responseCode: 1,
  superUserNoAction: false,
  // beforeRequestList(params) {
  //   const { start, end } = params;
  //   const beyondTime = isBeyondTime({ name: "下单时间", len: 30, start, end });
  //   if (beyondTime) return BeforeRequestType.EMPTY
  //   return BeforeRequestType.NEXT;
  // },
  apis: { httpList: apis.list }
};


export default contentConfig;
