/* eslint-disable prettier/prettier */
import { ContentConfig } from "/@/components/PageContent";

// import { httpList } from "/@/api/dashboard/accountsReceivable";
import { addition, unit2TenThousand } from "/@/utils/calc";
import { createHttpRequest } from "/@/views/time/_http";

const httpList = createHttpRequest("admin/DepartReport/log");

const options = [
  { value: "1", label: '部门报表' },
  { value: "2", label: '业务公司报表' }
]

const columns = [
  {
    label: "记录ID",
    prop: "id",
    with: "120px"
  },
  {
    label: "推送模板名称",
    prop: "report_name",
    with: "160px",
    cellRenderer({ row }) {
      return row.report.report_name;
    }
  },
  {
    label: "模板类型",
    width: '90px',
    cellRenderer({ row }) {
      return options.find(({ value }) => String(row.report_type) === String(value))?.label || '--'
    }
  },
  {
    label: "推送状态",
    prop: "status",
    with: "80px",
    cellRenderer({ row }) {
      return String(row.status) === "1" ? "推送成功" : "推送失败";
    }
  },
  {
    label: "推送人",
    with: "80px",
    prop: "user_name"
  },
  {
    label: "推送时间",
    with: "140px",
    prop: "createtime"
  },
  {
    label: "推送内容",
    "min-with": "150px",
    prop: "content"
  },
  {
    label: "推送失败原因",
    with: "140px",
    prop: "msg"
  },
  {
    label: "操作",
    fixed: "right",
    width: 60,
    slot: "operation"
  }
];

const contentConfig: ContentConfig = {
  superUserNoAction: false,
  columns,
  apis: {
    httpList
  }
};

export default contentConfig;
