From eb0c4703ec7cd21dc921ae113b7e3be69c641c1d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 17 九月 2021 15:18:06 +0800 Subject: [PATCH] 2021-09-17 --- src/components/tabview/index.jsx | 28 +++++----------------------- 1 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index 9cb3e0d..a853921 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -6,7 +6,7 @@ import moment from 'moment' import 'moment/locale/zh-cn' -import { toggleIsiframe, initActionPermission } from '@/store/action' +import { initActionPermission } from '@/store/action' import asyncComponent from '@/utils/asyncLoadComponent' import NotFount from '@/components/404' import options from '@/store/options.js' @@ -64,7 +64,9 @@ if (index > -1) { let activeId = '' - if (index > 0) { + if (id !== this.state.activeId) { + activeId = this.state.activeId + } else if (index > 0) { activeId = tabs[index - 1].MenuID || '' } else if (tabs[index]) { activeId = tabs[index].MenuID || '' @@ -74,10 +76,6 @@ activeId, tabviews: tabs }) - - if (this.props.isiframe) { - this.props.toggleIsiframe(false) - } let node = document.getElementById('root').parentNode.parentNode if (node) { @@ -174,16 +172,6 @@ changeTab = (e, menu) => { e.stopPropagation() // 绐楀彛鍒囨崲 - let _isiframe = this.props.isiframe - if (menu.type === 'iframe') { - _isiframe = true - } else { - _isiframe = false - } - - if (_isiframe !== this.props.isiframe) { - this.props.toggleIsiframe(_isiframe) - } this.setState({ activeId: menu.MenuID || '' @@ -252,10 +240,6 @@ MKEmitter.addListener('closeTabView', this.closeTabView) } - UNSAFE_componentWillReceiveProps (nextProps) { - - } - /** * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 */ @@ -314,14 +298,12 @@ const mapStateToProps = (state) => { return { collapse: state.collapse, - isiframe: state.isiframe } } const mapDispatchToProps = (dispatch) => { return { - initActionPermission: (permAction) => dispatch(initActionPermission(permAction)), - toggleIsiframe: (isiframe) => dispatch(toggleIsiframe(isiframe)) + initActionPermission: (permAction) => dispatch(initActionPermission(permAction)) } } -- Gitblit v1.8.0