From bfadd84fbc2b23c59695e5a94778ab7ac40fea03 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 26 六月 2021 22:54:17 +0800
Subject: [PATCH] 2021-06-26

---
 src/tabviews/custom/components/form/normal-form/index.jsx |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/tabviews/custom/components/form/normal-form/index.jsx b/src/tabviews/custom/components/form/normal-form/index.jsx
index e9fb1b3..59b40f1 100644
--- a/src/tabviews/custom/components/form/normal-form/index.jsx
+++ b/src/tabviews/custom/components/form/normal-form/index.jsx
@@ -3,7 +3,6 @@
 import { is, fromJS } from 'immutable'
 import { connect } from 'react-redux'
 import { Spin, notification, Button } from 'antd'
-// import moment from 'moment'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
@@ -40,7 +39,8 @@
   }
 
   UNSAFE_componentWillMount () {
-    const { data, BID, config } = this.props
+    const { data, BID } = this.props
+    let config = fromJS(this.props.config).toJS()
 
     let _data = null
     let _sync = false
@@ -57,6 +57,14 @@
       }
     } else {
       _data = {}
+    }
+
+    if (!config.wrap.groupLabel) {
+      if (config.subcards.length > 1) {
+        config.wrap.groupLabel = 'show'
+      } else {
+        config.wrap.groupLabel = 'hidden'
+      }
     }
 
     let roleId = sessionStorage.getItem('role_id') || ''
@@ -158,12 +166,10 @@
       }
 
       this.setState({sync: false, data: _data, group: _group, step: _group.sort - 1,})
-    } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
-      if (config.wrap.datatype !== 'static' && config.setting.syncRefresh === 'true') {
-        this.setState({}, () => {
-          this.loadData()
-        })
-      }
+    } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
+      this.setState({}, () => {
+        this.loadData()
+      })
     }
   }
 
@@ -261,7 +267,7 @@
     }
 
     let searches = []
-    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
+    if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
       let keys = searches.map(item => item.key)
       mainSearch.forEach(item => {
         if (!keys.includes(item.key)) {
@@ -371,7 +377,7 @@
             <Spin />
           </div> : null
         }
-        {config.subcards.length > 1 ? <div className="mk-normal-form-title">
+        {config.wrap.groupLabel !== 'hidden' ? <div className="mk-normal-form-title">
           {config.subcards.map(card => (
             <div key={card.uuid} className={'form-title' + (card.sort <= step ? ' active' : '')}>
               <span className="form-sort" style={{background: config.wrap.color}}>{card.sort}</span>

--
Gitblit v1.8.0