import { ContentConfig } from "/@/components/PageContent";
import { httpList } from "/@/api/parameter/clients";

import dayjs from "dayjs";
import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";

const columns = [
  {
    type: "selection",
    width: 40,
    align: "center",
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    label: "序号",
    type: "index",
    width: 70,
    hide: ({ checkList }) => !checkList.includes("序号列")
  },
  // {
  //   label: "客户编码",
  //   width: 150,
  //   prop: "companyNo"
  // },
  {
    label: "客户公司",
    prop: "companyName",
    ...renderIconLabelLeft('companyNo', 'companyName', '客户公司编号:')
  },
  {
    label: "归属集团",
    prop: "parent"
  },
  {
    label: "创建时间",
    prop: "createTime",
    formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
  }
];

const contentConfig: ContentConfig = {
  title: "企业客户",
  columns,
  apis: {
    httpList
  }
};

export default contentConfig;
