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/chart/antv-pie/index.jsx | 29 +++++++---------------------- 1 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 325dcd4..9d4f491 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -9,15 +9,11 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import { modifyTabview } from '@/store/action' import { chartColors } from '@/utils/option.js' -// import asyncComponent from '@/utils/asyncComponent' import UtilsDM from '@/utils/utils-datamanage.js' import MKEmitter from '@/utils/events.js' import NormalHeader from '@/tabviews/custom/components/share/normalheader' import './index.scss' - -// const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) class PieChart extends Component { static propTpyes = { @@ -970,20 +966,12 @@ $BID: primaryId } } - - let tabs = this.props.tabviews.filter(tab => { - 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) - }) } catch (e) { console.warn('鑿滃崟鎵撳紑澶辫触锛�') } @@ -1026,15 +1014,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)(PieChart) \ No newline at end of file -- Gitblit v1.8.0