king
2020-10-23 407c0f1765c7d085218a91ad8842784977383d05
src/templates/formtabconfig/actionform/index.jsx
@@ -56,13 +56,15 @@
  UNSAFE_componentWillMount () {
    const { card } = this.props
    let _intertype = ''
    let _options = null
    let _success = 'close'
    let _error = 'notclose'
    this.props.formlist.forEach(form => {
      if (form.key === 'intertype') {
        _intertype = form.initVal
        if (card.btnType !== 'confirm') {
          form.options = form.options.filter(op => op.value !== 'system')
        }
      } else if (form.key === 'afterExecSuccess') {
        _success = form.initVal
      } else if (form.key === 'afterExecError') {
@@ -70,21 +72,7 @@
      }
    })
    if (card.btnType === 'cancel') {
      _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess']
    } else if (card.btnType === 'confirm') {
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
      }
    } else {
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      }
    }
    let _options = this.getOptions(card.btnType, _intertype)
    this.setState({
      formlist: this.props.formlist.map(item => {
@@ -144,6 +132,30 @@
    }
  }
  getOptions = (btnType, intertype) => {
    let _options = []
    if (btnType === 'cancel') {
      _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess']
    } else if (btnType === 'confirm') {
      if (intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      } else if (intertype === 'system') {
        _options = ['label', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      }
    } else {
      if (intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      }
    }
    return _options
  }
  selectChange = (key, value) => {
    if (key === 'afterExecSuccess') {
      this.setState({
@@ -188,21 +200,7 @@
    let value = e.target.value
    if (key === 'intertype') {
      let _options = null
      if (card.btnType === 'confirm') {
        if (value === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
        }
      } else {
        if (value === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
        }
      }
      let _options = this.getOptions(card.btnType, value)
      this.setState({
        interType: value,
@@ -213,9 +211,9 @@
            item.readonly = false
          } else if (item.key === 'sysInterface') {
            item.initVal = 'false'
          } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'inner') {
          } else if (item.key === 'innerFunc' && value === 'inner') {
            item.required = true
          } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'outer') {
          } else if (item.key === 'innerFunc' && value === 'outer') {
            item.required = false
          }