import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';

export default ($this) => {
  return [
    {
      formType: 'list',
      className: 'float-none',
      // arrList: [
        // {
        //   medicinesName: '吗丁啉',
        //   dosageDay: 3,
        //   dosageNum: 1,
        // }
      // ],
      prop: 'arrList',
      model: 'arrList',
      label: '',
      disabled: true,
      spanNum: 24,
      rules: [{required: false, message: '', trigger: ['submit','change']}],
      clickDeleteFunc: () => {
      }
    },
    {
      formType: 'button',
      className: 'float-none',
      prop: 'followUpOrgName',
      model: 'followUpOrgName',
      icon: 'el-icon-circle-plus',
      btnText: '点击添加',
      disabled: false,
      spanNum: 12,
      maxlength: 30,
      type: 'text',
      labmsg: '次',
      clickFunc: () => {
        $this.addComponents.forEach((item,index)=>{
          if(item.name == 'diabetesSourseMedicationUse'){
            if($this.addComponents[index].formObject.arrList.length >= 3) {
              $this.$message.warning('最多只可添加3种药物!')
            }else {
              $this.dialogFormVisible = true;
            }
          }
        })
      }
    },
    {
      formType: 'div',
      name: '胰岛素',
      className: 'sec-title',
    },
    {
      formType: 'input',
      className: 'float-none',
      prop: 'medicinesName',
      model: 'medicinesName',
      label: '种类：',
      disabled: false,
      placeholder: '请输入胰岛素种类',
      spanNum: 12,
      maxlength: 10,
      type: 'text',
      labmsg: '次',
      rules: [{required: true, message: '请输入胰岛素种类', trigger: ['submit','change']}],
    },
    {
      formType: 'input',
      className: 'float-none',
      prop: 'dosageDay',
      model: 'dosageDay',
      label: '用法：',
      disabled: false,
      placeholder: '请输入胰岛素用法',
      spanNum: 12,
      maxlength: 10,
      type: 'text',
      labmsg: '次',
      rules: [{required: true, message: '请输入胰岛素用法', trigger: ['submit','change']}],
    },
    {
      formType: 'input',
      className: 'float-none',
      prop: 'dosageNum',
      model: 'dosageNum',
      label: '用量：',
      disabled: false,
      placeholder: '请输入胰岛素用量',
      spanNum: 12,
      maxlength: 10,
      type: 'text',
      labmsg: '次',
      rules: [{required: true, message: '请输入胰岛素用量', trigger: ['submit','change']}],
    },
  ]
}

