king
2022-08-06 4c52785eafd803c6725afb2f28f116dba754ffad
2022-08-06
2个文件已修改
67 ■■■■ 已修改文件
src/menu/components/form/formaction/actionform/index.jsx 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/formconfig.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/actionform/index.jsx
@@ -21,7 +21,8 @@
    formlist: null,  // 表单信息
    interType: null, // 接口类型:内部、外部
    procMode: null,  // 参数方式
    linkmenu: null
    linkmenu: null,
    callbackType: null
  }
  
@@ -30,12 +31,14 @@
    let _intertype = card.intertype || 'system'  // 接口类型
    let _procMode = card.procMode || 'system'    // 参数请求方式
    let _callbackType = card.callbackType || 'script'
    let _options = this.getOptions(_intertype, _procMode, card.linkmenu)
    let _options = this.getOptions(_intertype, _procMode, card.linkmenu, _callbackType)
    this.setState({
      interType: _intertype,
      procMode: _procMode,
      callbackType: _callbackType,
      linkmenu: card.linkmenu,
      formlist: this.props.formlist.map(item => {
        if (item.key === 'innerFunc' && _procMode === 'inner') {
@@ -48,7 +51,7 @@
    })
  }
  getOptions = (_intertype, _procMode, linkmenu) => {
  getOptions = (_intertype, _procMode, linkmenu, _callbackType) => {
    const { card } = this.props
    if (card.type === 'prev') {
@@ -60,14 +63,30 @@
    
    if (_intertype === 'custom') {
      _options.pop()
      _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross')
      _options.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross')
      if (_procMode === 'system') {
        _options.push('sql', 'sqlType')
      } else {
        _options.push('innerFunc')
      }
      if (_callbackType === 'func') {
        _options.push('callbackFunc')
      } else if (_callbackType !== 'none') {
        _options.push('cbTable')
      }
    } else if (_intertype === 'outer') {
      _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
      _options.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType')
      if (_procMode === 'system') {
        _options.push('sql', 'sqlType')
      } else if (_procMode === 'inner') {
        _options.push('innerFunc')
      }
      if (_callbackType === 'func') {
        _options.push('callbackFunc')
      } else if (_callbackType !== 'none') {
        _options.push('cbTable')
      }
    } else if (_intertype === 'inner') {
      _options.push('innerFunc')
    } else {
@@ -88,10 +107,10 @@
   * 3、切换标签类型,重置可选标签
   */
  optionChange = (key, value) => {
    const { procMode, linkmenu } = this.state
    const { procMode, linkmenu, callbackType } = this.state
    if (key === 'intertype') {
      let _options = this.getOptions(value, procMode, linkmenu)
      let _options = this.getOptions(value, procMode, linkmenu, callbackType)
      this.setState({
        interType: value,
@@ -107,21 +126,21 @@
        })
      })
    } else if (key === 'procMode') {
      let _options = this.getOptions(this.state.interType, value, linkmenu)
      let _options = this.getOptions(this.state.interType, value, linkmenu, callbackType)
      this.setState({
        procMode: value,
        formlist: this.state.formlist.map(item => {
          item.hidden = !_options.includes(item.key)
          if (item.key === 'innerFunc') {
            item.required = true
          if (item.key === 'procMode') {
            item.initVal = value
          }
          return item
        })
      })
    } else if (key === 'linkmenu') {
      let _options = this.getOptions(this.state.interType, procMode, value)
      let _options = this.getOptions(this.state.interType, procMode, value, callbackType)
      this.setState({
        linkmenu: value,
@@ -130,6 +149,19 @@
          return item
        })
      })
    } else if (key === 'callbackType') {
      let _options = this.getOptions(this.state.interType, procMode, linkmenu, value)
      this.setState({
        callbackType: value,
        formlist: this.state.formlist.map(item => {
          if (item.key === 'callbackType') {
            item.initVal = value
          }
          item.hidden = !_options.includes(item.key)
          return item
        })
      })
    } else if (key === 'sysInterface') {
      if (value === 'true') {
        this.props.form.setFieldsValue({
src/menu/components/form/formaction/formconfig.jsx
@@ -92,6 +92,9 @@
      }, {
        value: 'inner',
        text: '内部函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
@@ -126,7 +129,7 @@
      tooltip: functip,
      fields: usefulFields,
      tooltipClass: 'middle',
      required: card.intertype === 'inner',
      required: true,
      readonly: false
    },
    {
@@ -224,6 +227,12 @@
      }, {
        value: 'default',
        text: '后台脚本'
      }, {
        value: 'func',
        text: '回调函数'
      }, {
        value: 'none',
        text: '无'
      }]
    },
    {
@@ -238,7 +247,7 @@
      key: 'callbackFunc',
      label: Formdict['header.form.callbackFunc'],
      initVal: card.callbackFunc || '',
      required: false,
      required: true,
      readonly: false
    },
    {