king
2021-09-17 c95918fb0fffb61b1117fbf4cd429e291b9594d0
src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -4,7 +4,6 @@
import { is, fromJS } from 'immutable'
import { Button, notification, Icon } from 'antd'
import { modifyTabview } from '@/store/action'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import MKEmitter from '@/utils/events.js'
@@ -78,7 +77,7 @@
   * @description 触发按钮操作
   */
  actionTrigger = (triggerId, record, type) => {
    const { setting, btn, tabviews, MenuID, selectedData } = this.props
    const { setting, btn, selectedData } = this.props
    if (triggerId && btn.uuid !== triggerId) return
@@ -122,7 +121,6 @@
          primaryId: primaryId
        }
      }
    // } else if (btn.tabTemplate === 'ThdMenu') {
    } else {
      let menu = null
@@ -156,32 +154,10 @@
      }
    }
    let index = 0
    let tabs = tabviews.filter((tab, i) => {
      tab.selected = false
      if (tab.MenuID === MenuID) {
        index = i
      }
      return tab.MenuID !== newtab.MenuID
    })
    if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) {
      this.props.modifyTabview([newtab])
      MKEmitter.emit('modifyTabs', newtab, 'replace')
    } else {
      if (tabviews.length !== tabs.length) {
        this.props.modifyTabview(fromJS(tabs).toJS())
      }
      this.setState({}, () => {
        if (MenuID) {
          tabs.splice(index + 1, 0, newtab)
        } else {
          tabs.push(newtab)
        }
        this.props.modifyTabview(tabs)
      })
      MKEmitter.emit('modifyTabs', newtab, 'plus')
    }
    MKEmitter.emit('openNewTab')
@@ -236,15 +212,12 @@
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
    permMenus: state.permMenus,
  }
}
const mapDispatchToProps = (dispatch) => {
  return {
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
  }
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(TabButton)