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/form/tab-form/index.jsx |   24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/src/tabviews/custom/components/form/tab-form/index.jsx b/src/tabviews/custom/components/form/tab-form/index.jsx
index 4082856..98bb970 100644
--- a/src/tabviews/custom/components/form/tab-form/index.jsx
+++ b/src/tabviews/custom/components/form/tab-form/index.jsx
@@ -12,7 +12,6 @@
 import MKEmitter from '@/utils/events.js'
 import zhCN from '@/locales/zh-CN/main.js'
 import enUS from '@/locales/en-US/main.js'
-import { modifyTabview } from '@/store/action'
 import './index.scss'
 
 const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform'))
@@ -221,19 +220,11 @@
         param: {$BID: id || ''}
       }
 
-      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())
+      if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) {
+        MKEmitter.emit('modifyTabs', newtab, 'replace')
+      } else {
+        MKEmitter.emit('modifyTabs', newtab, 'plus')
       }
-
-      this.setState({}, () => {
-        tabs.push(newtab)
-        this.props.modifyTabview(tabs)
-      })
     }
   }
 
@@ -349,14 +340,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)(TabForm)
\ No newline at end of file

--
Gitblit v1.8.0