king
2020-03-10 4e1ff4a312e5c5655de7c2ba611bab70415f3eda
src/templates/subtableconfig/actionform/index.jsx
@@ -21,6 +21,7 @@
    formlist: null,
    openType: null,
    interType: null,
    funcType: null,  // 功能类型
    position: null,
    reqOptionSgl: [{
      value: 'requiredSgl',
@@ -90,17 +91,24 @@
    let _intertype = ''
    let _position = ''
    let _tabType = ''
    let _funcType = ''   // 功能按钮类型
    let _options = null
    this.props.formlist.forEach(form => {
      if (form.key === 'OpenType') {
        _opentype = form.initVal
        if (this.props.card.execMode) { // 转换打印时打开方式
          _opentype = 'funcbutton'
        } else {
          _opentype = form.initVal
        }
      } else if (form.key === 'intertype') {
        _intertype = form.initVal
      } else if (form.key === 'position') {
        _position = form.initVal
      } else if (form.key === 'tabType') {
        _tabType = form.initVal
      } else if (form.key === 'funcType') {
        _funcType = form.initVal
      }
    })
@@ -120,6 +128,18 @@
      } else {
        _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
      }
    } else if (_opentype === 'funcbutton') {
      if (!_funcType) {
        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
      } else if (_funcType === 'changeuser') {
        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
      } else if (_funcType === 'print') {
        if (_intertype === 'outer') {
          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
        }
      }
    } else {
      if (_intertype === 'outer') {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
@@ -131,6 +151,7 @@
      openType: _opentype,
      interType: _intertype,
      position: _position,
      funcType: _funcType,
      formlist: this.props.formlist.map(item => {
        if (item.key === 'class') {
          item.options = btnClasses
@@ -176,8 +197,12 @@
            }, {
              value: 'popview',
              text: this.props.dict['header.form.popview']
            }, {
              value: 'funcbutton',
              text: this.props.dict['header.form.funcbutton']
            }
          ]
          item.initVal = _opentype
        } else if (item.key === 'execSuccess') {
          item.options = this.state.closeOptions
        } else if (item.key === 'execError') {
@@ -224,6 +249,18 @@
        } else {
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        }
      } else if (value === 'funcbutton') {
        if (!this.state.funcType) {
          _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
        } else if (this.state.funcType === 'changeuser') {
          _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
        } else if (this.state.funcType === 'print') {
          if (this.state.interType === 'outer') {
            _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
          } else {
            _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
          }
        }
      } else {
        if (this.state.interType === 'inner') {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
@@ -268,7 +305,7 @@
        this.setState({
          formlist: this.state.formlist.map(item => {
            if (item.key === 'Ot') {
            if (item.key === 'Ot' && !(value === 'funcbutton' && (!this.state.funcType || this.state.funcType === 'changeuser'))) {
              item.hidden = false
            } else if (item.key === 'sqlType' && ['prompt', 'exec', 'pop'].includes(value) && this.state.interType === 'inner') {
              item.hidden = false
@@ -332,6 +369,33 @@
          })
        })
      })
    } else if (key === 'funcType') {
      let _options = null
      if (!value) {
        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
      } else if (value === 'changeuser') {
        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
      } else if (value === 'print') {
        if (this.state.interType === 'outer') {
          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
        }
      }
      this.setState({
        formlist: this.state.formlist.map(item => {
          item.hidden = !_options.includes(item.key)
          if (item.hidden) return item
          if (item.key === 'Ot' && value === 'print') {
            item.options = this.state.reqOptionsMutil
          }
          return item
        })
      })
    }
  }
@@ -352,6 +416,12 @@
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        }
      } else if (openType === 'funcbutton') {
        if (value === 'outer') {
          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
        }
      } else {
        if (value === 'inner') {
@@ -571,6 +641,11 @@
            values.Ot = 'notRequired'
          } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id
            values.linkTab = Utils.getuuid()
          } else if (values.OpenType === 'funcbutton') { // 转换打印时打开方式
            values.position = 'toolbar'
            if (values.funcType === 'print') {
              values.OpenType = values.execMode
            }
          }
          if (values.innerFunc === '' && values.sql === '') {