From c95918fb0fffb61b1117fbf4cd429e291b9594d0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 17 九月 2021 01:02:34 +0800
Subject: [PATCH] 2021-09-17

---
 src/tabviews/custom/components/card/table-card/index.jsx |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx
index d852e7e..748e8d3 100644
--- a/src/tabviews/custom/components/card/table-card/index.jsx
+++ b/src/tabviews/custom/components/card/table-card/index.jsx
@@ -8,7 +8,6 @@
 import Utils from '@/utils/utils.js'
 import asyncComponent from '@/utils/asyncComponent'
 import UtilsDM from '@/utils/utils-datamanage.js'
-import { modifyTabview } from '@/store/action'
 import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
@@ -333,21 +332,9 @@
       }
 
       if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) {
-        this.props.modifyTabview([newtab])
+        MKEmitter.emit('modifyTabs', newtab, 'replace')
       } else {
-        let tabs = this.props.tabviews.filter((tab, i) => {
-          tab.selected = false
-          return tab.MenuID !== newtab.MenuID
-        })
-
-        if (this.props.tabviews.length > tabs.length) {
-          this.props.modifyTabview(fromJS(tabs).toJS())
-        }
-
-        this.setState({}, () => {
-          tabs.push(newtab)
-          this.props.modifyTabview(tabs)
-        })
+        MKEmitter.emit('modifyTabs', newtab, 'plus')
       }
     } else if (card.setting.click === 'link') {
       let src = card.setting.linkurl
@@ -444,14 +431,11 @@
 const mapStateToProps = (state) => {
   return {
     permMenus: state.permMenus,
-    tabviews: state.tabviews,
   }
 }
 
-const mapDispatchToProps = (dispatch) => {
-  return {
-    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
-  }
+const mapDispatchToProps = () => {
+  return {}
 }
 
 export default connect(mapStateToProps, mapDispatchToProps)(TableCard)
\ No newline at end of file

--
Gitblit v1.8.0