king
2020-10-13 8f6b3d26bde4e22773cc53386dfbae669a7472ed
src/menu/actioncomponent/actionform/index.jsx
@@ -24,6 +24,7 @@
class MainSearch extends Component {
  static propTpyes = {
    dict: PropTypes.object,      // 字典项
    type: PropTypes.any,         // type为"card"时,只可选单行或不选行
    setting: PropTypes.object,   // 页面设置
    formlist: PropTypes.any,     // 表单信息
    card: PropTypes.any,         // 按钮信息
@@ -78,7 +79,7 @@
  
  UNSAFE_componentWillMount () {
    const { card } = this.props
    const { card, type } = this.props
    let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || ''
    let _opentype = card.OpenType                // 打开方式
@@ -102,7 +103,9 @@
        } else if (item.key === 'icon') {
          item.options = btnIcons
        } else if (item.key === 'Ot') {
          if (card.pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行
          if (type === 'card') {
            item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
          } else if (card.pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行
            item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value))
          } else if (['innerpage', 'blank', 'tab', 'popview', 'excelIn'].includes(_opentype)) {
            item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
@@ -187,7 +190,7 @@
   * 3、切换标签类型,重置可选标签
   */
  openTypeChange = (key, value) => {
    const { card } = this.props
    const { card, type } = this.props
    if (key === 'OpenType') {
      let _options = this.getOptions(value, this.state.interType, this.state.funcType, card.pageTemplate)
@@ -202,7 +205,9 @@
        if (item.key === 'intertype') {
          _fieldval.intertype = this.state.interType
        } else if (item.key === 'Ot') {
          if (['innerpage', 'blank', 'tab', 'popview'].includes(value)) {
          if (type === 'card') {
            item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
          } else if (['innerpage', 'blank', 'tab', 'popview'].includes(value)) {
            item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
            _fieldval.Ot = 'requiredSgl'
          } else if (value === 'excelIn') {
@@ -257,7 +262,11 @@
          if (item.key === 'intertype') {
            _fieldval.intertype = this.state.interType
          } else if (item.key === 'Ot' && value === 'print') {
            item.options = this.state.requireOptions
            if (type === 'card') {
              item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
            } else {
              item.options = this.state.requireOptions
            }
          }
          return item
@@ -269,7 +278,9 @@
      let _fieldval = {}
      this.setState({
        formlist: this.state.formlist.map(item => {
          if (item.key === 'Ot' && value === 'insert') {
          if (item.key === 'Ot' && type === 'card') {
            item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
          } else if (item.key === 'Ot' && value === 'insert') {
            item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl', 'required'].includes(op.value))
          } else if (item.key === 'Ot') {
            item.options = this.state.requireOptions
@@ -313,6 +324,8 @@
            if (value === 'pay') {
              item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value))
              _fieldval.Ot = 'requiredSgl'
            } else if (type === 'card') {
              item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
            } else {
              item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
            }
@@ -327,6 +340,7 @@
  }
  onChange = (e, key) => {
    const { type } = this.props
    const { openType } = this.state
    let value = e.target.value
@@ -343,7 +357,11 @@
          } else if (item.key === 'sysInterface') {
            item.initVal = 'false'
          } else if (item.key === 'Ot') {
            item.options = this.state.requireOptions
            if (type === 'card') {
              item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
            } else {
              item.options = this.state.requireOptions
            }
          }
          return item
        })