king
2021-09-17 c95918fb0fffb61b1117fbf4cd429e291b9594d0
src/tabviews/custom/components/carousel/cardItem/index.jsx
@@ -1,10 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { is, fromJS } from 'immutable'
import asyncComponent from '@/utils/asyncComponent'
import { modifyTabview } from '@/store/action'
import MKEmitter from '@/utils/events.js'
import './index.scss'
@@ -64,21 +62,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
@@ -114,16 +100,4 @@
  }
}
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
  }
}
const mapDispatchToProps = (dispatch) => {
  return {
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(CardBoxComponent)
export default CardBoxComponent