export default function useColumns() {
  const FormColumns = [
    {
      item: { key: "customerName", title: "医院名称", },
      attr: {
        is: "el-popover-select-v2",
        valueKey: "name",
        referName: "MkCustomerRule",
        dataMapping: {
          customer: 'id',
        },
        placeholder: "请输入医院名称",
      },
    },
    {
      item: { key: "productionLineName", title: "产线", },
      attr: {
        is: "el-popover-tree-select",
        valueKey: "name",
        referName: "PRODUCTLINE",
        dataMapping: {
          productionLine: 'id',
        },
        placeholder: "请输入产线",
      },
    },
    {
      item: { key: "rivalName", title: "供应商名称", },
      attr: {
        is: "el-popover-select-v2",
        valueKey: "name",
        referName: "MKRIVAL_PARAM",
        dataMapping: {
          rival: 'id',
        },
        placeholder: "请输入供应商",
      },
    },
    {
      item: { key: "customerBulk", title: "医院营收总额/年（万元）", },
      attr: {
        is: "el-input-number",
        step: 1,
        precision: 2,
      },
    },
    {
      item: { key: "rivalBulk", title: "供应商体量/年（万元）", },
      attr: {
        is: "el-input-number",
        step: 1,
        precision: 2,
      },
    },
    {
      item: { key: "consumableBulk", title: "耗材体量/年（万元", },
      attr: {
        is: "el-input-number",
        step: 1,
        precision: 2,
      },
    },
    {
      item: { key: "sectionName", title: "科室", },
      attr: {
        is: "el-popover-select-v2",
        valueKey: "name",
        referName: "MkCustomersDepartmentRule",
        dataMapping: {
          section: 'id',
        },
        placeholder: "请选择科室",
      },
    },
    {
      item: { key: "sectionKeyPsnname", title: "科室关键人姓名", },
      attr: {
        is: "el-input",
        placeholder: "请输入科室关键人姓名",
      },
    },
    {
      item: { key: "sectionKeyPsnphone", title: "科室关键人联系电话", },
      attr: {
        is: "el-input",
        placeholder: "请输入科室关键人联系电话",
      },
    },
    {
      item: { key: "hospitalKeyPsnname", title: "院级关键人姓名", },
      attr: {
        is: "el-input",
        placeholder: "请输入院级关键人姓名",
      },
    },
    {
      item: { key: "hospitalKeyPsnphone", title: "院级关键人联系电话", },
      attr: {
        is: "el-input",
        placeholder: "请输入院级关键人联系电话",
      },
    },
    {
      item: { key: "rivalKeyPsnname", title: "供应商关键人姓名", },
      attr: {
        is: "el-input",
        placeholder: "请输入供应商关键人姓名",
      },
    },
    {
      item: { key: "rivalKeyPsnphone", title: "供应商关键人联系电话", },
      attr: {
        is: "el-input",
        placeholder: "请输入供应商关键人联系电话",
      },
    },
    {
      item: { key: "idea", title: "开发思路（营销策略）", span: 24, },
      attr: {
        is: "el-input",
        type: "textarea",
        placeholder: "请输入开发思路（营销策略）",
      },
    },
    {
      item: { key: "chance", title: "机会点/困难点所需资源", span: 24, },
      attr: {
        is: "el-input",
        type: "textarea",
        placeholder: "请输入机会点/困难点所需资源",
      },
    },
    {
      item: { key: "remark", title: "备注", span: 24, },
      attr: {
        is: "el-input",
        type: "textarea",
        placeholder: "请输入备注",
      },
    },
  ].map(({ item, attr }) => ({
    attr,
    item: {
      ...item,
      span: item.span || 6,
    }
  }));

  const TabColumns = [
    {
      item: { key: "gatherCgItem", title: "品牌信息", },
      attr: { value: [] },
      TableColumns: [
        {
          item: { key: "brandName", title: "品牌名称", width: 200, },
          attr: {},
        },
        {
          item: { key: "brandPortion", title: "品牌份额(万)", },
          attr: {
            isSummary: true,
          },
        },
        {
          item: { key: "cooperationstart", title: "合作期跟(开始)", },
          attr: {},
        },
        {
          item: { key: "cooperationEnd", title: "合作期限(结束)", },
          attr: {},
        },
      ],
    },
  ];
  return { FormColumns, TabColumns }
}