From 87c445887fe8d724ea124535234df974d3e1d58e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 19 六月 2021 13:17:48 +0800
Subject: [PATCH] 2021-06-19

---
 src/menu/components/share/actioncomponent/actionform/index.jsx |   51 ++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index ba4c550..a4060b9 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -8,15 +8,15 @@
 
 const { TextArea } = Input
 const actionTypeOptions = {
-  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
-  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
-  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
-  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'controlField', 'controlVal'],
-  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'resetPageIndex', 'pagination', 'search', 'width', 'controlField', 'controlVal'],
-  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'controlField', 'controlVal'],
-  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width', 'controlField', 'controlVal'],
-  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open', 'controlField', 'controlVal'],
-  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width', 'controlField', 'controlVal']
+  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
+  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
+  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width'],
+  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'],
+  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']
 }
 
 class ActionForm extends Component {
@@ -35,6 +35,7 @@
     interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮�
     funcType: null,  // 鍔熻兘绫诲瀷
     procMode: null,  // 鍙傛暟鏂瑰紡
+    Ot: null,
     requireOptions: [{
       value: 'notRequired',
       text: this.props.dict['header.form.notRequired']
@@ -91,10 +92,12 @@
     let _intertype = card.intertype || 'system'  // 鎺ュ彛绫诲瀷
     let _funcType = card.funcType || ''          // 鍔熻兘鎸夐挳榛樿绫诲瀷
     let _procMode = card.procMode || 'system'    // 鍙傛暟璇锋眰鏂瑰紡
+    let _Ot = card.Ot || 'requiredSgl'    // 鍙傛暟璇锋眰鏂瑰紡
 
-    let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode)
+    let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode, _Ot)
 
     this.setState({
+      Ot: _Ot,
       openType: _opentype,
       interType: _intertype,
       procMode: _procMode,
@@ -137,7 +140,7 @@
     })
   }
 
-  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode) => {
+  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot) => {
     let _options = actionTypeOptions[_opentype] ? fromJS(actionTypeOptions[_opentype]).toJS() : [] // 閫夐」鍒楄〃
     
     if (_opentype === 'innerpage') {         // 鏂伴〉闈紝鍙�夋ā鏉�(鑷畾涔夋椂锛屽彲濉叆澶栭儴閾炬帴)
@@ -186,6 +189,10 @@
       }
     }
 
+    if (_Ot !== 'notRequired' && _opentype !== 'excelOut') {
+      _options.push('controlField', 'controlVal')
+    }
+
     return _options
   }
 
@@ -210,10 +217,10 @@
    */
   optionChange = (key, value) => {
     const { card, type } = this.props
-    const { openType, procMode } = this.state
+    const { openType, procMode, Ot } = this.state
 
     if (key === 'OpenType') {
-      let _options = this.getOptions(value, 'system', this.state.funcType, card.pageTemplate, 'system')
+      let _options = this.getOptions(value, 'system', this.state.funcType, card.pageTemplate, 'system', Ot)
 
       let _fieldval = {}
       
@@ -270,7 +277,7 @@
         this.props.form.setFieldsValue(_fieldval)
       })
     } else if (key === 'funcType') {
-      let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode)
+      let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode, Ot)
       let _fieldval = {}
 
       this.setState({
@@ -334,7 +341,7 @@
       })
     } else if (key === 'pageTemplate') {
       let _fieldval = {}
-      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode)
+      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot)
 
       this.setState({
         formlist: this.state.formlist.map(item => {
@@ -357,7 +364,7 @@
         this.props.form.setFieldsValue(_fieldval)
       })
     } else if (key === 'intertype') {
-      let _options = this.getOptions(openType, value, this.state.funcType, '', procMode)
+      let _options = this.getOptions(openType, value, this.state.funcType, '', procMode, Ot)
 
       this.setState({
         interType: value,
@@ -379,7 +386,7 @@
         })
       })
     } else if (key === 'procMode') {
-      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', value)
+      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', value, Ot)
 
       this.setState({
         procMode: value,
@@ -392,6 +399,16 @@
           return item
         })
       })
+    } else if (key === 'Ot') {
+      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', procMode, value)
+
+      this.setState({
+        Ot: value,
+        formlist: this.state.formlist.map(item => {
+          item.hidden = !_options.includes(item.key)
+          return item
+        })
+      })
     } else if (key === 'sysInterface') {
       if (value === 'true') {
         this.props.form.setFieldsValue({

--
Gitblit v1.8.0