export default function useColumns() {

  // 科室信息
  const FormColumns = [
    {
      item: { key: "name", title: "科室名称", required: true },
      attr: {
        is: "el-input",
        clearable: true,
        placeholder: "请输入科室名称",
      },
    },
    {
      item: { key: "customersName", title: "客户名称" },
      attr: {
        is: "el-input",
        disabled: true,
      },
    },
    {
      item: { key: "responsiblePersonName", title: "负责人姓名" },
      attr: {
        is: "el-popover-select-v2",
        referName: "MKCMCONTACTS_PARAM",
        valueKey: "name",
        dataMapping: {
          responsiblePerson: 'id',
          responsiblePersonName: 'name',
          phone: 'cell'
        },
        placeholder: "请选择负责人",
      },
    },
    {
      item: { key: "phone", title: "联系人手机", },
      attr: {
        is: "el-input",
        clearable: true,
        placeholder: "请输入联系人手机",
        rules: [
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: "请输入正确的手机号码",
            trigger: "blur",
          },
        ]
      },
    },
    {
      item: { key: "address", title: "科室位置" },
      attr: {
        is: "el-input",
        clearable: true,
        placeholder: "请输入科室位置",
      },
    },
    {
      item: { key: "conventionalTherapy", title: "常规治疗" },
      attr: {
        is: "el-input",
        clearable: true,
        placeholder: "请输入常规治疗",
      },
    },
    {
      item: { key: "characteristic", title: "科室特色" },
      attr: {
        is: "el-input",
        clearable: true,
        placeholder: "请输入科室特色",
      },
    },
    {
      item: { key: "createByName", title: "业务员名称" },
      attr: {
        is: "el-input",
        disabled: true,
      },
    },
    {
      item: { key: "memo", title: "备注" },
      attr: {
        is: "el-input",
        clearable: true,
        placeholder: "请输入备注",
      },
    },
  ].map(({ item, attr }) => ({
    attr,
    item: {
      ...item,
      span: item.span || 6
    }
  }));

  return { FormColumns }
}