From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 18 十一月 2021 20:47:04 +0800 Subject: [PATCH] 2021-11-18 --- src/tabviews/custom/components/form/normal-form/index.jsx | 27 +++++++-------------------- 1 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/tabviews/custom/components/form/normal-form/index.jsx b/src/tabviews/custom/components/form/normal-form/index.jsx index 54a0d90..3d7cd2b 100644 --- a/src/tabviews/custom/components/form/normal-form/index.jsx +++ b/src/tabviews/custom/components/form/normal-form/index.jsx @@ -12,7 +12,6 @@ import MKEmitter from '@/utils/events.js' import zhCN from '@/locales/zh-CN/main.js' import enUS from '@/locales/en-US/main.js' -import { modifyTabview } from '@/store/action' import './index.scss' const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform')) @@ -218,7 +217,7 @@ resetParentParam = (MenuID, id) => { const { config } = this.state if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return - if (id !== this.state.BID) { + if (id !== this.state.BID || id !== '') { this.setState({ BID: id }, () => { this.loadData() }) @@ -246,23 +245,14 @@ let newtab = { ...menu, - selected: true, param: {$BID: id || ''} } - 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()) + if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { + MKEmitter.emit('modifyTabs', newtab, 'replace') + } else { + MKEmitter.emit('modifyTabs', newtab, 'plus', true) } - - this.setState({}, () => { - tabs.push(newtab) - this.props.modifyTabview(tabs) - }) } } @@ -404,14 +394,11 @@ const mapStateToProps = (state) => { return { permMenus: state.permMenus, - tabviews: state.tabviews, } } -const mapDispatchToProps = (dispatch) => { - return { - modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) - } +const mapDispatchToProps = () => { + return {} } export default connect(mapStateToProps, mapDispatchToProps)(NormalForm) \ No newline at end of file -- Gitblit v1.8.0