/* eslint-disable prettier/prettier */
import { h } from "vue"
import { ContentConfig } from "/@/components/PageContent";
import apis from "./apis";
import { ElTag } from "element-plus";

const statusOptions = [
  { value: '1', label: "数据未入报表" },
  { value: '2', label: "数据已入报表" },
]

const departTypeOptions = [
  { value: "1", label: "客服部@百辰荣达" },
  { value: "2", label: "新媒体" },
  { value: "3", label: "项目部@普润心堂" },
  { value: "4", label: "销售部" },
]

const columns = [
  {
    prop: "orderCode",
    label: "资金认领编号",
    minWidth: "155px"
  },
  {
    prop: 'status',
    label: '状态',
    minWidth: '155px',
    cellRenderer: ({ row }) => {
      return h(ElTag, null, {
        default: () => statusOptions.find((item) => item.value === String(row.status)).label
      })
    }
  },
  {
    prop: 'before',
    label: '提成系数(修改前)',
    minWidth: '155px'
  },
  {
    prop: 'after',
    label: '提成系数(修改后)',
    minWidth: '155px'
  },
  {
    prop: 'depart_type',
    label: '部门',
    minWidth: '155px',
    cellRenderer({ row }) {
      return departTypeOptions.find((item) => item.value === String(row.depart_type))?.label || "--"
    }
  },
  {
    prop: 'apply_name',
    label: '创建人',
    minWidth: '155px'
  },
  {
    prop: 'depart_name',
    label: '创建人所在部门',
    minWidth: '155px'
  },
  {
    prop: 'addtime',
    label: '创建时间',
    minWidth: '155px'
  }
]


const contentConfig: ContentConfig = {
  columns,
  responseCode: 1,
  showTitle: false,
  superUserNoAction: false,
  apis: { httpList: apis.list }
};


export default contentConfig;
