From 682a74e858e5a6cd24d36183931d3afafd6443d7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 31 三月 2021 10:56:48 +0800
Subject: [PATCH] 2021-03-31

---
 src/menu/modalconfig/index.jsx |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx
index 06f94c0..631bffc 100644
--- a/src/menu/modalconfig/index.jsx
+++ b/src/menu/modalconfig/index.jsx
@@ -53,7 +53,8 @@
     sources: null,         // 琛ㄥ崟绫诲瀷
     sqlVerifing: false,    // sql楠岃瘉
     openEdition: '',       // 缂栬緫鐗堟湰鏍囪锛岄槻姝㈠浜烘搷浣�
-    showField: false       // 鏄剧ず琛ㄥ崟瀛楁鍊�
+    showField: false,      // 鏄剧ず琛ㄥ崟瀛楁鍊�
+    standardform: null
   }
 
   /**
@@ -120,6 +121,7 @@
       value: '',
       text: '绌�'
     }]
+    let standardform = null
 
     _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color')
     _tabfields = config.fields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
@@ -127,7 +129,11 @@
 
     let uniq = new Map()
     uniq.set(card.field, true)
-    config.fields.forEach(item => {
+    let index = null
+    config.fields.forEach((item, i) => {
+      if (card.uuid === item.uuid) {
+        index = i
+      }
       if (item.type !== 'select' && item.type !== 'link' && item.type !== 'radio') return
       if (item.field && !uniq.has(item.field)) {
         uniq.set(item.field, true)
@@ -142,6 +148,13 @@
         })
       }
     })
+    if (index !== null) {
+      if (index === 0) {
+        standardform = config.fields[index + 1] || null
+      } else {
+        standardform = config.fields[index - 1] || null
+      }
+    }
 
     componentConfig.columns.forEach(col => {
       if (col.field && !uniq.has(col.field)) {
@@ -160,6 +173,7 @@
     }
 
     this.setState({
+      standardform,
       visible: true,
       card: card,
       formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, !!this.props.editTab)
@@ -462,6 +476,7 @@
             card={this.state.card}
             formlist={this.state.formlist}
             inputSubmit={this.handleSubmit}
+            standardform={this.state.standardform}
             wrappedComponentRef={(inst) => this.formRef = inst}
           />
         </Modal>

--
Gitblit v1.8.0