From daa026309b564d861491b33799e4935b402b8018 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 24 十一月 2021 22:49:49 +0800
Subject: [PATCH] 2021-11-24

---
 src/menu/components/share/actioncomponent/actionform/index.jsx |   32 +++++++++++---------------------
 1 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index 8bc29d8..00c691a 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -16,7 +16,7 @@
   exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'],
   excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'],
   excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'],
-  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement'],
+  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement', 'syncComponent'],
   tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'],
   innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'],
   funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width']
@@ -98,7 +98,7 @@
     let _intertype = card.intertype || 'system'  // 鎺ュ彛绫诲瀷
     let _funcType = card.funcType || ''          // 鍔熻兘鎸夐挳榛樿绫诲瀷
     let _procMode = card.procMode || 'system'
-    let _Ot = card.Ot || 'requiredSgl'
+    let _Ot = card.Ot
     let _pageTemplate = card.pageTemplate || ''
     let control = card.control || ''
 
@@ -129,18 +129,14 @@
           let iscustom = ['pop', 'prompt', 'exec'].includes(_opentype)
           item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom'))
         } else if (item.key === 'Ot') {
-          if (type === 'card') {
-            if (card.sqlType === 'insert') {
-              item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value))
-            } else {
-              item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
-            }
+          if (card.sqlType === 'insert') {
+            item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value))
+          } else if (type === 'card') {
+            item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
           } else if (_pageTemplate === 'pay') { // 琛岀骇鎸夐挳銆佹敮浠樻寜閽紝鍙兘閫夊崟琛�
             item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value))
           } 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'].includes(op.value))
           } else {
             item.options = this.state.requireOptions
           }
@@ -251,7 +247,7 @@
    * 3銆佸垏鎹㈡爣绛剧被鍨嬶紝閲嶇疆鍙�夋爣绛�
    */
   optionChange = (key, value) => {
-    const { card, type } = this.props
+    const { type } = this.props
     const { openType, procMode, Ot, pageTemplate, control } = this.state
 
     if (key === 'OpenType') {
@@ -369,16 +365,14 @@
       let _fieldval = {}
       this.setState({
         formlist: this.state.formlist.map(item => {
-          if (item.key === 'Ot' && type === 'card') {
+          if (item.key === 'Ot') {
             if (value === 'insert') {
               item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value))
-            } else {
+            } else if (type === 'card') {
               item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
+            } else {
+              item.options = this.state.requireOptions
             }
-          } else if (item.key === 'Ot' && value === 'insert') {
-            item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value))
-          } else if (item.key === 'Ot') {
-            item.options = this.state.requireOptions
           }
           return item
         })
@@ -399,10 +393,6 @@
           _fieldval.label = '鍒犻櫎'
           _fieldval.class = 'danger'
           _fieldval.Ot = 'requiredSgl'
-        }
-
-        if (card.$type === 'tableButton') { // 琛ㄦ牸鎸夐挳
-          delete _fieldval.Ot
         }
 
         this.props.form.setFieldsValue(_fieldval)

--
Gitblit v1.8.0