From 569ccb3c1ff82f30ffefa7d3700571448d742662 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 03 十二月 2020 11:46:28 +0800
Subject: [PATCH] 2020-12-03

---
 src/menu/actioncomponent/actionform/index.jsx |   42 ++++++++----------------------------------
 1 files changed, 8 insertions(+), 34 deletions(-)

diff --git a/src/menu/actioncomponent/actionform/index.jsx b/src/menu/actioncomponent/actionform/index.jsx
index a9758c6..176e55f 100644
--- a/src/menu/actioncomponent/actionform/index.jsx
+++ b/src/menu/actioncomponent/actionform/index.jsx
@@ -48,9 +48,6 @@
       text: this.props.dict['header.form.requiredOnce']
     }],
     insertUpdateOptions: [{
-      value: '',
-      text: this.props.dict['model.empty']
-    }, {
       value: 'insert',
       text: this.props.dict['header.form.action.insert']
     }, {
@@ -79,7 +76,6 @@
   UNSAFE_componentWillMount () {
     const { card, type } = this.props
 
-    let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || ''
     let _opentype = card.OpenType                // 鎵撳紑鏂瑰紡
     let _intertype = card.intertype || 'system'  // 鎺ュ彛绫诲瀷
     let _funcType = card.funcType || 'print'     // 鍔熻兘鎸夐挳榛樿绫诲瀷
@@ -92,7 +88,6 @@
 
     this.setState({
       openType: _opentype,
-      menulist: _menulist.options || [],
       interType: _intertype,
       funcType: _funcType,
       formlist: this.props.formlist.map(item => {
@@ -155,7 +150,7 @@
           _options.push('execMode', 'intertype', 'innerFunc', 'Ot', 'execSuccess', 'execError')
         }
       }
-    } else if (_opentype === 'popview' && _opentype === 'tab') {
+    } else if (_opentype !== 'popview' && _opentype !== 'tab') {
       if (_intertype === 'outer') {
         _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
       } else if (_intertype === 'inner') {
@@ -174,7 +169,7 @@
     if (card.focus) {
       try {
         let _form = document.getElementById('label')
-        _form.select()
+        _form && _form.select()
       } catch {
         console.warn('琛ㄥ崟focus澶辫触锛�')
       }
@@ -295,6 +290,10 @@
           _fieldval.label = '鍒犻櫎'
           _fieldval.class = 'danger'
           _fieldval.Ot = 'requiredSgl'
+        }
+
+        if (card.$type === 'tableButton') { // 琛ㄦ牸鎸夐挳
+          delete _fieldval.Ot
         }
 
         this.props.form.setFieldsValue(_fieldval)
@@ -544,10 +543,7 @@
                   }
                 ]
               })(
-                <Cascader
-                  options={this.state.menulist}
-                  placeholder=""
-                />
+                <Cascader options={item.options || []} placeholder=""/>
               )}
             </Form.Item>
           </Col>
@@ -571,7 +567,6 @@
 
   handleConfirm = () => {
     const { setting } = this.props
-    const { menulist } = this.state
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
@@ -604,30 +599,9 @@
               values.OpenType = values.execMode
             }
           } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) {
-            if (values.Ot === 'requiredOnce' && ['notRequired', 'requiredSgl', 'required'].includes(this.props.card.Ot)) {
-              values.verify.uniques = []
-            } else if (this.props.card.Ot === 'requiredOnce' && ['notRequired', 'requiredSgl', 'required'].includes(values.Ot)) {
+            if ((values.Ot === 'requiredOnce' || this.props.card.Ot === 'requiredOnce') && this.props.card.Ot !== values.Ot) {
               values.verify.uniques = []
             }
-          }
-
-          // 鍏宠仈涓夌骇鑿滃崟
-          if (values.OpenType === 'tab' && values.linkmenu && values.linkmenu.length > 0) {
-            let linkThdMenu = ''
-            menulist.forEach(menu => {
-              if (menu.value === values.linkmenu[0]) {
-                menu.children.forEach(item => {
-                  if (item.value === values.linkmenu[1]) {
-                    item.children.forEach(cell => {
-                      if (cell.value === values.linkmenu[2]) {
-                        linkThdMenu = cell
-                      }
-                    })
-                  }
-                })
-              }
-            })
-            values.linkThdMenu = linkThdMenu
           }
           
           resolve(values)

--
Gitblit v1.8.0