king
2021-06-19 87c445887fe8d724ea124535234df974d3e1d58e
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -8,15 +8,15 @@
const { TextArea } = Input
const actionTypeOptions = {
  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width', 'controlField', 'controlVal'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'controlField', 'controlVal'],
  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width', 'controlField', 'controlVal'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open', 'controlField', 'controlVal'],
  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width', 'controlField', 'controlVal']
  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width'],
  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'],
  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width']
}
class ActionForm extends Component {
@@ -35,6 +35,7 @@
    interType: null, // 接口类型:内部、外部
    funcType: null,  // 功能类型
    procMode: null,  // 参数方式
    Ot: null,
    requireOptions: [{
      value: 'notRequired',
      text: this.props.dict['header.form.notRequired']
@@ -91,10 +92,12 @@
    let _intertype = card.intertype || 'system'  // 接口类型
    let _funcType = card.funcType || ''          // 功能按钮默认类型
    let _procMode = card.procMode || 'system'    // 参数请求方式
    let _Ot = card.Ot || 'requiredSgl'    // 参数请求方式
    let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode)
    let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode, _Ot)
    this.setState({
      Ot: _Ot,
      openType: _opentype,
      interType: _intertype,
      procMode: _procMode,
@@ -137,7 +140,7 @@
    })
  }
  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode) => {
  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot) => {
    let _options = actionTypeOptions[_opentype] ? fromJS(actionTypeOptions[_opentype]).toJS() : [] // 选项列表
    
    if (_opentype === 'innerpage') {         // 新页面,可选模板(自定义时,可填入外部链接)
@@ -186,6 +189,10 @@
      }
    }
    if (_Ot !== 'notRequired' && _opentype !== 'excelOut') {
      _options.push('controlField', 'controlVal')
    }
    return _options
  }
@@ -210,10 +217,10 @@
   */
  optionChange = (key, value) => {
    const { card, type } = this.props
    const { openType, procMode } = this.state
    const { openType, procMode, Ot } = this.state
    if (key === 'OpenType') {
      let _options = this.getOptions(value, 'system', this.state.funcType, card.pageTemplate, 'system')
      let _options = this.getOptions(value, 'system', this.state.funcType, card.pageTemplate, 'system', Ot)
      let _fieldval = {}
      
@@ -270,7 +277,7 @@
        this.props.form.setFieldsValue(_fieldval)
      })
    } else if (key === 'funcType') {
      let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode)
      let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode, Ot)
      let _fieldval = {}
      this.setState({
@@ -334,7 +341,7 @@
      })
    } else if (key === 'pageTemplate') {
      let _fieldval = {}
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode)
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot)
      this.setState({
        formlist: this.state.formlist.map(item => {
@@ -357,7 +364,7 @@
        this.props.form.setFieldsValue(_fieldval)
      })
    } else if (key === 'intertype') {
      let _options = this.getOptions(openType, value, this.state.funcType, '', procMode)
      let _options = this.getOptions(openType, value, this.state.funcType, '', procMode, Ot)
      this.setState({
        interType: value,
@@ -379,7 +386,7 @@
        })
      })
    } else if (key === 'procMode') {
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', value)
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', value, Ot)
      this.setState({
        procMode: value,
@@ -392,6 +399,16 @@
          return item
        })
      })
    } else if (key === 'Ot') {
      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', procMode, value)
      this.setState({
        Ot: value,
        formlist: this.state.formlist.map(item => {
          item.hidden = !_options.includes(item.key)
          return item
        })
      })
    } else if (key === 'sysInterface') {
      if (value === 'true') {
        this.props.form.setFieldsValue({