From 0d8af0af44fa23d482fc3e20cf1a51e4f8862bea Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 18 七月 2023 15:07:54 +0800
Subject: [PATCH] 2023-07-18

---
 src/components/header/index.jsx |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 8317b28..6157a99 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -135,12 +135,9 @@
 
       window.GLOB.mkThdMenus = [...thdMenuList, {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'}]
 
-      if (_menu) { // 寤舵椂鎵撳紑锛岄槻姝㈡爣绛剧粍鏈畬鎴愬姞杞�
-        setTimeout(() => {
-          MKEmitter.emit('modifyTabs', _menu)
-        }, 200)
+      if (_menu) {
+        this.openTab(_menu, 0)
       }
-      MKEmitter.emit('mkMenuLoaded')
     })
     
     // 鑾峰彇瑙掕壊鏉冮檺, edition_type 鎺ュ彛鐗堟湰鎺у埗 ''銆�'Y'銆�'A'
@@ -167,12 +164,26 @@
           })
         }
 
-        MKEmitter.emit('mkActionLoaded')
         window.GLOB.mkActions = _permAction
       })
     }, 50)
   }
 
+  openTab = (menu, times) => {
+    if (times > 50) return
+    times++
+
+    let tabgroup = document.getElementById('mk-tabgroup-wrap')
+
+    if (window.GLOB.mkActions.loaded && tabgroup) {
+      MKEmitter.emit('modifyTabs', menu)
+    } else {
+      setTimeout(() => {
+        this.openTab(times)
+      }, 200)
+    }
+  }
+
   getMenulist = (result) => {
     let thdMenuList = []
     let menulist = []

--
Gitblit v1.8.0