king
2023-03-01 c2580fb8de3bdaabb4179b0ce0fcd2fbac802441
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -6,6 +6,7 @@
import { formRule } from '@/utils/option.js'
import asyncComponent from '@/utils/asyncComponent'
import KeyInterface from '@/components/keyInterface'
import './index.scss'
const { TextArea } = Input
@@ -16,8 +17,8 @@
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'hidden'],
  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'],
  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'hidden'],
  excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'],
  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'],
  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'],
@@ -177,7 +178,7 @@
        reReadonly.interface = false
        reRequired.interface = true
      } else if (intertype === 'outer') {
        shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType', 'output')
        shows.push('procMode', 'sysInterface', 'outerFunc', 'callbackType', 'output')
        if (this.record.procMode === 'system') {
          shows.push('sql', 'sqlType')
        } else if (this.record.procMode === 'inner') {
@@ -194,10 +195,14 @@
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          shows.push('interface', 'proInterface')
        } else if (this.record.sysInterface === 'true') {
          reReadonly.interface = true
          reRequired.interface = false
          shows.push('interface')
        } else if (this.record.sysInterface === 'external') {
          shows.push('exInterface', 'exProInterface')
        }
      } else if (intertype === 'inner') {
        shows.push('innerFunc', 'output')
@@ -208,6 +213,9 @@
      if (Ot === 'required') {
        shows.push('progress')
      }
      if (Ot === 'required' && (intertype === 'inner' || intertype === 'system')) {
        shows.push('execType')
      }
      if (this.record.openmenu && this.record.openmenu !== 'goback') {
        shows.push('open')
@@ -236,7 +244,7 @@
      if (this.record.formType === 'switch') {
        shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText')
      } else if (this.record.formType === 'radio') {
        shows.push('field', 'openVal', 'closeVal')
        shows.push('field', 'checkType', 'openVal', 'closeVal')
      } else {
        shows.push('field')
      }
@@ -244,7 +252,7 @@
      reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom')
      if (intertype === 'outer') {
        shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType')
        shows.push('procMode', 'sysInterface', 'outerFunc', 'callbackType')
        if (this.record.procMode === 'system') {
          shows.push('sql', 'sqlType')
        } else if (this.record.procMode === 'inner') {
@@ -261,10 +269,14 @@
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          shows.push('interface', 'proInterface')
        } else if (this.record.sysInterface === 'true') {
          reReadonly.interface = true
          reRequired.interface = false
          shows.push('interface')
        } else if (this.record.sysInterface === 'external') {
          shows.push('exInterface', 'exProInterface')
        }
      } else if (intertype === 'inner') {
        shows.push('innerFunc')
@@ -293,7 +305,7 @@
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
      if (this.record.intertype === 'outer') {
        shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
        shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc')
        reRequired.innerFunc = false
        reRequired.callbackFunc = false
@@ -301,10 +313,14 @@
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          shows.push('interface', 'proInterface')
        } else if (this.record.sysInterface === 'true') {
          reReadonly.interface = true
          reRequired.interface = false
          shows.push('interface')
        } else if (this.record.sysInterface === 'external') {
          shows.push('exInterface', 'exProInterface')
        }
      } else if (this.record.intertype === 'inner') {
        shows.push('innerFunc')
@@ -315,19 +331,24 @@
      }
    } else if (openType === 'excelOut') {
      reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredOnce'].includes(op.value))
      if (this.record.intertype === 'outer') {
        shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc')
        shows.push('innerFunc', 'sysInterface', 'outerFunc')
        reRequired.innerFunc = false
        if (this.record.sysInterface === 'false') {
          reReadonly.interface = false
          reRequired.interface = true
          shows.push('proInterface')
        } else {
          shows.push('interface', 'proInterface')
        } else if (this.record.sysInterface === 'true') {
          reReadonly.interface = true
          reRequired.interface = false
          shows.push('interface')
        } else if (this.record.sysInterface === 'external') {
          shows.push('exInterface', 'exProInterface')
        }
      } else if (this.record.intertype === 'inner') {
        shows.push('innerFunc')
@@ -336,10 +357,15 @@
      if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') {
        shows.push('resetPageIndex')
      }
      if (this.record.Ot !== 'notRequired' && this.record.Ot !== 'requiredOnce') {
        this.record.Ot = 'notRequired'
      }
    } else if (openType === 'popview') {
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
      if (this.record.display === 'drawer') {
      if (appType === 'mob') {
        shows.push('placement')
      } else if (this.record.display === 'drawer') {
        shows.push('placement')
      }
      if (this.record.popClose === 'grid') {
@@ -379,18 +405,22 @@
      if (_funcType === 'print') {
        shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError')
        if (this.record.intertype === 'outer') {
          shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
          shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc')
          reRequired.innerFunc = false
          reRequired.callbackFunc = false
          if (this.record.sysInterface === 'false') {
            reReadonly.interface = false
            reRequired.interface = true
            shows.push('proInterface')
          } else {
            shows.push('interface', 'proInterface')
          } else if (this.record.sysInterface === 'true') {
            reReadonly.interface = true
            reRequired.interface = false
            shows.push('interface')
          } else if (this.record.sysInterface === 'external') {
            shows.push('exInterface', 'exProInterface')
          }
        } else if (this.record.intertype === 'inner') {
          shows.push('innerFunc')
@@ -398,6 +428,9 @@
        }
        if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') {
          shows.push('resetPageIndex')
        }
        if (this.record.execMode === 'pop' || this.record.execMode === 'prompt') {
          shows.push('position')
        }
      } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') {
        shows.push('execSuccess', 'execError')
@@ -440,7 +473,7 @@
    }
    
    if (appType === 'mob') {
      if (Ot !== 'notRequired') {
      if (Ot !== 'notRequired' && openType !== 'excelOut') {
        shows.push('control')
        reOptions.control = [
          { value: '', text: '无' },
@@ -455,7 +488,7 @@
        }
      }
    } else {
      if (Ot !== 'notRequired') {
      if (Ot !== 'notRequired' && openType !== 'excelOut') {
        reOptions.control = [
          { value: '', text: '无' },
          { value: 'disabled', text: '禁用' },
@@ -528,20 +561,20 @@
      } else if (value === 'excelIn') {
        _fieldval.intertype = 'system'
        _fieldval.Ot = 'notRequired'
        _fieldval.execSuccess = 'grid'
        _fieldval.label = '导入Excel'
        _fieldval.class = 'dgreen'
        this.record.Ot = 'notRequired'
        this.record.label = '导入Excel'
        this.record.class = 'dgreen'
        this.record.execSuccess = 'grid'
      } else if (value === 'excelOut') {
        _fieldval.intertype = 'system'
        _fieldval.label = '导出Excel'
        _fieldval.class = 'dgreen'
        _fieldval.execSuccess = 'never'
        this.record.Ot = 'notRequired'
        _fieldval.Ot = 'requiredOnce'
        this.record.Ot = 'requiredOnce'
        this.record.label = '导出Excel'
        this.record.class = 'dgreen'
        this.record.execSuccess = 'never'
@@ -734,7 +767,7 @@
          )
        } else if (item.key === 'sql' || item.key === 'sheet') {
          rules.push(
            { pattern: /^[a-zA-Z_]+$/, message: '表名只可使用字母以及_' },
            { pattern: /^[a-zA-Z0-9@_]+$/, message: '表名只可使用字母、数字以及_' },
            { max: formRule.func.max, message: formRule.func.maxMessage }
          )
        } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') {
@@ -786,7 +819,7 @@
            getPopupContainer={() => document.getElementById('winter')}
          >
            {item.options.map((option, index) =>
              <Select.Option key={index} extend={option[item.extendName] || ''} value={(option.value || option.field)}>
              <Select.Option key={index} title={option.text || option.label} extend={option[item.extendName] || ''} value={(option.value || option.field)}>
                {(option.text || option.label)}
              </Select.Option>
            )}
@@ -800,7 +833,7 @@
            getPopupContainer={() => document.getElementById('winter')}
          >
            {item.options.map((option, index) =>
              <Select.Option key={index} value={(option.value || option.field)}>
              <Select.Option key={index} title={option.text || option.label} value={(option.value || option.field)}>
                {(option.text || option.label)}
              </Select.Option>
            )}
@@ -843,6 +876,14 @@
        ]
        content = <TextArea rows={2} readOnly={item.readonly}/>
      } else if (item.type === 'keyinterface') {
        span = 24
        className = 'textarea'
        rules = [
          { required: item.required, message: '请输入' + item.label + '!' }
        ]
        content = <KeyInterface type={item.key === 'exInterface' ? 'develop' : 'product'}/>
      }
      fields.push(
@@ -884,6 +925,7 @@
          values.uuid = card.uuid
          values.verify = card.verify || null
          values.modal = card.modal || null
          values.config = card.config || null
          if (values.OpenType === 'form') {
            if (values.formType !== 'scan') {
@@ -896,7 +938,7 @@
              values.icon = 'scan'
            }
          } else if (values.OpenType === 'excelOut') {
            values.Ot = 'notRequired'
            values.Ot = values.Ot || 'notRequired'
          } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) {
            if ((values.Ot === 'requiredOnce' || card.Ot === 'requiredOnce') && card.Ot !== values.Ot) {
              values.verify.uniques = []