king
2021-09-17 c95918fb0fffb61b1117fbf4cd429e291b9594d0
src/components/sidemenu/index.jsx
@@ -4,7 +4,6 @@
import { is, fromJS } from 'immutable'
import { Menu, Icon } from 'antd'
import { modifyTabview } from '@/store/action'
import MKEmitter from '@/utils/events.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
@@ -55,24 +54,9 @@
    if (menu.OpenType === 'newpage' || menu.OpenType === 'NewPage') {
      window.open(menu.src)
    } else if (menu.OpenType === 'blank') {
      menu.selected = true
      this.props.modifyTabview([menu])
      MKEmitter.emit('modifyTabs', menu, 'replace')
    } else {
      let tabs = fromJS(this.props.tabviews).toJS()
      tabs = tabs.filter(tab => {
        tab.selected = false
        return tab.MenuID !== menu.MenuID
      })
      if (this.props.tabviews.length > tabs.length) {
        this.props.modifyTabview(fromJS(tabs).toJS())
      }
      this.setState({}, () => {
        menu.selected = true
        tabs.push(menu)
        this.props.modifyTabview(tabs)
      })
      MKEmitter.emit('modifyTabs', menu, 'plus')
    }
    if (window.GLOB.systemType === 'production') {
@@ -144,7 +128,6 @@
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
    collapse: state.collapse,
    isiframe: state.isiframe,
    mainMenu: state.mainMenu,
@@ -153,9 +136,7 @@
}
const mapDispatchToProps = (dispatch) => {
  return {
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)),
  }
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(Sidemenu)