king
2021-09-14 6c44bc79e5edc338b44fdc469220ddf0e3fc4028
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -10,12 +10,12 @@
const { TextArea } = Input
const MkIcon = asyncComponent(() => import('@/components/mkIcon'))
const actionTypeOptions = {
  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open'],
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open'],
  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'],
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'],
  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'openmenu', 'open', 'output', 'refreshTab'],
  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'],
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement'],
  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']
@@ -38,6 +38,7 @@
    funcType: null,  // 功能类型
    procMode: null,  // 参数方式
    pageTemplate: null,
    appType: sessionStorage.getItem('appType'),
    Ot: null,
    requireOptions: [{
      value: 'notRequired',
@@ -168,15 +169,20 @@
      }
    } else if (_opentype === 'funcbutton') {
      if (_funcType === 'print') {
        _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex')
        _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex', 'controlField', 'controlVal')
        if (_intertype === 'outer') {
          _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
        } else if (_intertype === 'inner') {
          _options.push('innerFunc')
        }
      } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') {
        _options.push('execSuccess', 'execError')
      } else if (_funcType === 'closetab') {
        _options.push('refreshTab')
      }
    } else if (_opentype !== 'popview' && _opentype !== 'tab') {
      if (_intertype === 'custom') {
        _options = _options.filter(m => m !== 'output')
        _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross')
        if (_procMode === 'system') {
          _options.push('sql', 'sqlType')
@@ -192,7 +198,7 @@
      }
    }
    if (_Ot !== 'notRequired' && _opentype !== 'excelOut') {
    if (_Ot !== 'notRequired' && _opentype !== 'excelOut' && _opentype !== 'funcbutton') {
      _options.push('controlField', 'controlVal')
    }
    if (_Ot === 'requiredSgl' && ['pop', 'prompt', 'exec'].includes(_opentype)) {
@@ -209,7 +215,7 @@
      try {
        let _form = document.getElementById('label')
        _form && _form.select()
      } catch {
      } catch (e) {
        console.warn('表单focus失败!')
      }
    }
@@ -333,7 +339,7 @@
          _fieldval.Ot = 'requiredSgl'
        } else if (value === 'audit') {
          _fieldval.label = '审核'
          _fieldval.class = 'purple'
          _fieldval.class = 'primary'
          _fieldval.Ot = 'requiredSgl'
        } else if (value === 'LogicDelete' || value === 'delete') {
          _fieldval.label = '删除'
@@ -614,7 +620,12 @@
      } else if (item.type === 'cascader') { // 多选
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || [],
                rules: [
@@ -629,7 +640,7 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'icon') { // 多选
      } else if (item.type === 'icon') {
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
@@ -650,7 +661,12 @@
      } else if (item.type === 'mcascader') {
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal
              })(
@@ -703,6 +719,26 @@
                values.verify.invalid = 'true'
              }
            }
          } else if (values.OpenType === 'tab' && values.linkmenu) {
            if (sessionStorage.getItem('thdMenuList')) {
              let list = null
              try {
                list = JSON.parse(sessionStorage.getItem('thdMenuList')) || []
              } catch (e) {
                list = []
              }
              let id = values.linkmenu[values.linkmenu.length - 1]
              list.forEach(item => {
                if (item.MenuID === id) {
                  values.MenuID = id
                  values.MenuName = item.MenuName
                  values.MenuNo = item.MenuNo
                  values.tabType = item.type
                }
              })
            }
          }
          
          resolve(values)