From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 07 四月 2021 23:25:29 +0800
Subject: [PATCH] 2021-04-07

---
 src/menu/components/share/actioncomponent/actionform/index.jsx |   55 +++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index e584aea..f7494bf 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -15,11 +15,11 @@
   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'],
+  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'],
   funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width']
 }
 
-class MainSearch extends Component {
+class ActionForm extends Component {
   static propTpyes = {
     dict: PropTypes.object,      // 瀛楀吀椤�
     type: PropTypes.any,         // type涓�"card"鏃讹紝鍙彲閫夊崟琛屾垨涓嶉�夎
@@ -89,8 +89,8 @@
 
     let _opentype = card.OpenType                // 鎵撳紑鏂瑰紡
     let _intertype = card.intertype || 'system'  // 鎺ュ彛绫诲瀷
-    let _funcType = card.funcType || 'print'     // 鍔熻兘鎸夐挳榛樿绫诲瀷
-    let _procMode = card.procMode || 'system'     // 鍙傛暟璇锋眰鏂瑰紡
+    let _funcType = card.funcType || ''          // 鍔熻兘鎸夐挳榛樿绫诲瀷
+    let _procMode = card.procMode || 'system'    // 鍙傛暟璇锋眰鏂瑰紡
 
     let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode)
 
@@ -114,7 +114,7 @@
             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)) {
+          } else if (['innerpage', 'tab', 'popview', 'excelIn'].includes(_opentype)) {
             item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
           } else if (card.sqlType === 'insert') {
             item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl', 'required'].includes(op.value))
@@ -143,6 +143,10 @@
     if (_opentype === 'innerpage') {         // 鏂伴〉闈紝鍙�夋ā鏉�(鑷畾涔夋椂锛屽彲濉叆澶栭儴閾炬帴)
       if (_pageTemplate === 'custom') {
         _options.push('url', 'joint')
+      } else if (_pageTemplate === 'page') {
+        _options.push('copyMenuId', 'joint')
+      } else if (_pageTemplate === 'linkpage') {
+        _options.push('linkmenu', 'joint')
       }
     } else if (_opentype === 'excelOut') {    // 瀵煎叆瀵煎嚭
       if (_intertype === 'outer') {
@@ -167,7 +171,7 @@
       }
     } else if (_opentype !== 'popview' && _opentype !== 'tab') {
       if (_intertype === 'custom') {
-        _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method')
+        _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross')
         if (_procMode === 'system') {
           _options.push('sql', 'sqlType')
         } else {
@@ -228,7 +232,7 @@
         } else if (item.key === 'Ot') {
           if (type === 'card') {
             item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
-          } else if (['innerpage', 'blank', 'tab', 'popview'].includes(value)) {
+          } else if (['innerpage', 'tab', 'popview'].includes(value)) {
             item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
             _fieldval.Ot = 'requiredSgl'
           } else if (value === 'excelIn') {
@@ -266,7 +270,7 @@
         this.props.form.setFieldsValue(_fieldval)
       })
     } else if (key === 'funcType') {
-      let _options = this.getOptions(this.state.openType, this.state.interType, value, card.pageTemplate, procMode)
+      let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode)
       let _fieldval = {}
 
       this.setState({
@@ -330,10 +334,9 @@
       })
     } else if (key === 'pageTemplate') {
       let _fieldval = {}
-      let _options = this.getOptions(this.state.openType, this.state.interType, this.state.funcType, value, procMode)
+      let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode)
 
       this.setState({
-        openType: value,
         formlist: this.state.formlist.map(item => {
           item.hidden = !_options.includes(item.key)
 
@@ -471,6 +474,14 @@
             </Form.Item>
           </Col>
         )
+      } else if (item.type === 'tip') {
+        fields.push(
+          <Col span={12} key={index}>
+            <Form.Item label={item.label}>
+              {item}
+            </Form.Item>
+          </Col>
+        )
       } else if (item.type === 'number') {
         fields.push(
           <Col span={12} key={index}>
@@ -529,7 +540,12 @@
       } else if (item.type === 'radio') {
         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: [
@@ -604,13 +620,13 @@
   }
 
   handleConfirm = () => {
-    const { setting } = this.props
+    const { setting, card } = this.props
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
-          values.uuid = this.props.card.uuid
-          values.verify = this.props.card.verify || null
+          values.uuid = card.uuid
+          values.verify = card.verify || null
 
           if (values.show === 'icon' && !values.icon) {
             notification.warning({
@@ -631,8 +647,15 @@
             
             values.Ot = 'notRequired'
           } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) {
-            if ((values.Ot === 'requiredOnce' || this.props.card.Ot === 'requiredOnce') && this.props.card.Ot !== values.Ot) {
+            if ((values.Ot === 'requiredOnce' || card.Ot === 'requiredOnce') && card.Ot !== values.Ot) {
               values.verify.uniques = []
+            }
+            if (card.Ot !== values.Ot) {
+              if (values.Ot === 'notRequired') {
+                values.verify.invalid = 'false'
+              } else if (card.Ot === 'notRequired' && values.Ot !== 'notRequired') {
+                values.verify.invalid = 'true'
+              }
             }
           }
           
@@ -663,4 +686,4 @@
   }
 }
 
-export default Form.create()(MainSearch)
\ No newline at end of file
+export default Form.create()(ActionForm)
\ No newline at end of file

--
Gitblit v1.8.0