king
2022-10-08 9c6795fd3c44e46cf3955fbfd8f8eeca23acb7a9
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -178,7 +178,7 @@
        reReadonly.interface = false
        reRequired.interface = true
      } else if (intertype === 'outer') {
        shows.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType', 'output')
        shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType', 'output')
        if (this.record.procMode === 'system') {
          shows.push('sql', 'sqlType')
        } else if (this.record.procMode === 'inner') {
@@ -194,6 +194,8 @@
        if (this.record.sysInterface === 'false') {
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          reReadonly.interface = true
          reRequired.interface = false
@@ -234,14 +236,16 @@
      if (this.record.formType === 'switch') {
        shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText')
      } else {
      } else if (this.record.formType === 'radio') {
        shows.push('field', 'openVal', 'closeVal')
      } else {
        shows.push('field')
      }
      reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom')
      if (intertype === 'outer') {
        shows.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType')
        shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType')
        if (this.record.procMode === 'system') {
          shows.push('sql', 'sqlType')
        } else if (this.record.procMode === 'inner') {
@@ -257,6 +261,8 @@
        if (this.record.sysInterface === 'false') {
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          reReadonly.interface = true
          reRequired.interface = false
@@ -288,13 +294,15 @@
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
      if (this.record.intertype === 'outer') {
        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
        shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
        reRequired.innerFunc = false
        reRequired.callbackFunc = false
        if (this.record.sysInterface === 'false') {
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          reReadonly.interface = true
          reRequired.interface = false
@@ -310,12 +318,14 @@
      reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
      if (this.record.intertype === 'outer') {
        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc')
        shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc')
        reRequired.innerFunc = false
        if (this.record.sysInterface === 'false') {
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          reReadonly.interface = true
          reRequired.interface = false
@@ -370,13 +380,15 @@
      if (_funcType === 'print') {
        shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError')
        if (this.record.intertype === 'outer') {
          shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
          shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
          reRequired.innerFunc = false
          reRequired.callbackFunc = false
          if (this.record.sysInterface === 'false') {
            reReadonly.interface = false
            reRequired.interface = true
            shows.push('proInterface')
          } else {
            reReadonly.interface = true
            reRequired.interface = false
@@ -418,6 +430,12 @@
        shows.push('innerFunc', 'Ot', 'execSuccess', 'execError', 'urlkey')
      } else if (_funcType === 'pay') {
        shows.push('payType', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu')
        if (this.record.openmenu && this.record.openmenu !== 'goback') {
          shows.push('open')
        }
        reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value))
      } else if (_funcType === 'refund') {
        shows.push('Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu')
        reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value))
      }
    }
@@ -716,13 +734,18 @@
            { pattern: _patten, message: formRule.func.innerMessage },
            { max: formRule.func.max, message: formRule.func.maxMessage }
          )
        } else if (item.key === 'sql' || item.key === 'sheet') {
          rules.push(
            { pattern: /^[a-zA-Z_]+$/, message: '表名只可使用字母以及_' },
            { max: formRule.func.max, message: formRule.func.maxMessage }
          )
        } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') {
          rules.push(
            { pattern: formRule.func.pattern, message: formRule.func.message },
            { max: formRule.func.max, message: formRule.func.maxMessage }
          )
        } else if (item.key === 'output') {
          if (this.record.intertype === 'system') {
          if (this.record.intertype === 'system' || ((this.record.intertype === 'outer' || this.record.intertype === 'custom') && this.record.callbackType === 'script')) {
            rules = [{
              pattern: /^@[0-9a-zA-Z_]+@?$/,
              message: '变量以@符开头,可使用字母、数字以及_'
@@ -865,9 +888,14 @@
          values.modal = card.modal || null
          if (values.OpenType === 'form') {
            if (/^(0|[1-9]\d*)$/.test(values.openVal) && /^(0|[1-9]\d*)$/.test(values.closeVal)) {
              values.openVal = +values.openVal
              values.closeVal = +values.closeVal
            if (values.formType !== 'scan') {
              if (/^(0|[1-9]\d*)$/.test(values.openVal) && /^(0|[1-9]\d*)$/.test(values.closeVal)) {
                values.openVal = +values.openVal
                values.closeVal = +values.closeVal
              }
            } else {
              values.show = 'icon'
              values.icon = 'scan'
            }
          } else if (values.OpenType === 'excelOut') {
            values.Ot = 'notRequired'