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/templates/modalconfig/index.jsx |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx
index 3c44a2e..c1b02f2 100644
--- a/src/templates/modalconfig/index.jsx
+++ b/src/templates/modalconfig/index.jsx
@@ -205,6 +205,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))
@@ -212,7 +213,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)
@@ -227,6 +232,14 @@
         })
       }
     })
+
+    if (index !== null) {
+      if (index === 0) {
+        standardform = config.fields[index + 1] || null
+      } else {
+        standardform = config.fields[index - 1] || null
+      }
+    }
 
     if (subTabConfig) {
       subTabConfig.columns.forEach(col => {
@@ -269,6 +282,7 @@
     }
 
     this.setState({
+      standardform,
       visible: true,
       card: card,
       formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, !!this.props.editTab)
@@ -684,6 +698,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