From e4666c46c685ec7eabff25af9890d54c0ff2952b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 16 六月 2023 17:55:56 +0800
Subject: [PATCH] 2023-06-16

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

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index 9b4f575..3a832cd 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -12,6 +12,7 @@
 const { TextArea } = Input
 const { Paragraph } = Typography
 const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
+const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable'))
 const acTyOptions = {
   pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'],
   prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'],
@@ -92,6 +93,8 @@
 
     let hasclass = true
     this.props.formlist.forEach(item => {
+      if (!item.key) return
+
       this.record[item.key] = item.initVal
 
       if (item.key === 'class') {
@@ -163,7 +166,7 @@
       reOptions.intertype = this.state.interTypeOptions
 
       if (intertype === 'custom') {
-        shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross')
+        shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross', 'stringify')
         if (this.record.procMode === 'system') {
           shows.push('sql', 'sqlType')
         } else if (this.record.procMode === 'inner') {
@@ -206,6 +209,9 @@
         }
       } else if (intertype === 'inner') {
         shows.push('innerFunc', 'output')
+        if (Ot === 'requiredOnce') { // 鍓嶇疆鍑芥暟
+          shows.push('preFunc')
+        }
         reRequired.innerFunc = true
       } else {
         shows.push('sql', 'sqlType', 'output')
@@ -243,7 +249,7 @@
 
       if (this.record.formType === 'switch') {
         shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText')
-      } else if (this.record.formType === 'counter') {
+      } else if (this.record.formType === 'counter' || this.record.formType === 'count_line') {
         shows.push('field', 'size', 'min', 'max', 'decimal')
       } else if (this.record.formType === 'radio') {
         shows.push('field', 'checkType', 'openVal', 'closeVal')
@@ -302,6 +308,11 @@
         value: 'custom',
         text: '鑷畾涔�'
       }]
+
+      if (this.record.formType === 'count_line') {
+        reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value))
+        shows = shows.filter(op => ['label', 'OpenType', 'formType', 'Ot', 'width', 'title', 'hidden', 'field', 'size', 'min', 'max', 'decimal'].includes(op))
+      }
     } else if (openType === 'excelIn') {
       reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
       reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
@@ -517,6 +528,10 @@
       }
     }
 
+    if (shows.includes('syncComponent') && this.record.syncComponent[0] === 'multiComponent') {
+      shows.push('syncComponents')
+    }
+
     if (this.record.show === 'icon') {
       reRequired.icon = true
     } else {
@@ -608,6 +623,11 @@
       }
 
       this.props.updRecord && this.props.updRecord(this.record)
+    } else if (key === 'formType') {
+      if (value === 'count_line') {
+        _fieldval.Ot = 'requiredSgl'
+        this.record.Ot = 'requiredSgl'
+      }
     } else if (key === 'funcType') {
       if (value === 'print') {
         _fieldval.label = '鎵撳嵃'
@@ -763,7 +783,7 @@
             { pattern: /^[a-zA-Z0-9@_]+$/, message: '琛ㄥ悕鍙彲浣跨敤瀛楁瘝銆佹暟瀛椾互鍙奯' },
             { max: formRule.func.max, message: formRule.func.maxMessage }
           )
-        } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') {
+        } else if (item.key === 'outerFunc' || item.key === 'callbackFunc' || item.key === 'preFunc') {
           rules.push(
             { pattern: formRule.func.pattern, message: formRule.func.message },
             { max: formRule.func.max, message: formRule.func.maxMessage }
@@ -855,7 +875,14 @@
           { required: item.required, message: '璇烽�夋嫨' + item.label + '!' }
         ]
 
-        content = <Cascader options={item.options || []} expandTrigger="hover" placeholder=""/>
+        content = <Cascader onChange={(value) => {this.optionChange(item.key, value)}} options={item.options || []} expandTrigger="hover" placeholder=""/>
+      } else if (item.type === 'table') {
+        span = 24
+        className = 'textarea'
+        rules = [
+          { required: item.required, message: '璇锋坊鍔�' + item.label + '!' }
+        ]
+        content = (<MKTable tip={''} columns={item.columns || []} actions={[]}/>)
       } else if (item.type === 'icon') {
         rules = [
           { required: item.required, message: '璇烽�夋嫨' + item.label + '!' }
@@ -997,7 +1024,7 @@
                 values.verify.invalid = 'true'
               }
             }
-          } else if (values.OpenType === 'tab' && values.linkmenu) {
+          } else if (values.OpenType === 'tab' && values.linkmenu && Array.isArray(values.linkmenu)) {
             if (sessionStorage.getItem('thdMenuList')) {
               let list = null
               try {
@@ -1038,7 +1065,7 @@
               }
             })
           }
-          
+
           resolve(values)
         } else {
           reject(err)

--
Gitblit v1.8.0