From 875ddf51cac56da2b098c570866a5ea997132064 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 24 三月 2021 19:22:55 +0800
Subject: [PATCH] 2021-03-24

---
 src/tabviews/custom/components/share/normalTable/index.jsx |   32 ++++++++++++--------------------
 1 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 255cfa3..c3d2d10 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -201,11 +201,11 @@
       if (col.rowspan === 'true') {
         resProps.rowSpan = record['$$' + col.field]
       }
-
+      
       if (col.linkThdMenu || col.linkurl) {
         content = (
           <div>
-            <div className="link-menu" onDoubleClick={(e) => this.triggerLink(e, col, record)}></div>
+            <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div>
             {content}
           </div>
         )
@@ -255,7 +255,7 @@
       if (col.linkThdMenu || col.linkurl) {
         content = (
           <div>
-            <div className="link-menu" onDoubleClick={(e) => this.triggerLink(e, col, record)}></div>
+            <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div>
             {content}
           </div>
         )
@@ -504,7 +504,7 @@
 
   // 瀛楁閫忚
   triggerLink = (e, item, record) => {
-    const { tabviews, MenuID } = this.props
+    const { tabviews } = this.props
     e.stopPropagation()
 
     if (item.linkThdMenu) {
@@ -518,27 +518,19 @@
   
       tabmenu.selected = true
   
-      let index = 0
-      let isexit = false
-      let tabs = tabviews.map((tab, i) => {
+      let tabs = tabviews.filter((tab, i) => {
         tab.selected = false
-  
-        if (tab.MenuID === MenuID) {
-          index = i
-        } else if (tab.MenuID === tabmenu.MenuID) {
-          tab.param = tabmenu.param
-          tab.selected = true
-          isexit = true
-        }
-  
-        return tab
+        return tab.MenuID !== tabmenu.MenuID
       })
   
-      if (!isexit) {
-        tabs.splice(index + 1, 0, tabmenu)
+      if (tabviews.length > tabs.length) {
+        this.props.modifyTabview(fromJS(tabs).toJS())
       }
   
-      this.props.modifyTabview(tabs)
+      this.setState({}, () => {
+        tabs.push(tabmenu)
+        this.props.modifyTabview(tabs)
+      })
     } else {
       let src = item.linkurl
 

--
Gitblit v1.8.0