From 822bc67061448c6e3a1eb77d39be4ad2b84b416a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 27 二月 2020 09:36:34 +0800
Subject: [PATCH] 2020-02-27

---
 src/templates/formtabconfig/index.jsx |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx
index ebde15e..064cd75 100644
--- a/src/templates/formtabconfig/index.jsx
+++ b/src/templates/formtabconfig/index.jsx
@@ -360,13 +360,19 @@
   }
 
   handleSearch = (card) => {
+    const {menu} = this.props
     const { config } = this.state
     let _inputfields = []
+    let _linkableFields = []
+    let _formfields = []
 
     // 璁剧疆涓嬫媺鑿滃崟鍙叧鑱斿瓧娈�
     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]
     })
     
     if (card.linkSubField && card.linkSubField.length > 0) {
@@ -374,10 +380,35 @@
       card.linkSubField = card.linkSubField.filter(item => fields.includes(item))
     }
 
+    let uniq = new Map()
+    _formfields.forEach(item => {
+      if (item.field && !uniq.has(item.field)) {
+        uniq.set(item.field, true)
+
+        _linkableFields.push({
+          value: item.field,
+          text: item.label + ' (琛ㄥ崟)'
+        })
+      }
+    })
+
+    if (menu.LongParam) {
+      menu.LongParam.columns.forEach(col => {
+        if (col.field && !uniq.has(col.field)) {
+          uniq.set(col.field, true)
+
+          _linkableFields.push({
+            value: col.field,
+            text: col.label + ' (鏄剧ず鍒�)'
+          })
+        }
+      })
+    }
+
     this.setState({
       modaltype: 'search',
       card: card,
-      formlist: getModalForm(card, _inputfields)
+      formlist: getModalForm(card, _inputfields, _linkableFields)
     })
   }
 

--
Gitblit v1.8.0