From 2015e978c64c2517d273b9d76d4134a1f623d389 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 11 六月 2024 14:16:31 +0800
Subject: [PATCH] 2024-06-11

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

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 78f4aa6..75e47b3 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -748,6 +748,7 @@
     if (action.subButton && action.subButton.resetForms) {
       MKEmitter.addListener('resetForms', this.resetForms)
     }
+    MKEmitter.addListener('resetFocus', this.resetFocus)
   }
 
   componentWillUnmount () {
@@ -755,6 +756,27 @@
       return
     }
     MKEmitter.removeListener('resetForms', this.resetForms)
+    MKEmitter.removeListener('resetFocus', this.resetFocus)
+  }
+
+  resetFocus = (id, field) => {
+    const { action } = this.props
+
+    if (id !== action.uuid) return
+
+    let focusId = ''
+
+    this.state.formlist.forEach(item => {
+      if (item.field === field) {
+        focusId = item.uuid
+      }
+    })
+
+    if (!focusId) return
+
+    setTimeout(() => {
+      MKEmitter.emit('mkFC', 'focus', focusId)
+    }, 20)
   }
 
   resetForms = (id, data) => {

--
Gitblit v1.8.0