// 阶梯配置表格列配置
export const getLadderColumnsConfig = ($this) => {
  return [
    {
      label: '目标溶液编号',
      prop: 'targetSolutionCode',
      bodyType: 'input',
      bodySubType: 'span',
      bodySubKey: 'subTargetSolutionCode',
      bodyFillType: 'preFill',
      width: 280
    },
    {
      label: '起始溶液编号',
      prop: 'startSolutionCode',
      width: 280,
      bodyType: 'input',
      bodyFillType: 'actFill',
      bodyMaxlength: 10
    },
    {
      label: '预设起始溶液体积',
      prop: 'targetStartSolutionVolume',
      width: 280,
      headerSelectKey: 'targetStartSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyType: 'inputNumber',
      bodySubType: 'inputNumber',
      bodySubKey: 'targetStartSolutionVolumePrecision',
      bodyFillType: 'preFill',
      bodySubFillType: 'preFill',
      showBodySub: $this.fillType === 'preFill',
      bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
      bodyMaxlength: 10,
      bodyDisabled: true,
      bodySubPlaceholder: '请输入保留小数位数'
    },
    {
      label: '实际起始溶液体积',
      prop: 'actStartSolutionVolume',
      width: 280,
      headerSelectKey: 'actStartSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyType: 'inputNumber',
      bodyFillType: 'actFill',
      bodyMaxlength: 10,
      copyFrom: 'targetStartSolutionVolume', //复制哪个字段
      compareTo: 'targetStartSolutionVolume' //比较哪个字段
    },
    {
      label: '预设稀释液体积',
      prop: 'targetDiluentVolume',
      width: 280,
      headerSelectKey: 'targetDiluentVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyDisabled: true,
      bodyType: 'inputNumber',
      bodySubType: 'inputNumber',
      bodySubKey: 'targetDiluentVolumePrecision',
      bodyFillType: 'preFill',
      bodySubFillType: 'preFill',
      showBodySub: $this.fillType === 'preFill',

      bodyPrecisionKey: 'targetDiluentVolumePrecision',
      bodyMaxlength: 10,
      bodySubPlaceholder: '请输入保留小数位数'
    },
    {
      label: '实际稀释液体积',
      prop: 'actDiluentVolume',
      width: 280,
      headerSelectKey: 'actDiluentVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyType: 'inputNumber',
      bodyFillType: 'actFill',
      bodyMaxlength: 10,
      copyFrom: 'targetDiluentVolume', //复制哪个字段
      compareTo: 'targetDiluentVolume', //比较哪个字段
    },
    {
      label: '预设目标溶液浓度',
      prop: 'targetSolutionConcentration',
      width: 280,
      headerSelectKey: 'targetSolutionConcentrationUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_nddw'),
      bodyType: 'inputNumber',
      bodyFillType: 'preFill',
      bodyMaxlength: 10
    },
    {
      label: '实际目标溶液浓度',
      prop: 'actSolutionConcentration',
      width: 280,
      headerSelectKey: 'actSolutionConcentrationUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_nddw'),
      bodyDisabled: true,
      bodyType: 'inputNumber',
      bodySubType: 'inputNumber',
      bodySubKey: 'actSolutionConcentrationPrecision',
      bodyFillType: 'actFill',
      bodySubFillType: 'preFill',
      showBodySub: $this.fillType === 'preFill',

      bodyPrecisionKey: 'actSolutionConcentrationPrecision',
      bodyMaxlength: 10,
      bodySubPlaceholder: '请输入保留小数位数',
      compareTo: 'targetSolutionConcentration', //比较哪个字段
    },
    {
      label: '预设目标溶液体积',
      prop: 'targetSolutionVolume',
      width: 280,
      headerSelectKey: 'targetSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyType: 'inputNumber',
      bodyFillType: 'preFill',
      bodyMaxlength: 10
    },
    {
      label: '实际目标溶液体积',
      prop: 'actSolutionVolume',
      width: 280,
      headerSelectKey: 'actSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyDisabled: true,
      bodyType: 'inputNumber',
      bodySubType: 'inputNumber',
      bodySubKey: 'actSolutionVolumePrecision',
      bodyFillType: 'actFill',
      bodySubFillType: 'preFill',
      showBodySub: $this.fillType === 'preFill',

      bodyPrecisionKey: 'actSolutionVolumePrecision',
      bodyMaxlength: 10,
      copyFrom: 'targetSolutionVolume', //复制哪个字段
      bodySubPlaceholder: '请输入保留小数位数',
      compareTo: 'targetSolutionVolume', //比较哪个字段
    }
  ]
}
// 平行配置表格列配置
export const getParallelColumnsConfig = ($this) => {
  return [
    {
      label: '目标溶液编号',
      prop: 'targetSolutionCode',
      bodyType: 'select',
      bodyOptions: $this.getDictOptions('business_sp_nbgzy'),
      bodySubType: 'span',
      bodySubKey: 'subTargetSolutionCode',
      bodyFillType: 'preFill',
      width: 280
    },
    {
      label: '预设目标溶液浓度',
      prop: 'targetSolutionConcentration',
      width: 280,
      headerSelectKey: 'targetSolutionConcentrationUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_nddw'),
      bodyType: 'inputNumber',
      bodyFillType: 'preFill',
      bodyMaxlength: 10
    },
    {
      label: '实际目标溶液浓度',
      prop: 'actSolutionConcentration',
      width: 280,
      headerSelectKey: 'actSolutionConcentrationUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_nddw'),
      bodyDisabled: true,
      bodyType: 'inputNumber',
      bodySubType: 'inputNumber',
      bodySubKey: 'actSolutionConcentrationPrecision',
      bodyFillType: 'actFill',
      bodySubFillType: 'preFill',
      showBodySub: $this.fillType === 'preFill',
      bodyPrecisionKey: 'actSolutionConcentrationPrecision',
      bodyMaxlength: 10,
      bodySubPlaceholder: '请输入保留小数位数',
      compareTo: 'targetSolutionConcentration', //比较哪个字段
    },
    {
      label: '预设目标溶液体积',
      prop: 'targetSolutionVolume',
      width: 280,
      headerSelectKey: 'targetSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyType: 'inputNumber',
      bodyFillType: 'preFill',
      bodyMaxlength: 10
    },
    {
      label: '实际目标溶液体积',
      prop: 'actSolutionVolume',
      width: 280,
      headerSelectKey: 'actSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      bodyDisabled: true,
      bodyType: 'inputNumber',
      bodySubType: 'inputNumber',
      bodySubKey: 'actSolutionVolumePrecision',
      bodyFillType: 'actFill',
      bodySubFillType: 'preFill',
      showBodySub: $this.fillType === 'preFill',
      bodyPrecisionKey: 'actSolutionVolumePrecision',
      bodyMaxlength: 10,
      bodySubPlaceholder: '请输入保留小数位数',
      compareTo: 'targetSolutionVolume', //比较哪个字段
    },
    {
      label: '目标溶液有效周期',
      prop: 'targetSolutionCycle',
      width: 280,
      fillType: 'preFill',
      bodyType: 'inputNumber',
      bodySubType: 'select',
      showBodySub: true,
      bodySubKey: 'targetSolutionCyclePrecision',
      bodySubOptions: $this.getDictOptions('business_yxqdw'),
      bodyFillType: 'preFill',
      bodySubFillType: 'preFill',
      bodyMaxlength: 10
    },
    {
      label: '目标溶液失效日',
      prop: 'targetSolutionExpirationDate',
      width: 280,
      bodyType: 'span'
    },
    {
      label: '预设原始溶液编号',
      prop: 'startSolutionCode',
      width: 280,
      bodyType: 'input',
      bodyFillType: 'preFill'
    },
    {
      label: '实际原始溶液编号',
      prop: 'actStartSolutionCode',
      width: 280,
      bodyType: 'clickable',
      bodyFillType: 'actFill',
      compareTo: 'startSolutionCode', //比较哪个字段
    },
    {
      label: '预设原始溶液浓度',
      prop: 'targetStartSolutionConcentration',
      width: 280,
      bodyType: 'inputNumber',
      bodyFillType: 'preFill',
      bodySubType: 'select',
      bodySubKey: 'targetStartSolutionConcentrationPrecision',
      bodySubOptions: $this.getDictOptions('business_nddw'),
      bodySubFillType: 'preFill',
      bodyMaxlength: 10,
      showBodySub: true
    },
    {
      label: '实际原始溶液浓度',
      prop: 'targetAcSolution',
      width: 280,
      bodyType: 'inputNumber',
      bodyFillType: 'actFill',
      bodyDisabled: true,
      compareTo: 'targetStartSolutionConcentration', //比较哪个字段
    },
    {
      label: '预设原始溶液体积',
      prop: 'targetStartSolutionVolume',
      headerSelectKey: 'targetStartSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      width: 280,
      bodyType: 'inputNumber',
      bodyFillType: 'preFill',
      bodySubType: 'inputNumber',
      bodySubKey: 'targetStartSolutionVolumePrecision',
      bodySubFillType: 'preFill',
      bodyMaxlength: 10,
      bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
      bodyMaxlength: 10,
      bodySubPlaceholder: '请输入保留小数位数',
      bodyDisabled: true,
      showBodySub: true,
      showBodySub: $this.fillType === 'preFill'
    },

    {
      label: '实际原始溶液体积',
      prop: 'actStartSolutionVolume',
      headerSelectKey: 'actStartSolutionVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      width: 280,
      bodyType: 'inputNumber',
      bodyFillType: 'actFill',
      bodyMaxlength: 10,
      compareTo: 'targetStartSolutionVolume', //比较哪个字段
      copyFrom: 'targetStartSolutionVolume' //复制哪个字段
    },

    {
      label: '预计稀释液体积',
      prop: 'targetDiluentVolume',
      headerSelectKey: 'preDiluentVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      width: 280,
      bodyType: 'inputNumber',
      bodyFillType: 'preFill',
      bodySubType: 'inputNumber',
      bodySubKey: 'targetDiluentVolumePrecision',
      bodySubFillType: 'preFill',
      bodyMaxlength: 10,
      bodyPrecisionKey: 'targetDiluentVolumePrecision',
      bodySubPlaceholder: '请输入保留小数位数',
      bodyDisabled: true,
      showBodySub: $this.fillType === 'preFill'
    },
    {
      label: '实际稀释液体积',
      prop: 'actDiluentVolume',
      headerSelectKey: 'actDiluentVolumeUnit',
      fillType: 'preFill',
      headerOptions: $this.getDictOptions('business_tjdw'),
      width: 280,
      bodyType: 'inputNumber',
      bodyFillType: 'actFill',
      bodyMaxlength: 10,
      compareTo: 'targetDiluentVolume' //比较哪个字段
    }
  ]
}

//阶梯配置
export const getLadderFormConfig = ($this) => {
  return [
    {
      type: 'step',
      config: {
        startSolution: {
          label: '起始源溶液',
          type: 'input',
          fillType: 'preFill',
          subType: 'clickable',
          subKey: 'subStartSolution',
          subFillType: 'actFill',
          maxlength: 20
        },
        targetStartSolution: {
          label: '预设起始源溶液浓度',
          type: 'inputNumber',
          subType: 'select',
          fillType: 'preFill',
          subOptions: $this.getDictOptions('business_nddw'),
          subKey: 'subTargetStartSolution',
          maxlength: 10
        },
        targetAcSolution: {
          label: '实际起始源溶液浓度',
          type: 'input',
          fillType: 'actFill',
          disabled: true,
          maxlength: 10,
          compareTo: 'targetStartSolution', //比较哪个字段
        },
        solution: {
          label: '稀释液',
          type: 'input',
          fillType: 'preFill',
          subType: 'clickable',
          subKey: 'subSolution',
          subFillType: 'actFill',
          maxlength: 20
        },
        stepStorageCondition: {
          label: '存储条件',
          type: 'select',
          fillType: 'preFill',
          options: $this.getDictOptions('business_cctj'),
          otherCode: 'stepStorageConditionOther'
        },

        effectivePeriod: {
          label: '目标溶液有效周期',
          type: 'input',
          subType: 'select',
          subKey: 'effectivePeriodUnit',
          fillType: 'preFill',
          subOptions: $this.getDictOptions('business_yxqdw')
        },
        expireDate: {
          label: '目标溶液失效日',
          type: 'input'
        }
      }
    }
  ]
}

//试验基本信息
export const getBaseInfoFormConfig = ($this) => {
  return [
    {
      type: 'cardItem',
      config: {
        studyMc: {
          label: '试验名称',
          type: 'input',
          disabled: true
        },
        studySn: {
          label: '试验编号',
          type: 'input',
          disabled: true
        },
        methodCode: {
          label: '方法编号',
          type: 'input',
          fillType: 'preFill',
          maxlength: 50
        },
        versionNum: {
          label: '版本号',
          type: 'inputNumber',
          fillType: 'actFill',
          prepend: 'V',
          maxlength: 50
        }
      }
    },
    {
      type: 'conditionItem',
      label: '试验配制条件',
      config: {
        pre: {
          label: '预填',
          type: 'select',
          multiple: true,
          fillType: 'preFill',
          options: $this.getDictOptions('business_pztj'),
          otherCode: 'preOther'
        },
        act: {
          label: '实际',
          type: 'select',
          fillType: 'actFill',
          otherCode: 'actOther',
          multiple: true,
          options: $this.getDictOptions('business_pztj')
        }
      }
    },
    {
      type: 'conditionItem',
      label: '容器材质',
      config: {
        containerMaterial: {
          label: '容器材质',
          type: 'select',
          options: $this.getDictOptions('business_rqcz'),
          fillType: 'actFill',
          multiple: true,
          otherCode: 'containerMaterialOther'
        }
      }
    },
    {
      type: 'cellItem',
      label: '处理时间',
      config: {
        startDate: {
          label: '开始时间',
          type: 'input'
        },
        endDate: {
          label: '结束时间',
          type: 'input'
        }
      }
    }
  ]
}

//备注config
export const getRemarkFormConfig = () => {
  return [
    {
      type: 'cellItem',
      config: {
        remark: {
          label: '',
          type: 'textarea',
          fillType: 'actFill',
          span: 1,
          placeholder: '请输入备注',
          maxlength: 1000,
          rows: 5
        }
      }
    }
  ]
}

//存储条件
export const getStorageConditionFormConfig = ($this) => {
  return [
    {
      type: 'conditionItem',
      config: {
        storageCondition: {
          label: '存储条件',
          type: 'select',
          fillType: 'preFill',
          options: $this.getDictOptions('business_cctj'),
          otherCode: 'othersSorageCondition'
        }
      }
    }
  ]
}

//并行步骤配置
export const getParalleStepFormConfig = ($this) => {
  return [
    {
      type: 'step',
      config: {
        solution: {
          label: '稀释液',
          type: 'input',
          fillType: 'preFill',
          subType: 'clickable',
          subKey: 'subSolution',
          subFillType: 'actFill',
          maxlength: 20
        },
        paralleStepStorageCondition: {
          label: '存储条件',
          type: 'select',
          fillType: 'preFill',
          options: $this.getDictOptions('business_cctj'),
          otherCode: 'paralleStepStorageConditionOther'
        }
      }
    }
  ]
}
