| | |
| | | } |
| | | } |
| | | |
| | | modifyTabs = (tab, type, fixed) => { |
| | | modifyTabs = (tab, fixed) => { |
| | | const { tabviews, activeId } = this.state |
| | | |
| | | if (type === 'plus' && fixed) { |
| | | if (fixed) { |
| | | let _tabs = tabviews.filter(item => item.MenuID !== tab.MenuID) |
| | | let index = _tabs.findIndex(item => item.MenuID === activeId) |
| | | |
| | |
| | | activeId: tab.MenuID |
| | | }) |
| | | }) |
| | | } else if (type === 'plus') { |
| | | } else { |
| | | if (tabviews.findIndex(item => item.MenuID === tab.MenuID) > -1) { |
| | | let _tabs = tabviews.filter(item => item.MenuID !== tab.MenuID) |
| | | this.setState({ |
| | |
| | | activeId: tab.MenuID |
| | | }) |
| | | } |
| | | } else if (type === 'replace') { |
| | | this.setState({ |
| | | tabviews: tab ? [tab] : [], |
| | | activeId: tab ? tab.MenuID : '' |
| | | }) |
| | | } |
| | | |
| | | let node = document.getElementById('root').parentNode.parentNode |