From 4c52785eafd803c6725afb2f28f116dba754ffad Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 06 八月 2022 02:08:30 +0800
Subject: [PATCH] 2022-08-06

---
 src/menu/components/form/formaction/formconfig.jsx       |   13 +++++-
 src/menu/components/form/formaction/actionform/index.jsx |   54 +++++++++++++++++++++-----
 2 files changed, 54 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/form/formaction/actionform/index.jsx b/src/menu/components/form/formaction/actionform/index.jsx
index a49f945..dacfdd8 100644
--- a/src/menu/components/form/formaction/actionform/index.jsx
+++ b/src/menu/components/form/formaction/actionform/index.jsx
@@ -21,7 +21,8 @@
     formlist: null,  // 琛ㄥ崟淇℃伅
     interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮�
     procMode: null,  // 鍙傛暟鏂瑰紡
-    linkmenu: null
+    linkmenu: null,
+    callbackType: null
   }
 
   
@@ -30,12 +31,14 @@
 
     let _intertype = card.intertype || 'system'  // 鎺ュ彛绫诲瀷
     let _procMode = card.procMode || 'system'    // 鍙傛暟璇锋眰鏂瑰紡
+    let _callbackType = card.callbackType || 'script'
 
-    let _options = this.getOptions(_intertype, _procMode, card.linkmenu)
+    let _options = this.getOptions(_intertype, _procMode, card.linkmenu, _callbackType)
 
     this.setState({
       interType: _intertype,
       procMode: _procMode,
+      callbackType: _callbackType,
       linkmenu: card.linkmenu,
       formlist: this.props.formlist.map(item => {
         if (item.key === 'innerFunc' && _procMode === 'inner') {
@@ -48,7 +51,7 @@
     })
   }
 
-  getOptions = (_intertype, _procMode, linkmenu) => {
+  getOptions = (_intertype, _procMode, linkmenu, _callbackType) => {
     const { card } = this.props
 
     if (card.type === 'prev') {
@@ -60,14 +63,30 @@
     
     if (_intertype === 'custom') {
       _options.pop()
-      _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross')
+      _options.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross')
       if (_procMode === 'system') {
         _options.push('sql', 'sqlType')
       } else {
         _options.push('innerFunc')
       }
+      if (_callbackType === 'func') {
+        _options.push('callbackFunc')
+      } else if (_callbackType !== 'none') {
+        _options.push('cbTable')
+      }
     } else if (_intertype === 'outer') {
-      _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
+      _options.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType')
+      if (_procMode === 'system') {
+        _options.push('sql', 'sqlType')
+      } else if (_procMode === 'inner') {
+        _options.push('innerFunc')
+      }
+      if (_callbackType === 'func') {
+        _options.push('callbackFunc')
+      } else if (_callbackType !== 'none') {
+        _options.push('cbTable')
+      }
+
     } else if (_intertype === 'inner') {
       _options.push('innerFunc')
     } else {
@@ -88,10 +107,10 @@
    * 3銆佸垏鎹㈡爣绛剧被鍨嬶紝閲嶇疆鍙�夋爣绛�
    */
   optionChange = (key, value) => {
-    const { procMode, linkmenu } = this.state
+    const { procMode, linkmenu, callbackType } = this.state
 
     if (key === 'intertype') {
-      let _options = this.getOptions(value, procMode, linkmenu)
+      let _options = this.getOptions(value, procMode, linkmenu, callbackType)
 
       this.setState({
         interType: value,
@@ -107,21 +126,21 @@
         })
       })
     } else if (key === 'procMode') {
-      let _options = this.getOptions(this.state.interType, value, linkmenu)
+      let _options = this.getOptions(this.state.interType, value, linkmenu, callbackType)
 
       this.setState({
         procMode: value,
         formlist: this.state.formlist.map(item => {
           item.hidden = !_options.includes(item.key)
 
-          if (item.key === 'innerFunc') {
-            item.required = true
+          if (item.key === 'procMode') {
+            item.initVal = value
           }
           return item
         })
       })
     } else if (key === 'linkmenu') {
-      let _options = this.getOptions(this.state.interType, procMode, value)
+      let _options = this.getOptions(this.state.interType, procMode, value, callbackType)
 
       this.setState({
         linkmenu: value,
@@ -130,6 +149,19 @@
           return item
         })
       })
+    } else if (key === 'callbackType') {
+      let _options = this.getOptions(this.state.interType, procMode, linkmenu, value)
+
+      this.setState({
+        callbackType: value,
+        formlist: this.state.formlist.map(item => {
+          if (item.key === 'callbackType') {
+            item.initVal = value
+          }
+          item.hidden = !_options.includes(item.key)
+          return item
+        })
+      })
     } else if (key === 'sysInterface') {
       if (value === 'true') {
         this.props.form.setFieldsValue({
diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx
index e406576..7f54c4d 100644
--- a/src/menu/components/form/formaction/formconfig.jsx
+++ b/src/menu/components/form/formaction/formconfig.jsx
@@ -92,6 +92,9 @@
       }, {
         value: 'inner',
         text: '鍐呴儴鍑芥暟'
+      }, {
+        value: 'none',
+        text: '鏃�'
       }]
     },
     {
@@ -126,7 +129,7 @@
       tooltip: functip,
       fields: usefulFields,
       tooltipClass: 'middle',
-      required: card.intertype === 'inner',
+      required: true,
       readonly: false
     },
     {
@@ -224,6 +227,12 @@
       }, {
         value: 'default',
         text: '鍚庡彴鑴氭湰'
+      }, {
+        value: 'func',
+        text: '鍥炶皟鍑芥暟'
+      }, {
+        value: 'none',
+        text: '鏃�'
       }]
     },
     {
@@ -238,7 +247,7 @@
       key: 'callbackFunc',
       label: Formdict['header.form.callbackFunc'],
       initVal: card.callbackFunc || '',
-      required: false,
+      required: true,
       readonly: false
     },
     {

--
Gitblit v1.8.0