From 26d0fa42ea8c63a87e8ef93d0915f75f46fb1f9c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 三月 2022 11:09:53 +0800
Subject: [PATCH] 2022-03-24

---
 src/tabviews/zshare/mutilform/index.jsx |   58 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 21981c0..dc188ee 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -735,43 +735,43 @@
   recordChange = (values, item) => {
     this.record = {...this.record, ...values}
 
-    if (item && item.controlFields) {
-      let map = new Map()
-      this.state.formlist.forEach(cell => {
-        if (!cell.field) return
-        map.set(cell.field, cell)
-      })
+    if (!item || !item.controlFields) return
 
-      let reset = (current) => {
-        let val = this.record[current.field]
+    let map = new Map()
+    this.state.formlist.forEach(cell => {
+      if (!cell.field) return
+      map.set(cell.field, cell)
+    })
 
-        current.controlFields.forEach(cell => {
-          let m = map.get(cell.field)
-          m.hidden = current.hidden || !cell.values.includes(val)
+    let reset = (current) => {
+      let val = this.record[current.field]
 
-          if (m.hidden) {
-            m.initval = this.record[m.field]
-          }
+      current.controlFields.forEach(cell => {
+        let m = map.get(cell.field)
+        m.hidden = current.hidden || !cell.values.includes(val)
 
-          map.set(cell.field, m)
+        if (m.hidden) {
+          m.initval = this.record[m.field]
+        }
 
-          if (m.controlFields) {
-            reset(m)
-          }
-        })
-      }
+        map.set(cell.field, m)
 
-      reset(item)
-
-      this.setState({
-        formlist: this.state.formlist.map(cell => {
-          if (cell.field) {
-            return map.get(cell.field)
-          }
-          return cell
-        })
+        if (m.controlFields) {
+          reset(m)
+        }
       })
     }
+
+    reset(item)
+
+    this.setState({
+      formlist: this.state.formlist.map(cell => {
+        if (cell.field) {
+          return map.get(cell.field)
+        }
+        return cell
+      })
+    })
   }
 
   getFields() {

--
Gitblit v1.8.0