From 9c6795fd3c44e46cf3955fbfd8f8eeca23acb7a9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 十月 2022 00:31:51 +0800
Subject: [PATCH] 2022-10-08

---
 src/menu/components/share/actioncomponent/actionform/index.jsx |  107 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 89 insertions(+), 18 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index e3aff10..eb99135 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox } from 'antd'
+import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox, Typography } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 import { formRule } from '@/utils/option.js'
 
@@ -9,6 +9,7 @@
 import './index.scss'
 
 const { TextArea } = Input
+const { Paragraph } = Typography
 const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
 const acTyOptions = {
   pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'],
@@ -60,13 +61,13 @@
     }],
     interTypeOptions: [{
       value: 'system',
-      text: this.props.dict['model.interface.system']
+      text: '绯荤粺'
     }, {
       value: 'inner',
-      text: this.props.dict['model.interface.inner']
+      text: '鍐呴儴'
     }, {
       value: 'outer',
-      text: this.props.dict['model.interface.outer']
+      text: '澶栭儴'
     }, {
       value: 'custom',
       text: '鑷畾涔�'
@@ -162,22 +163,39 @@
       reOptions.intertype = this.state.interTypeOptions
 
       if (intertype === 'custom') {
-        shows.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross')
+        shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross')
         if (this.record.procMode === 'system') {
           shows.push('sql', 'sqlType')
-        } else {
+        } else if (this.record.procMode === 'inner') {
           reRequired.innerFunc = true
           shows.push('innerFunc')
+        }
+        if (this.record.callbackType === 'func') {
+          shows.push('callbackFunc')
+        } else if (this.record.callbackType !== 'none') {
+          shows.push('cbTable')
         }
         reReadonly.interface = false
         reRequired.interface = true
       } else if (intertype === 'outer') {
-        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc', 'output')
-        reRequired.innerFunc = false
+        shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType', 'output')
+        if (this.record.procMode === 'system') {
+          shows.push('sql', 'sqlType')
+        } else if (this.record.procMode === 'inner') {
+          reRequired.innerFunc = true
+          shows.push('innerFunc')
+        }
+        if (this.record.callbackType === 'func') {
+          shows.push('callbackFunc')
+        } else if (this.record.callbackType !== 'none') {
+          shows.push('cbTable')
+        }
 
         if (this.record.sysInterface === 'false') {
           reReadonly.interface = false
           reRequired.interface = true
+
+          shows.push('proInterface')
         } else {
           reReadonly.interface = true
           reRequired.interface = false
@@ -218,19 +236,33 @@
 
       if (this.record.formType === 'switch') {
         shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText')
-      } else {
+      } else if (this.record.formType === 'radio') {
         shows.push('field', 'openVal', 'closeVal')
+      } else {
+        shows.push('field')
       }
 
       reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom')
 
       if (intertype === 'outer') {
-        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
-        reRequired.innerFunc = false
+        shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType')
+        if (this.record.procMode === 'system') {
+          shows.push('sql', 'sqlType')
+        } else if (this.record.procMode === 'inner') {
+          reRequired.innerFunc = true
+          shows.push('innerFunc')
+        }
+        if (this.record.callbackType === 'func') {
+          shows.push('callbackFunc')
+        } else if (this.record.callbackType !== 'none') {
+          shows.push('cbTable')
+        }
 
         if (this.record.sysInterface === 'false') {
           reReadonly.interface = false
           reRequired.interface = true
+
+          shows.push('proInterface')
         } else {
           reReadonly.interface = true
           reRequired.interface = false
@@ -262,12 +294,15 @@
       reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
 
       if (this.record.intertype === 'outer') {
-        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
+        shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
         reRequired.innerFunc = false
+        reRequired.callbackFunc = false
 
         if (this.record.sysInterface === 'false') {
           reReadonly.interface = false
           reRequired.interface = true
+
+          shows.push('proInterface')
         } else {
           reReadonly.interface = true
           reRequired.interface = false
@@ -283,12 +318,14 @@
       reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
 
       if (this.record.intertype === 'outer') {
-        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc')
+        shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc')
         reRequired.innerFunc = false
 
         if (this.record.sysInterface === 'false') {
           reReadonly.interface = false
           reRequired.interface = true
+
+          shows.push('proInterface')
         } else {
           reReadonly.interface = true
           reRequired.interface = false
@@ -343,12 +380,15 @@
       if (_funcType === 'print') {
         shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError')
         if (this.record.intertype === 'outer') {
-          shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
+          shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
           reRequired.innerFunc = false
+          reRequired.callbackFunc = false
 
           if (this.record.sysInterface === 'false') {
             reReadonly.interface = false
             reRequired.interface = true
+
+            shows.push('proInterface')
           } else {
             reReadonly.interface = true
             reRequired.interface = false
@@ -390,6 +430,12 @@
         shows.push('innerFunc', 'Ot', 'execSuccess', 'execError', 'urlkey')
       } else if (_funcType === 'pay') {
         shows.push('payType', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu')
+        if (this.record.openmenu && this.record.openmenu !== 'goback') {
+          shows.push('open')
+        }
+        reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value))
+      } else if (_funcType === 'refund') {
+        shows.push('Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu')
         reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value))
       }
     }
@@ -582,6 +628,10 @@
         _fieldval.Ot = 'required'
       }
 
+      if (this.props.type === 'card' && _fieldval.Ot === 'required') { // 鍗$墖涓棤澶氳閫夐」
+        _fieldval.Ot = 'requiredSgl'
+      }
+
       this.record.label = _fieldval.label || this.record.label || ''
       this.record.Ot = _fieldval.Ot || this.record.Ot || ''
       this.record.class = _fieldval.class || this.record.class || ''
@@ -684,13 +734,18 @@
             { pattern: _patten, message: formRule.func.innerMessage },
             { max: formRule.func.max, message: formRule.func.maxMessage }
           )
+        } else if (item.key === 'sql' || item.key === 'sheet') {
+          rules.push(
+            { pattern: /^[a-zA-Z_]+$/, message: '琛ㄥ悕鍙彲浣跨敤瀛楁瘝浠ュ強_' },
+            { max: formRule.func.max, message: formRule.func.maxMessage }
+          )
         } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') {
           rules.push(
             { pattern: formRule.func.pattern, message: formRule.func.message },
             { max: formRule.func.max, message: formRule.func.maxMessage }
           )
         } else if (item.key === 'output') {
-          if (this.record.intertype === 'system') {
+          if (this.record.intertype === 'system' || ((this.record.intertype === 'outer' || this.record.intertype === 'custom') && this.record.callbackType === 'script')) {
             rules = [{
               pattern: /^@[0-9a-zA-Z_]+@?$/,
               message: '鍙橀噺浠绗﹀紑澶达紝鍙娇鐢ㄥ瓧姣嶃�佹暟瀛椾互鍙奯'
@@ -808,6 +863,17 @@
         </Col>
       )
     })
+
+    if (window.debugger && this.props.card.uuid) {
+      fields.push(
+        <Col span={12} key="uuid">
+          <Form.Item label="鎸夐挳ID">
+            <Paragraph copyable>{this.props.card.uuid}</Paragraph>
+          </Form.Item>
+        </Col>
+      )
+    }
+
     return fields
   }
 
@@ -822,9 +888,14 @@
           values.modal = card.modal || null
 
           if (values.OpenType === 'form') {
-            if (/^(0|[1-9]\d*)$/.test(values.openVal) && /^(0|[1-9]\d*)$/.test(values.closeVal)) {
-              values.openVal = +values.openVal
-              values.closeVal = +values.closeVal
+            if (values.formType !== 'scan') {
+              if (/^(0|[1-9]\d*)$/.test(values.openVal) && /^(0|[1-9]\d*)$/.test(values.closeVal)) {
+                values.openVal = +values.openVal
+                values.closeVal = +values.closeVal
+              }
+            } else {
+              values.show = 'icon'
+              values.icon = 'scan'
             }
           } else if (values.OpenType === 'excelOut') {
             values.Ot = 'notRequired'

--
Gitblit v1.8.0