export default function useColumns() {
  const SearchColumns = [
    {
      item: { key: "customerName", title: "医院名称", },
      attr: {
        is: "el-popover-select-v2",
        valueKey: "name",
        referName: "MkCustomerRule",
        dataMapping: {
          customer: 'id',
        },
        placeholder: "请输入医院名称",
        clearable: true,
      },
    },
    {
      item: { key: "effectiveState", title: "有效状态", },
      attr: {
        is: "el-select",
        dictName: "mk_bo_effectivestate",
        clearable: true,
      },
    },
    {
      item: { key: "productionLineName", title: "产线", },
      attr: {
        is: "el-popover-tree-select",
        valueKey: "name",
        referName: "PRODUCTLINE",
        dataMapping: {
          productionLine: 'id',
        },
        placeholder: "请输入产线",
        clearable: true,
      },
    },
    {
      item: { key: "rivalName", title: "供应商名称", },
      attr: {
        is: "el-popover-select-v2",
        valueKey: "name",
        referName: "MKRIVAL_PARAM",
        dataMapping: {
          rival: 'id',
        },
        placeholder: "请输入供应商",
        clearable: true,
      },
    },
    {
      item: { key: "dateRange", title: "创建日期范围", span: 12, },
      attr: {
        is: "el-date-picker",
        type: "datetimerange",
        valueFormat: "yyyy-MM-dd HH:dd:ss",
        rangeSeparator: "至",
        startPlaceholder: "开始日期",
        endPlaceholder: "结束日期",
        clearable: true,
      },
    },
  ];

  const TableColumns = [
    {
      item: { key: "effectiveState", title: "有效状态", width: 80, },
      attr: {
        is: "el-dict-tag",
        dictName: "mk_bo_effectivestate",
      },
    },
    {
      item: { key: "customerName", title: "医院名称", },
      attr: {},
    },
    {
      item: { key: "productionLineName", title: "产线", },
      attr: {},
    },
    {
      item: { key: "rivalName", title: "供应商", },
      attr: {},
    },
    {
      item: { key: "customerBulk", title: "医院营收总额/年（万元）", },
      attr: {},
    },
    {
      item: { key: "rivalBulk", title: "供应商体量/年（万元）", },
      attr: {},
    },
    {
      item: { key: "consumableBulk", title: "耗材体量/年（万元）", },
      attr: {},
    },
    {
      item: { key: "sectionName", title: "科室", },
      attr: {},
    },
    {
      item: { key: "sectionKeyPsnname", title: "科室关键人姓名", },
      attr: {},
    },
    {
      item: { key: "sectionKeyPsnphone", title: "科室关键人联系电话", },
      attr: {},
    },
    {
      item: { key: "hospitalKeyPsnname", title: "院级关键人姓名", },
      attr: {},
    },
    {
      item: { key: "hospitalKeyPsnphone", title: "院级关键人联系电话", },
      attr: {},
    },
    {
      item: { key: "rivalKeyPsnname", title: "供应商关键人姓名", },
      attr: {},
    },
    {
      item: { key: "rivalKeyPsnphone", title: "供应商关键人联系电话", },
      attr: {},
    },
    {
      item: { key: "idea", title: "开发思路（营销策略）", },
      attr: {},
    },
    {
      item: { key: "chance", title: "机会点/困难点所需资源", },
      attr: {},
    },
    {
      item: { key: "remark", title: "备注", },
      attr: {},
    },
    {
      item: { key: "createByName", title: "创建人", width: 100, },
      attr: {},
    },
    {
      item: { key: "createTime", title: "创建时间", },
      attr: {},
    },
    {
      item: { key: "updateByName", title: "最后修改人", width: 100, },
      attr: {},
    },
    {
      item: { key: "updateTime", title: "最后修改时间", },
      attr: {},
    },
  ].map(({ item, attr }) => ({
    attr,
    item: {
      ...item,
      sortabled: true,
      fixedabled: true,
      filterabled: true,
      hiddenabled: true,
    },
  }));
  return { SearchColumns, TableColumns }
}