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

import dayjs from "dayjs";

const columns = [
  {
    type: "selection",
    width: 55,
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    label: "序号",
    type: "index",
    width: 70,
    hide: ({ checkList }) => !checkList.includes("序号列")
  },
  {
    label: "客户编号",
    prop: "companyNo"
  },
  {
    label: "客户名称",
    prop: "companyName"
  },
  {
    label: "归属集团",
    prop: "parent"
  },
  {
    label: "联系人",
    prop: "contactor"
  },
  {
    label: "创建时间",
    prop: "createTime",
    formatter: ({ createTime }) =>
      dayjs(createTime).format("YYYY-MM-DD HH:mm:ss")
  },
  {
    label: "操作",
    fixed: "right",
    width: 80,
    slot: "operation"
  }
];

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

export default contentConfig;
