From f895e8af9e6a393f71fec0dc26fdf1b9b6616cb4 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 11 十二月 2020 18:53:04 +0800
Subject: [PATCH] 2020-12-11

---
 src/menu/modalconfig/index.jsx |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx
index 878cb09..32e9b5f 100644
--- a/src/menu/modalconfig/index.jsx
+++ b/src/menu/modalconfig/index.jsx
@@ -179,10 +179,10 @@
    */
   handleForm = (_card) => {
     const { componentConfig } = this.props
-    let card = fromJS(_card).toJS()
-
     const { config } = this.state
+    let card = fromJS(_card).toJS()
     let _inputfields = []
+    let _tabfields = []
     let _linkableFields = []
     let _linksupFields = [{
       value: '',
@@ -193,21 +193,20 @@
     // 璁剧疆涓嬫媺鑿滃崟鍙叧鑱斿瓧娈�(涓婄骇涓庝笅绾�)
     if (config.groups.length > 0) {
       config.groups.forEach(group => {
-        let sublist = group.sublist.filter(item => item.type === 'text' || item.type === 'number')
-        _inputfields = [..._inputfields, ...sublist]
-
-        let suplist = group.sublist.filter(item => item.type === 'select' || item.type === 'link')
-        _formfields = [..._formfields, ...suplist]
+        _formfields = [..._formfields, ...group.sublist]
       })
     } else {
-      _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number')
-      
-      _formfields = config.fields.filter(item => item.type === 'select' || item.type === 'link')
+      _formfields = config.fields
     }
+
+    _inputfields = _formfields.filter(item => item.type === 'text' || item.type === 'number')
+    _tabfields = _formfields.filter(item => card.field !== item.field && ['text', 'number', 'select', 'link'].includes(item.type))
+    _tabfields.unshift({field: '', text: '鍘熻〃鍗�'})
 
     let uniq = new Map()
     uniq.set(card.field, true)
     _formfields.forEach(item => {
+      if (item.type !== 'select' && item.type !== 'link' && item.type !== 'radio') return
       if (item.field && !uniq.has(item.field)) {
         uniq.set(item.field, true)
 
@@ -232,7 +231,6 @@
         })
       }
     })
-    
 
     if (card.linkSubField && card.linkSubField.length > 0) {
       let fields = _inputfields.map(item => item.field)
@@ -242,7 +240,7 @@
     this.setState({
       visible: true,
       card: card,
-      formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab)
+      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, !!this.props.editTab)
     })
   }
 

--
Gitblit v1.8.0