king
2020-02-27 822bc67061448c6e3a1eb77d39be4ad2b84b416a
src/templates/comtableconfig/actionform/index.jsx
@@ -20,6 +20,7 @@
    formlist: null,  // 表单信息
    openType: null,  // 打开方式
    interType: null, // 接口类型:内部、外部
    funcType: null,  // 功能类型
    position: null,  // 按钮位置
    reqOptionSgl: [{
      value: 'requiredSgl',
@@ -69,21 +70,28 @@
  
  UNSAFE_componentWillMount () {
    let _opentype = ''
    let _intertype = ''
    let _position = ''
    let _tabType = ''
    let _options = null
    let _opentype = ''   // 打开方式
    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
      }
    })
@@ -109,6 +117,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']
@@ -120,6 +140,7 @@
      openType: _opentype,
      interType: _intertype,
      position: _position,
      funcType: _funcType,
      formlist: this.props.formlist.map(item => {
        if (item.key === 'class') {
          item.options = btnClasses
@@ -147,7 +168,10 @@
            },
            ..._tabs
          ]
        } else if (item.key === 'OpenType') {
          item.initVal = _opentype
        }
        item.hidden = !_options.includes(item.key)
        return item
      })
@@ -175,7 +199,7 @@
   */
  openTypeChange = (key, value) => {
    if (key === 'OpenType') {
      let _options = []
      let _options = null
      if (value === 'innerpage') {
        _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position']
      } else if (value === 'outerpage') {
@@ -195,6 +219,18 @@
          _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 (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') {
@@ -280,12 +316,38 @@
              },
              ..._tabs
            ]
            _fieldval.linkTab = ''
          }
          return item
        })
      }, () => {
        this.props.form.setFieldsValue(_fieldval)
      })
    } 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
        })
      })
    }
  }
@@ -306,6 +368,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') {
@@ -526,6 +594,8 @@
            values.Ot = 'notRequired'
          } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id
            values.linkTab = Utils.getuuid()
          } else if (values.OpenType === 'funcbutton' && values.funcType === 'print') { // 转换打印时打开方式
            values.OpenType = values.execMode
          }
          if (values.innerFunc === '' && values.sql === '') {