From d6dfba48678e1107a9e7c6524e1dfa2d3fdff03c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 08 十月 2021 19:29:21 +0800
Subject: [PATCH] 2021-10-08

---
 src/tabviews/custom/components/form/normal-form/index.jsx |   25 ++++++-------------------
 1 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/src/tabviews/custom/components/form/normal-form/index.jsx b/src/tabviews/custom/components/form/normal-form/index.jsx
index 54a0d90..85fcccc 100644
--- a/src/tabviews/custom/components/form/normal-form/index.jsx
+++ b/src/tabviews/custom/components/form/normal-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'))
@@ -246,23 +245,14 @@
 
       let newtab = {
         ...menu,
-        selected: true,
         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', true)
       }
-
-      this.setState({}, () => {
-        tabs.push(newtab)
-        this.props.modifyTabview(tabs)
-      })
     }
   }
 
@@ -404,14 +394,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)(NormalForm)
\ No newline at end of file

--
Gitblit v1.8.0