king
2024-05-21 8a6ce370f1aa1c061b76fa3e9d2d4d1df53ca4c5
src/tabviews/zshare/mutilform/index.jsx
@@ -148,6 +148,7 @@
      item.readin = item.readin !== 'false' && item.readin !== 'top'
      item.readonly = check || item.readonly === 'true'
      item.writein = item.writein !== 'false'
      item.defHidden = item.hidden === 'true'
      item.hidden = item.hidden === 'true'
      item.fieldlength = item.fieldlength || 50
@@ -403,11 +404,13 @@
          message: item.label + '不可为空!'
        }]
        if (typeof(item.min) === 'number' || typeof(item.max) === 'number') {
        if (typeof(item.min) === 'number' || typeof(item.max) === 'number' || item.notZero === 'true') {
          item.rules.push({
            validator: (rule, value, callback) => {
              if (isNaN(value)) {
                callback()
              } else if (item.notZero === 'true' && value === 0) {
                callback(item.label + '不可为0')
              } else if (typeof(item.min) === 'number' && value < item.min) {
                if (item.min < 1e-6) {
                  if (item.min === 1e-6) {
@@ -508,7 +511,7 @@
        let _hidden = false
        if (supItem.hidden) {
        if (supItem.hidden && !supItem.defHidden) {
          _hidden = true
        } else {
          let box = [...item.values]
@@ -627,7 +630,11 @@
        item.supInitVal = ''
        if (fieldMap.has(item.linkField)) {
          item.supInitVal = fieldMap.get(item.linkField).initval || ''
          let supitem = fieldMap.get(item.linkField)
          item.supInitVal = supitem.initval || ''
          if (supitem.$first) {
            item.$resetSup = true
          }
        } else if (data.hasOwnProperty(item.linkField.toLowerCase())) {
          item.supInitVal = data[item.linkField.toLowerCase()]
        }
@@ -1097,7 +1104,11 @@
        // if (item.type === 'link') {
        if (item.linkField) {
          item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '')
          let supInitVal = item.supInitVal
          if (item.$resetSup) {
            supInitVal = this.record[item.linkField]
          }
          item.options = item.oriOptions.filter(option => option.ParentID === supInitVal || option.value === '')
        // } else if (['select', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) {
        } else {
          item.options = item.oriOptions
@@ -1239,11 +1250,17 @@
      if (item.hidden) return
      if (item.type === 'split') {
        fields.push(
          <Col span={24} key={index}>
            <p className="mk-form-split-line" style={item.style}>{item.label}</p>
          </Col>
        )
        if (item.opacity === 'false') {
          fields.push(
            <div key={index}></div>
          )
        } else {
          fields.push(
            <Col span={24} key={index}>
              <p className="mk-form-split-line" style={item.style}>{item.label}</p>
            </Col>
          )
        }
      } else if (item.type === 'hint') {
        fields.push(
          <Col span={item.span || 24} key={index}>
@@ -1291,7 +1308,7 @@
        } else if (item.type === 'radio') {
          content = (<MKRadio config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>)
        } else if (item.type === 'date' || item.type === 'datemonth') {
          content = (<MKDatePicker config={item} onChange={(val) => this.recordChange({[item.field]: val})} />)
          content = (<MKDatePicker config={item} onChange={(val) => this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit}/>)
        } else if (item.type === 'fileupload') {
          className = item.readonly ? 'readonly' : ''
          className += item.fileType === 'picture-card' ? ' file-upload' : ''