king
2024-07-29 fd1a4a42bbef3e9c02e0fee346b49401ec0fe23f
src/tabviews/zshare/mutilform/index.jsx
@@ -73,7 +73,14 @@
      Object.keys(this.props.data).forEach(key => {
        data[key.toLowerCase()] = this.props.data[key]
      })
    } else if (action.uuid && sessionStorage.getItem('local_' + action.uuid)) {
      let _data = JSON.parse(sessionStorage.getItem('local_' + action.uuid))
      Object.keys(_data).forEach(key => {
        data[key.toLowerCase()] = _data[key]
      })
    }
    if (this.props.BData) {
      Object.keys(this.props.BData).forEach(key => {
        BData[key.toLowerCase()] = this.props.BData[key]
@@ -146,6 +153,7 @@
      // 数据自动填充
      let readin = item.readin !== 'false'
      item.local = item.readin === 'local'
      item.readin = item.readin !== 'false' && item.readin !== 'top'
      item.readonly = check || item.readonly === 'true'
      item.writein = item.writein !== 'false'
@@ -1368,6 +1376,7 @@
  }
  handleConfirm = (formId) => {
    const { action } = this.props
    const { formlist, send_type, timestamp, n_id } = this.state
    // 表单提交时检查输入值是否正确
@@ -1379,6 +1388,7 @@
        }
        let forms = []
        let record = {...this.record, ...values}
        let locals = null
        formlist.forEach(item => {
          if (!item.field || ['hint', 'split', 'formula'].includes(item.type)) return
@@ -1475,12 +1485,21 @@
              value: n_id || ''
            })
          }
          if (item.local) {
            locals = locals || {}
            locals[item.field] = _item.value
          }
    
          forms.push(_item)
        })
        this.submitId = formId || ''
        if (locals) {
          sessionStorage.setItem('local_' + action.uuid, JSON.stringify(locals))
        }
        resolve(forms)
      })
    })