From f8c3c53f9e29541f8c0e3fcbf682c301fd17e06a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 23 十一月 2020 17:49:23 +0800
Subject: [PATCH] 2020-11-23

---
 src/menu/actioncomponent/actionform/index.jsx |  419 +++++++++++++++++------------------------------------------
 1 files changed, 122 insertions(+), 297 deletions(-)

diff --git a/src/menu/actioncomponent/actionform/index.jsx b/src/menu/actioncomponent/actionform/index.jsx
index 25d206c..a9758c6 100644
--- a/src/menu/actioncomponent/actionform/index.jsx
+++ b/src/menu/actioncomponent/actionform/index.jsx
@@ -1,22 +1,31 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
+import { fromJS } from 'immutable'
 import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Cascader } from 'antd'
-import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
+import { btnIcons, btnCustomClasses, formRule } from '@/utils/option.js'
 
-import Api from '@/api'
-import options from '@/store/options.js'
-import Utils from '@/utils/utils.js'
 import './index.scss'
 
 const { TextArea } = Input
+const actionTypeOptions = {
+  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'width'],
+  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'width'],
+  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'width'],
+  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'width'],
+  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search', 'width'],
+  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'width'],
+  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'],
+  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width'],
+  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width']
+}
 
 class MainSearch extends Component {
   static propTpyes = {
     dict: PropTypes.object,      // 瀛楀吀椤�
+    type: PropTypes.any,         // type涓�"card"鏃讹紝鍙彲閫夊崟琛屾垨涓嶉�夎
     setting: PropTypes.object,   // 椤甸潰璁剧疆
     formlist: PropTypes.any,     // 琛ㄥ崟淇℃伅
     card: PropTypes.any,         // 鎸夐挳淇℃伅
-    tabs: PropTypes.array,       // 鎵�鏈夋爣绛鹃〉
     inputSubmit: PropTypes.any   // 鍥炶溅鎻愪氦浜嬩欢
   }
 
@@ -25,7 +34,6 @@
     openType: null,  // 鎵撳紑鏂瑰紡
     interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮�
     funcType: null,  // 鍔熻兘绫诲瀷
-    position: null,  // 鎸夐挳浣嶇疆
     requireOptions: [{
       value: 'notRequired',
       text: this.props.dict['header.form.notRequired']
@@ -69,72 +77,33 @@
 
   
   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             // 鎵撳紑鏂瑰紡
-    let _options = null                       // 閫夐」鍒楄〃
-
-    if (card.execMode) {           // 杞崲鎵撳嵃鏃舵墦寮�鏂瑰紡
+    let _opentype = card.OpenType                // 鎵撳紑鏂瑰紡
+    let _intertype = card.intertype || 'system'  // 鎺ュ彛绫诲瀷
+    let _funcType = card.funcType || 'print'     // 鍔熻兘鎸夐挳榛樿绫诲瀷
+    
+    if (card.execMode) {                         // 杞崲鎵撳嵃鏃舵墦寮�鏂瑰紡
       _opentype = 'funcbutton'
-    } else if (_opentype === 'outerpage') {
-      card.pageTemplate = 'custom'
-      _opentype = 'innerpage'
     }
 
-    if (_opentype === 'innerpage') {                                     // 鏂伴〉闈紝鍙�夋ā鏉�(鑷畾涔夋椂锛屽彲濉叆澶栭儴閾炬帴)
-      _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position']
-      if (card.pageTemplate === 'custom') {
-        _options.push('url', 'joint')
-      }
-    } else if (_opentype === 'blank' || _opentype === 'tab') {           // 鏂版爣绛炬垨褰撳墠椤甸潰鏇挎崲
-      _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate', 'linkmenu']
-    } else if (_opentype === 'popview') {                                // 妯℃�佹鏍囩椤�
-      _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose']
-    } else if (_opentype === 'excelOut') {    // 瀵煎叆瀵煎嚭
-      if (card.intertype === 'outer') {
-        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search']
-      } else {
-        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search']
-      }
-    } else if (_opentype === 'excelIn') {    // 瀵煎叆瀵煎嚭
-      if (card.intertype === 'outer') {
-        _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
-      } else {
-        _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
-      }
-    } else if (_opentype === 'funcbutton') {
-      if (!card.funcType) {
-        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
-      } else if (card.funcType === 'changeuser') {
-        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
-      } else if (card.funcType === 'print') {
-        if (card.intertype === 'outer') {
-          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-        } else {
-          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-        }
-      }
-    } else {
-      if (card.intertype === 'outer') {
-        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-      } else {
-        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
-      }
-    }
+    let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate)
+
     this.setState({
       openType: _opentype,
       menulist: _menulist.options || [],
-      interType: card.intertype || 'inner',
-      position: card.position || 'toolbar',
-      funcType: card.funcType,
+      interType: _intertype,
+      funcType: _funcType,
       formlist: this.props.formlist.map(item => {
         if (item.key === 'class') {
-          item.options = btnClasses
+          item.options = btnCustomClasses
         } else if (item.key === 'icon') {
           item.options = btnIcons
         } else if (item.key === 'Ot') {
-          if (card.position === 'grid' || 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))
@@ -149,14 +118,6 @@
           } else {
             item.options = this.state.insertUpdateOptions
           }
-        } else if (item.key === 'linkTab') {
-          item.options = [
-            {
-              value: '',
-              text: '鏂板缓'
-            },
-            ...this.props.tabs
-          ]
         } else if (item.key === 'OpenType') {
           item.initVal = _opentype
         }
@@ -165,6 +126,46 @@
         return item
       })
     })
+  }
+
+  getOptions = (_opentype, _intertype, _funcType, _pageTemplate) => {
+    let _options = fromJS(actionTypeOptions[_opentype]).toJS() // 閫夐」鍒楄〃
+    
+    if (_opentype === 'innerpage') {         // 鏂伴〉闈紝鍙�夋ā鏉�(鑷畾涔夋椂锛屽彲濉叆澶栭儴閾炬帴)
+      if (_pageTemplate === 'custom') {
+        _options.push('url', 'joint')
+      }
+    } else if (_opentype === 'excelOut') {    // 瀵煎叆瀵煎嚭
+      if (_intertype === 'outer') {
+        _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc')
+      } else if (_intertype === 'inner') {
+        _options.push('innerFunc')
+      }
+    } else if (_opentype === 'excelIn') {    // 瀵煎叆瀵煎嚭
+      if (_intertype === 'outer') {
+        _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
+      } else if (_intertype === 'inner') {
+        _options.push('innerFunc')
+      }
+    } else if (_opentype === 'funcbutton') {
+      if (_funcType === 'print') {
+        if (_intertype === 'outer') {
+          _options.push('execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'execSuccess', 'execError')
+        } else if (_intertype === 'inner') {
+          _options.push('execMode', 'intertype', 'innerFunc', 'Ot', 'execSuccess', 'execError')
+        }
+      }
+    } else if (_opentype === 'popview' && _opentype === 'tab') {
+      if (_intertype === 'outer') {
+        _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
+      } else if (_intertype === 'inner') {
+        _options.push('innerFunc')
+      } else {
+        _options.push('sql', 'sqlType')
+      }
+    }
+
+    return _options
   }
 
   componentDidMount () {
@@ -187,50 +188,10 @@
    * 3銆佸垏鎹㈡爣绛剧被鍨嬶紝閲嶇疆鍙�夋爣绛�
    */
   openTypeChange = (key, value) => {
-    const { card } = this.props
+    const { card, type } = this.props
 
     if (key === 'OpenType') {
-      let _options = null
-      if (value === 'innerpage') {
-        _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position']
-        if (card.pageTemplate === 'custom') {
-          _options.push('url', 'joint')
-        }
-      } else if (value === 'blank' || value === 'tab') {
-        _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate', 'linkmenu']
-      } else if (value === 'popview') {
-        _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose']
-      } else if (value === 'excelOut') {
-        if (this.state.interType === 'outer') {
-          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search']
-        } else {
-          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search']
-        }
-      } else if (value === 'excelIn') {
-        if (this.state.interType === 'outer') {
-          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
-        } else {
-          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
-        }
-      } else if (value === 'funcbutton') {
-        if (!this.state.funcType) {
-          _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
-        } else if (this.state.funcType === 'changeuser') {
-          _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
-        } else if (this.state.funcType === 'print') {
-          if (this.state.interType === 'outer') {
-            _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-          } else {
-            _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-          }
-        }
-      } else {
-        if (this.state.interType === 'inner') {
-          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
-        } else {
-          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc']
-        }
-      }
+      let _options = this.getOptions(value, this.state.interType, this.state.funcType, card.pageTemplate)
 
       let _fieldval = {}
       
@@ -242,9 +203,8 @@
         if (item.key === 'intertype') {
           _fieldval.intertype = this.state.interType
         } else if (item.key === 'Ot') {
-          if (this.state.position === 'grid') {
-            item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value))
-            _fieldval.Ot = 'requiredSgl'
+          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'
@@ -280,61 +240,8 @@
 
         this.props.form.setFieldsValue(_fieldval)
       })
-    } else if (key === 'position') {
-      let _fieldval = {}
-
-      this.setState({
-        position: value,
-        formlist: this.state.formlist.map(item => {
-          if (item.key === 'Ot') {
-            if (value === 'grid') {
-              item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value))
-              _fieldval.Ot = 'requiredSgl'
-            } else if (['innerpage', 'blank', 'tab', 'popview'].includes(this.state.openType)) {
-              item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
-              _fieldval.Ot = 'requiredSgl'
-            } else {
-              item.options = this.state.requireOptions
-            }
-          }
-          return item
-        })
-      }, () => {
-        this.props.form.setFieldsValue(_fieldval)
-      })
-    } else if (key === 'tabType') {
-      let _tabs = this.props.tabs.filter(tab => tab.type === value)
-      let _fieldval = {}
-
-      this.setState({
-        formlist: this.state.formlist.map(item => {
-          if (item.key === 'linkTab') {
-            item.options = [
-              {
-                value: '',
-                text: '鏂板缓'
-              },
-              ..._tabs
-            ]
-          }
-          return item
-        })
-      }, () => {
-        this.props.form.setFieldsValue(_fieldval)
-      })
     } else if (key === 'funcType') {
-      let _options = null
-      if (!value) {
-        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
-      } else if (value === 'changeuser') {
-        _options = ['label', 'OpenType', 'funcType', 'icon', 'class']
-      } else if (value === 'print') {
-        if (this.state.interType === 'outer') {
-          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-        } else {
-          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-        }
-      }
+      let _options = this.getOptions(this.state.openType, this.state.interType, value, card.pageTemplate)
       let _fieldval = {}
 
       this.setState({
@@ -346,7 +253,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
@@ -358,7 +269,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
@@ -381,19 +294,14 @@
         } else if (value === 'LogicDelete' || value === 'delete') {
           _fieldval.label = '鍒犻櫎'
           _fieldval.class = 'danger'
-          _fieldval.Ot = 'required'
+          _fieldval.Ot = 'requiredSgl'
         }
 
         this.props.form.setFieldsValue(_fieldval)
       })
     } else if (key === 'pageTemplate') {
-      let _options = null
       let _fieldval = {}
-      if (value === 'custom') {
-        _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'url', 'joint', 'icon', 'class', 'position']
-      } else {
-        _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position']
-      }
+      let _options = this.getOptions(this.state.openType, this.state.interType, this.state.funcType, value)
 
       this.setState({
         openType: value,
@@ -404,6 +312,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))
             }
@@ -414,51 +324,16 @@
       }, () => {
         this.props.form.setFieldsValue(_fieldval)
       })
-    } else if (key === 'tabTemplate') {
-      let _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate', 'linkmenu']
-
-      this.setState({
-        openType: value,
-        formlist: this.state.formlist.map(item => {
-          item.hidden = !_options.includes(item.key)
-  
-          return item
-        })
-      })
     }
   }
 
   onChange = (e, key) => {
+    const { type } = this.props
     const { openType } = this.state
     let value = e.target.value
 
     if (key === 'intertype') {
-      let _options = null
-      if (openType === 'excelOut') {
-        if (value === 'outer') {
-          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search']
-        } else {
-          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search']
-        }
-      } else if (openType === 'excelIn') {
-        if (value === 'outer') {
-          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
-        } else {
-          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
-        }
-      } else if (openType === 'funcbutton') {
-        if (value === 'outer') {
-          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-        } else {
-          _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
-        }
-      } else {
-        if (value === 'inner') {
-          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
-        } else {
-          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc']
-        }
-      }
+      let _options = this.getOptions(openType, value, this.state.funcType)
 
       this.setState({
         interType: value,
@@ -470,7 +345,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
         })
@@ -512,7 +391,7 @@
     const fields = []
 
     this.state.formlist.forEach((item, index) => {
-      if (item.hidden) return
+      if (item.hidden || item.forbid) return
 
       if (item.type === 'text') { // 鏂囨湰鎼滅储
         let _rules = []
@@ -667,9 +546,20 @@
               })(
                 <Cascader
                   options={this.state.menulist}
-                  loadData={this.loadData}
                   placeholder=""
                 />
+              )}
+            </Form.Item>
+          </Col>
+        )
+      } else if (item.type === 'mcascader') {
+        fields.push(
+          <Col span={12} key={index}>
+            <Form.Item label={item.label}>
+              {getFieldDecorator(item.key, {
+                initialValue: item.initVal
+              })(
+                <Cascader options={item.options} expandTrigger="hover" placeholder="" />
               )}
             </Form.Item>
           </Col>
@@ -677,57 +567,6 @@
       }
     })
     return fields
-  }
-
-  loadData = selectedOptions => {
-    const { MenuID } = this.props
-    const targetOption = selectedOptions[selectedOptions.length - 1]
-    targetOption.loading = true
-
-    let _param = {
-      func: 'sPC_Get_FunMenu',
-      ParentID: targetOption.value,
-      systemType: options.sysType,
-      debug: 'Y'
-    }
-
-    Api.getSystemConfig(_param).then(result => {
-      if (result.status) {
-        targetOption.loading = false
-        targetOption.children = result.data.map(item => {
-          let submenu = {
-            value: item.ParentID,
-            label: item.MenuNameP,
-            children: item.FunMenu.map(cell => {
-              return {
-                value: cell.MenuID,
-                label: cell.MenuName,
-                MenuID: cell.MenuID,
-                MenuName: cell.MenuName,
-                MenuNo: cell.MenuNo,
-                Ot: cell.Ot,
-                PageParam: cell.PageParam,
-                LinkUrl: cell.LinkUrl,
-                disabled: cell.MenuID === MenuID
-              }
-            })
-          }
-
-          return submenu
-        })
-
-        this.setState({
-          menulist: [...this.state.menulist]
-        })
-      } else {
-        notification.warning({
-          top: 92,
-          message: result.message,
-          duration: 5
-        })
-        targetOption.loading = false
-      }
-    })
   }
 
   handleConfirm = () => {
@@ -740,27 +579,27 @@
           values.uuid = this.props.card.uuid
           values.verify = this.props.card.verify || null
 
-          if (values.OpenType === 'excelIn') {
-            values.position = 'toolbar'
+          if (values.show === 'icon' && !values.icon) {
+            notification.warning({
+              top: 92,
+              message: '璇烽�夋嫨鍥炬爣锛�',
+              duration: 5
+            })
+            return
           } else if (values.OpenType === 'excelOut') {
-            if (values.intertype === 'inner' && !values.innerFunc) {
-              if ((setting.interType === 'inner' && setting.innerFunc) || setting.interType === 'outer') {
-                notification.warning({
-                  top: 92,
-                  message: '琛ㄦ牸鏁版嵁鏌ヨ鏈娇鐢ㄦ暟鎹簮锛屽鍑篍xcel浣跨敤鍐呴儴鎺ュ彛鏃讹紝闇�鑷畾涔夊唴閮ㄥ嚱鏁帮紒',
-                  duration: 5
-                })
-                return
-              }
+            if (values.intertype === 'system' && setting.interType !== 'system') {
+              notification.warning({
+                top: 92,
+                message: '琛ㄦ牸鏁版嵁鏌ヨ鏈娇鐢ㄦ暟鎹簮锛屽鍑篍xcel浣跨敤鍐呴儴鎺ュ彛鏃讹紝闇�鑷畾涔夊唴閮ㄥ嚱鏁帮紒',
+                duration: 5
+              })
+              return
             }
             
-            values.position = 'toolbar'
             values.Ot = 'notRequired'
-          } else if (values.OpenType === 'popview' && !values.linkTab) { // 娌℃湁鍏宠仈鏍囩锛堟柊寤烘椂锛夛紝鍒涘缓鏂版爣绛綢d
-            values.linkTab = Utils.getuuid()
+          } else if (values.OpenType === 'popview') {
             values.createTab = true // 鐢ㄤ簬鏍囪鎸夐挳澶嶅埗鏃讹紝鏄惁澶嶅埗鍘熸湁鏍囩
           } else if (values.OpenType === 'funcbutton') { // 杞崲鎵撳嵃鏃舵墦寮�鏂瑰紡
-            values.position = 'toolbar'
             if (values.funcType === 'print') {
               values.OpenType = values.execMode
             }
@@ -790,22 +629,8 @@
             })
             values.linkThdMenu = linkThdMenu
           }
-
-          if (values.innerFunc === '' && values.sql === '') {
-            notification.warning({
-              top: 92,
-              message: this.props.dict['header.form.actionhelp.tablename'],
-              duration: 5
-            })
-          } else if (values.innerFunc === '' && values.sql !== '' && values.sqlType === '') {
-            notification.warning({
-              top: 92,
-              message: this.props.dict['header.form.actionhelp.sqlType'],
-              duration: 5
-            })
-          } else {
-            resolve(values)
-          }
+          
+          resolve(values)
         } else {
           reject(err)
         }

--
Gitblit v1.8.0