From 6c44bc79e5edc338b44fdc469220ddf0e3fc4028 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 14 九月 2021 22:51:27 +0800
Subject: [PATCH] 2021-09-14

---
 src/tabviews/zshare/actionList/tabbutton/index.jsx |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx
index db9b04b..b500308 100644
--- a/src/tabviews/zshare/actionList/tabbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -46,11 +46,7 @@
   }
 
   componentDidMount () {
-    const { position } = this.props
-
-    if (position === 'toolbar') {
-      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
-    }
+    MKEmitter.addListener('triggerBtnId', this.actionTrigger)
   }
 
   UNSAFE_componentWillReceiveProps (nextProps) {
@@ -81,10 +77,16 @@
   /**
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
    */
-  actionTrigger = (triggerId, record) => {
+  actionTrigger = (triggerId, record, type) => {
     const { setting, btn, tabviews, MenuID, selectedData } = this.props
 
     if (triggerId && btn.uuid !== triggerId) return
+
+    if (type === 'linkbtn' && selectedData && selectedData.length === 1) {
+      if (record[0].$Index !== selectedData[0].$Index) {
+        return
+      }
+    }
     
     let data = record || selectedData || []
 
@@ -120,10 +122,18 @@
           primaryId: primaryId
         }
       }
-    } else if (btn.tabTemplate === 'ThdMenu') {
+    // } else if (btn.tabTemplate === 'ThdMenu') {
+    } else {
       let menu = null
 
-      if (btn.linkmenu && btn.linkmenu.length > 0) {
+      if (btn.MenuID) {
+        menu = {
+          MenuID: btn.MenuID,
+          MenuName: btn.MenuName,
+          MenuNo: btn.MenuNo,
+          type: btn.tabType
+        }
+      } else if (btn.linkmenu && btn.linkmenu.length > 0) {
         let menu_id = btn.linkmenu.slice(-1)[0]
         menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || ''
       }

--
Gitblit v1.8.0