| | |
| | | toggleCollapse, |
| | | modifyMenuTree, |
| | | modifyMainMenu, |
| | | modifyTabview, |
| | | initActionPermission, |
| | | initMenuPermission, |
| | | logout |
| | |
| | | |
| | | Promise.all([roledefer, menudefer]).then(response => { |
| | | if (response[1]) { |
| | | let tabs = fromJS(this.props.tabviews).toJS() |
| | | let menu = fromJS(response[1]).toJS() |
| | | |
| | | if (this.state.navBar === 'topmenu' && this.state.menuType !== 'menu_board_navigation') { |
| | | menu.selected = true |
| | | this.props.modifyTabview([menu]) |
| | | MKEmitter.emit('modifyTabs', menu, 'replace') |
| | | } else { |
| | | tabs = tabs.map(tab => { |
| | | tab.selected = false |
| | | return tab |
| | | }) |
| | | |
| | | menu.selected = true |
| | | tabs.push(menu) |
| | | this.props.modifyTabview(tabs) |
| | | MKEmitter.emit('modifyTabs', menu, 'plus') |
| | | } |
| | | } |
| | | }) |
| | |
| | | sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM')) |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | this.props.modifyMenuTree([]) |
| | | this.props.modifyMainMenu(null) |
| | | this.props.modifyTabview([]) |
| | | |
| | | this.props.history.replace('/design') |
| | | } |
| | | } |
| | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | this.setSystemFuncs() |
| | | |
| | | this.props.modifyMenuTree([]) |
| | | this.props.modifyMainMenu(null) |
| | | this.props.modifyTabview([]) |
| | | |
| | | this.props.history.replace('/design') |
| | | } else { |
| | |
| | | if (menu.OpenType === 'newpage' || menu.OpenType === 'NewPage') { // NewPage为打开外部页面地址,newpage为打开系统菜单 |
| | | window.open(menu.src) |
| | | } else if (menu.OpenType === 'blank') { |
| | | menu.selected = true |
| | | this.props.modifyTabview([menu]) |
| | | MKEmitter.emit('modifyTabs', menu, 'replace') |
| | | } else if (this.state.navBar === 'topmenu' && this.state.menuType !== 'menu_board_navigation') { |
| | | menu.selected = true |
| | | this.props.modifyTabview([menu]) |
| | | MKEmitter.emit('modifyTabs', menu, 'replace') |
| | | } else { |
| | | let tabs = fromJS(this.props.tabviews).toJS() |
| | | tabs = tabs.filter(tab => { |
| | | tab.selected = false |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | menu.selected = true |
| | | tabs.push(menu) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | MKEmitter.emit('modifyTabs', menu, 'plus') |
| | | } |
| | | |
| | | if (window.GLOB.systemType === 'production') { |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | collapse: state.collapse, |
| | | menuTree: state.menuTree, |
| | | mainMenu: state.mainMenu, |
| | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | toggleCollapse: (collapse) => dispatch(toggleCollapse(collapse)), |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)), |
| | | modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)), |
| | | initActionPermission: (permAction) => dispatch(initActionPermission(permAction)), |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Menu, Icon } from 'antd' |
| | | |
| | | import { modifyTabview } from '@/store/action' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | |
| | | if (menu.OpenType === 'newpage' || menu.OpenType === 'NewPage') { |
| | | window.open(menu.src) |
| | | } else if (menu.OpenType === 'blank') { |
| | | menu.selected = true |
| | | this.props.modifyTabview([menu]) |
| | | MKEmitter.emit('modifyTabs', menu, 'replace') |
| | | } else { |
| | | let tabs = fromJS(this.props.tabviews).toJS() |
| | | tabs = tabs.filter(tab => { |
| | | tab.selected = false |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | menu.selected = true |
| | | tabs.push(menu) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | MKEmitter.emit('modifyTabs', menu, 'plus') |
| | | } |
| | | |
| | | if (window.GLOB.systemType === 'production') { |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | collapse: state.collapse, |
| | | isiframe: state.isiframe, |
| | | mainMenu: state.mainMenu, |
| | |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | } |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(Sidemenu) |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { fromJS } from 'immutable' |
| | | import {Tabs, Icon, BackTop, notification} from 'antd' |
| | | import moment from 'moment' |
| | | import 'moment/locale/zh-cn' |
| | | |
| | | import { modifyTabview, toggleIsiframe, initActionPermission } from '@/store/action' |
| | | import { toggleIsiframe, initActionPermission } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | import NotFount from '@/components/404' |
| | | import options from '@/store/options.js' |
| | |
| | | |
| | | class TabViews extends Component { |
| | | static propTpyes = { |
| | | collapse: PropTypes.bool, |
| | | tabviews: PropTypes.array // 标签页数组 |
| | | collapse: PropTypes.bool |
| | | } |
| | | |
| | | state = { |
| | | activeId: '', |
| | | // tabviews: [{ |
| | | // MenuID: 'home_page_id', |
| | | // MenuName: '首页', |
| | | // selected: true, |
| | | // type: 'Home' |
| | | // }], // 标签集 |
| | | tabviews: null, // 标签集 |
| | | iFrameHeight: 0, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS, |
| | | } |
| | | |
| | | // 关闭tab页,重新选择显示页 |
| | | handleTabview = (e, menu, index) => { |
| | | e.stopPropagation() |
| | | let tabs = fromJS(this.state.tabviews).toJS() |
| | | tabs = tabs.filter(tab => { |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (menu.selected && tabs[index - 1]) { |
| | | tabs[index - 1].selected = true |
| | | this.setState({ |
| | | activeId: tabs[index - 1].MenuID || '' |
| | | }) |
| | | |
| | | if (this.props.isiframe) { |
| | | this.props.toggleIsiframe(false) |
| | | } |
| | | } |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | } |
| | | |
| | | // 关闭tab页,重新选择显示页 |
| | | closeTabView = (id) => { |
| | | let tabs = fromJS(this.state.tabviews).toJS() |
| | | let index = 0 |
| | | let index = -1 |
| | | |
| | | tabs = tabs.filter((tab, i) => { |
| | | if (tab.MenuID === id) { |
| | | index = i |
| | |
| | | } |
| | | }) |
| | | |
| | | if (tabs[index - 1]) { |
| | | tabs[index - 1].selected = true |
| | | if (index > -1) { |
| | | let activeId = '' |
| | | if (index > 0) { |
| | | activeId = tabs[index - 1].MenuID || '' |
| | | } else if (tabs[index]) { |
| | | activeId = tabs[index].MenuID || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | activeId: tabs[index - 1].MenuID || '' |
| | | activeId, |
| | | tabviews: tabs |
| | | }) |
| | | |
| | | if (this.props.isiframe) { |
| | | this.props.toggleIsiframe(false) |
| | | } |
| | | } |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | let node = document.getElementById('root').parentNode.parentNode |
| | | if (node) { |
| | | node.scrollTop = 0 |
| | | } |
| | | } |
| | | } |
| | | |
| | | refreshTabview = (e, menu) => { |
| | |
| | | } |
| | | } |
| | | |
| | | // modifyTabs = (tab, type) => { |
| | | modifyTabs = (tab, type) => { |
| | | const { tabviews } = this.state |
| | | |
| | | // } |
| | | if (type === 'plus') { |
| | | if (tabviews.findIndex(item => item.MenuID === tab.MenuID) > -1) { |
| | | let _tabs = tabviews.filter(item => item.MenuID !== tab.MenuID) |
| | | this.setState({ |
| | | tabviews: _tabs |
| | | }, () => { |
| | | this.setState({ |
| | | tabviews: [..._tabs, tab], |
| | | activeId: tab.MenuID |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | tabviews: [...tabviews, tab], |
| | | activeId: tab.MenuID |
| | | }) |
| | | } |
| | | } else if (type === 'replace') { |
| | | this.setState({ |
| | | tabviews: tab ? [tab] : [], |
| | | activeId: tab ? tab.MenuID : '' |
| | | }) |
| | | } |
| | | |
| | | let node = document.getElementById('root').parentNode.parentNode |
| | | if (node) { |
| | | node.scrollTop = 0 |
| | | } |
| | | } |
| | | |
| | | changeTab = (e, menu) => { |
| | | e.stopPropagation() |
| | | // 窗口切换 |
| | | let tabs = fromJS(this.state.tabviews).toJS() |
| | | tabs = tabs.map(tab => { |
| | | tab.selected = false |
| | | let _isiframe = this.props.isiframe |
| | | if (menu.type === 'iframe') { |
| | | _isiframe = true |
| | | } else { |
| | | _isiframe = false |
| | | } |
| | | |
| | | if (tab.MenuID === menu.MenuID) { |
| | | tab.selected = true |
| | | } |
| | | |
| | | return tab |
| | | }) |
| | | |
| | | if (menu) { |
| | | let _isiframe = this.props.isiframe |
| | | if (menu.type === 'iframe') { |
| | | _isiframe = true |
| | | } else { |
| | | _isiframe = false |
| | | } |
| | | |
| | | if (_isiframe !== this.props.isiframe) { |
| | | this.props.toggleIsiframe(_isiframe) |
| | | } |
| | | if (_isiframe !== this.props.isiframe) { |
| | | this.props.toggleIsiframe(_isiframe) |
| | | } |
| | | |
| | | this.setState({ |
| | | tabviews: tabs, |
| | | activeId: menu.MenuID || '' |
| | | }, () => { |
| | | if (menu.MenuID) { |
| | | MKEmitter.emit('resetActiveMenu', menu.MenuID) |
| | | } |
| | | MKEmitter.emit('resetActiveMenu', menu.MenuID || '') |
| | | }) |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | } |
| | | |
| | | selectcomponent = (view) => { |
| | |
| | | } else { |
| | | moment.locale('en') |
| | | } |
| | | this.setState({ |
| | | tabviews: this.props.tabviews |
| | | }) |
| | | |
| | | if (sessionStorage.getItem('isEditState') !== 'true') { |
| | | this.setState({ |
| | | activeId: 'home_page_id', |
| | | tabviews: [{ |
| | | MenuID: 'home_page_id', |
| | | MenuName: '首页', |
| | | type: 'Home' |
| | | }] |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | activeId: '', |
| | | tabviews: [] |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | if (sessionStorage.getItem('isEditState') !== 'true') { |
| | | let home = { |
| | | MenuID: 'home_page_id', |
| | | MenuName: '首页', |
| | | selected: true, |
| | | type: 'Home' |
| | | } |
| | | this.props.modifyTabview([home]) |
| | | } |
| | | // MKEmitter.addListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.addListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.addListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | if (nextProps.tabviews && !is(fromJS(this.state.tabviews), fromJS(nextProps.tabviews))) { |
| | | let view = nextProps.tabviews.filter(tab => tab.selected)[0] |
| | | |
| | | // 窗口在iframe与普通页面切换时,修改左侧菜单栏样式 |
| | | let activeId = '' |
| | | if (view) { |
| | | let _isiframe = this.props.isiframe |
| | | if (view.type === 'iframe') { |
| | | _isiframe = true |
| | | } else { |
| | | _isiframe = false |
| | | } |
| | | |
| | | if (_isiframe !== this.props.isiframe) { |
| | | this.props.toggleIsiframe(_isiframe) |
| | | } |
| | | |
| | | activeId = view.MenuID |
| | | } |
| | | |
| | | // 保存修改标签集 |
| | | this.setState({ |
| | | tabviews: nextProps.tabviews, |
| | | activeId |
| | | }) |
| | | |
| | | let node = document.getElementById('root').parentNode.parentNode |
| | | if (node) { |
| | | node.scrollTop = 0 |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | // MKEmitter.removeListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.removeListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.removeListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | |
| | | {view.MenuName} |
| | | </span> |
| | | {view.type !== 'Home' ? |
| | | <Icon type="close" onClick={(e) => {this.handleTabview(e, view, index)}}/> : null |
| | | <Icon type="close" onClick={(e) => {e.stopPropagation();this.closeTabView(view.MenuID)}}/> : null |
| | | } |
| | | </span> |
| | | } |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | collapse: state.collapse, |
| | | isiframe: state.isiframe |
| | | } |
| | |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | initActionPermission: (permAction) => dispatch(initActionPermission(permAction)), |
| | | toggleIsiframe: (isiframe) => dispatch(toggleIsiframe(isiframe)) |
| | | } |
| | |
| | | // 展开合并菜单栏 |
| | | export const Toggle_COLLAPSE = 'Toggle_COLLAPSE' |
| | | |
| | | // 修改导航栏菜单 |
| | | export const MODIFY_TABVIEW = 'MODIFY_TABVIEW' |
| | | |
| | | // 修改窗口样式,区分iframe与正常页面 |
| | | export const TOGGLE_ISIFRAME = 'TOGGLE_ISIFRAME' |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // 修改导航栏菜单 |
| | | export const modifyTabview = (tabviews) => { |
| | | return { |
| | | type: user.MODIFY_TABVIEW, |
| | | tabviews |
| | | } |
| | | } |
| | | |
| | | // 修改窗口样式,区分iframe与正常页面 |
| | | export const toggleIsiframe = (isiframe) => { |
| | | return { |
| | |
| | | let defaultState = { |
| | | menuTree: null, // 菜单结构树 |
| | | mainMenu: _mainMenu, // 已选主菜单 |
| | | tabviews: [], // 导航栏 |
| | | collapse: _collapse, // 是否收起侧边栏导航 |
| | | isiframe: false, // 是否为iframe窗口 |
| | | editLevel: null, // 编辑菜单级别,值为level1、level2、level3、HS |
| | |
| | | return { |
| | | ...state, |
| | | mainMenu: action.mainMenu |
| | | } |
| | | case Type.MODIFY_TABVIEW: |
| | | // tab页改变 |
| | | return { |
| | | ...state, |
| | | tabviews: action.tabviews |
| | | } |
| | | case Type.TOGGLE_ISIFRAME: |
| | | // 切换是否为iframe状态 |
| | |
| | | return { |
| | | menuTree: null, |
| | | mainMenu: null, |
| | | tabviews: [], |
| | | collapse: localStorage.getItem('collapse') === 'true', |
| | | isiframe: false, |
| | | editLevel: null, |
| | |
| | | import { notification } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyTabview } from '@/store/action' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permMenus: state.permMenus, |
| | | tabviews: state.tabviews, |
| | | permMenus: state.permMenus |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(CardBoxComponent) |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | 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)(TableCard) |
| | |
| | | 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' |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | 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 |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { Spin, Empty, notification, Carousel } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyTabview } from '@/store/action' |
| | | import './index.scss' |
| | | |
| | | const CardItem = asyncComponent(() => import('../cardItem')) |
| | |
| | | } |
| | | } |
| | | |
| | | openView = (item) => { |
| | | const { card } = this.state |
| | | |
| | | if (card.setting.click === 'menu') { |
| | | let menu = null |
| | | |
| | | if (card.setting.menu && card.setting.menu.length > 0) { |
| | | let menu_id = card.setting.menu.slice(-1)[0] |
| | | menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } |
| | | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | selected: true, |
| | | param: {} |
| | | } |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | newtab.param.$BID = item.$$uuid |
| | | } |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | this.props.modifyTabview([newtab]) |
| | | } 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) |
| | | }) |
| | | } |
| | | } else if (card.setting.click === 'link') { |
| | | let src = card.setting.linkurl |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | src = src + `${con}id=${item.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(src) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, data, card } = this.state |
| | | |
| | |
| | | autoplaySpeed={config.wrap.speed} |
| | | > |
| | | {data.map((item, index) => ( |
| | | <div key={index} onClick={() => {this.openView(item)}}> |
| | | <div key={index}> |
| | | <CardItem card={card} cards={config} data={item}/> |
| | | </div> |
| | | ))} |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permMenus: state.permMenus, |
| | | tabviews: state.tabviews, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(DataCard) |
| | | export default DataCard |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { Spin, notification, Carousel } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Api from '@/api' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import './index.scss' |
| | | |
| | | const CardItem = asyncComponent(() => import('../cardItem')) |
| | |
| | | } |
| | | } |
| | | |
| | | openView = (item) => { |
| | | if (item.setting.click === 'menu') { |
| | | let menu = null |
| | | |
| | | if (item.setting.menu && item.setting.menu.length > 0) { |
| | | let menu_id = item.setting.menu.slice(-1)[0] |
| | | menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' |
| | | } |
| | | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | selected: true, |
| | | param: {} |
| | | } |
| | | |
| | | if (item.setting.joint === 'true') { |
| | | newtab.param.$BID = item.setting.primaryId |
| | | } |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | this.props.modifyTabview([newtab]) |
| | | } 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) |
| | | }) |
| | | } |
| | | } else if (item.setting.click === 'link') { |
| | | let src = item.setting.linkurl |
| | | |
| | | if (item.setting.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | src = src + `${con}id=${item.setting.primaryId}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } |
| | | |
| | | window.open(src) |
| | | } |
| | | } |
| | | |
| | | |
| | | render() { |
| | | const { config, loading, data } = this.state |
| | | |
| | |
| | | autoplaySpeed={config.wrap.speed} |
| | | > |
| | | {config.subcards.map((item, index) => ( |
| | | <div key={index} onClick={() => {this.openView(item)}}> |
| | | <div key={index}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </div> |
| | | ))} |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permMenus: state.permMenus, |
| | | tabviews: state.tabviews, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(PropCard) |
| | | export default PropCard |
| | |
| | | |
| | | 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 = { |
| | |
| | | $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('菜单打开失败!') |
| | | } |
| | |
| | | |
| | | 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) |
| | |
| | | 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')) |
| | |
| | | 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') |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | tabs.push(newtab) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | 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) |
| | |
| | | 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')) |
| | |
| | | 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') |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | tabs.push(newtab) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | 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)(TabForm) |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Typography, Icon, Col, Switch, message } from 'antd' |
| | | |
| | | import { modifyTabview } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | |
| | | |
| | | // 字段透视 |
| | | triggerLink = (e, item, record) => { |
| | | const { tabviews } = this.props |
| | | e.stopPropagation() |
| | | |
| | | let __param = { |
| | |
| | | let tabmenu = item.linkThdMenu |
| | | |
| | | tabmenu.param = __param |
| | | tabmenu.selected = true |
| | | |
| | | let tabs = tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | return tab.MenuID !== tabmenu.MenuID |
| | | }) |
| | | |
| | | if (tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | MKEmitter.emit('modifyTabs', tabmenu, 'replace') |
| | | } else { |
| | | MKEmitter.emit('modifyTabs', tabmenu, 'plus') |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | tabs.push(tabmenu) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } else if (item.linkurl) { |
| | | let src = item.linkurl |
| | | |
| | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menuType: state.editLevel, |
| | | tabviews: state.tabviews, |
| | | memberLevel: state.memberLevel |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(NormalTable) |
| | |
| | | import FormGroup from './formgroup' |
| | | import FormAction from './actionList' |
| | | import NotFount from '@/components/404' |
| | | import { modifyTabview } from '@/store/action' |
| | | import './index.scss' |
| | | |
| | | const { TabPane } = Tabs |
| | |
| | | MKEmitter.emit('reloadData', this.props.param.parentId, 'formtab', btn) |
| | | } |
| | | |
| | | let tabs = this.props.tabviews.filter(tab => { |
| | | tab.selected = false |
| | | if (tab.MenuID === this.props.param.parentId) { |
| | | tab.selected = true |
| | | } |
| | | |
| | | return tab.MenuID !== this.props.MenuID |
| | | }) |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | MKEmitter.emit('closeTabView', this.props.MenuID) |
| | | } else if (type === 'error' && btn.afterExecError === 'notclose') { |
| | | if (btn.execError === 'refresh') { |
| | | this.loadmaindata() |
| | |
| | | if (btn.execError !== 'never') { |
| | | MKEmitter.emit('reloadData', this.props.param.parentId, 'formtab', btn) |
| | | } |
| | | |
| | | let tabs = this.props.tabviews.filter(tab => { |
| | | tab.selected = false |
| | | if (tab.MenuID === this.props.param.parentId) { |
| | | tab.selected = true |
| | | } |
| | | |
| | | return tab.MenuID !== this.props.MenuID |
| | | }) |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | MKEmitter.emit('closeTabView', this.props.MenuID) |
| | | } |
| | | } |
| | | |
| | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menuType: state.editLevel, |
| | | tabviews: state.tabviews, |
| | | permAction: state.permAction |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(NormalTable) |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, notification, Icon } from 'antd' |
| | | |
| | | import { modifyTabview } from '@/store/action' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { setting, btn, tabviews, MenuID, selectedData } = this.props |
| | | const { setting, btn, selectedData } = this.props |
| | | |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | |
| | |
| | | primaryId: primaryId |
| | | } |
| | | } |
| | | // } else if (btn.tabTemplate === 'ThdMenu') { |
| | | } else { |
| | | let menu = null |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | let index = 0 |
| | | let tabs = tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | |
| | | if (tab.MenuID === MenuID) { |
| | | index = i |
| | | } |
| | | |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | this.props.modifyTabview([newtab]) |
| | | MKEmitter.emit('modifyTabs', newtab, 'replace') |
| | | } else { |
| | | if (tabviews.length !== tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | if (MenuID) { |
| | | tabs.splice(index + 1, 0, newtab) |
| | | } else { |
| | | tabs.push(newtab) |
| | | } |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | MKEmitter.emit('modifyTabs', newtab, 'plus') |
| | | } |
| | | |
| | | MKEmitter.emit('openNewTab') |
| | |
| | | |
| | | 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)(TabButton) |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Affix, Typography, Icon } from 'antd' |
| | | |
| | | import { modifyTabview } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import '@/assets/css/table.scss' |
| | |
| | | |
| | | // 字段透视 |
| | | triggerLink = (e, item, record) => { |
| | | const { tabviews, MenuID } = this.props |
| | | |
| | | e.stopPropagation() |
| | | |
| | | let __param = { |
| | |
| | | |
| | | if (item.linkThdMenu) { |
| | | let tabmenu = item.linkThdMenu |
| | | |
| | | tabmenu.param = __param |
| | | tabmenu.selected = true |
| | | |
| | | let index = 0 |
| | | let tabs = tabviews.filter((tab, i) => { |
| | | tab.selected = false |
| | | |
| | | if (tab.MenuID === MenuID) { |
| | | index = i |
| | | } |
| | | |
| | | return tab.MenuID !== tabmenu.MenuID |
| | | }) |
| | | |
| | | if (tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | MKEmitter.emit('modifyTabs', tabmenu, 'replace') |
| | | } else { |
| | | MKEmitter.emit('modifyTabs', tabmenu, 'plus') |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | if (MenuID) { |
| | | tabs.splice(index + 1, 0, tabmenu) |
| | | } else { |
| | | tabs.push(tabmenu) |
| | | } |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | } else if (item.linkurl) { |
| | | let src = item.linkurl |
| | | |
| | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menuType: state.editLevel, |
| | | tabviews: state.tabviews, |
| | | memberLevel: state.memberLevel |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(NormalTable) |
| | |
| | | 'phone', |
| | | 'picture', |
| | | 'red-envelope', |
| | | 'setting', |
| | | 'tool', |
| | | 'smile', |
| | | 'star', |
| | | 'thunderbolt', |
| | |
| | | import { |
| | | modifyMenuTree, |
| | | modifyMainMenu, |
| | | modifyTabview, |
| | | resetEditLevel, |
| | | logout |
| | | } from '@/store/action' |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import avatar from '@/assets/img/avatar.jpg' |
| | | import MainLogo from '@/assets/img/main-logo.png' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const EditMenu = asyncComponent(() => import('@/templates/menuconfig/editfirstmenu')) |
| | |
| | | |
| | | this.props.modifyMainMenu(menulist[0] || null) |
| | | this.props.resetEditLevel(false) |
| | | this.props.modifyTabview([]) |
| | | |
| | | MKEmitter.emit('modifyTabs', null, 'replace') |
| | | } |
| | | |
| | | exitEdit = () => { |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { mainMenu, editLevel, tabviews } = this.props |
| | | const { mainMenu, editLevel } = this.props |
| | | const { menulist } = this.state |
| | | |
| | | return ( |
| | |
| | | </Button> |
| | | </div> : null |
| | | } |
| | | {editLevel === 'HS' && tabviews.length === 0 && options.sysType === 'local' && window.GLOB.systemType === 'production' && this.props.memberLevel >= 20 ? |
| | | {editLevel === 'HS' && options.sysType === 'local' && window.GLOB.systemType === 'production' && this.props.memberLevel >= 20 ? |
| | | <div className="app-prod-entrance entrance"> |
| | | <div className="icon"><Icon type="appstore" /></div> |
| | | <div className="title">应用管理</div> |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | menuTree: state.menuTree, |
| | | mainMenu: state.mainMenu, |
| | | editLevel: state.editLevel, |
| | |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)), |
| | | modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)), |
| | | resetEditLevel: (level) => dispatch(resetEditLevel(level)), |
| | |
| | | flex: auto; |
| | | min-height: 100%; |
| | | } |
| | | // .mk-design-view { |
| | | // background-color: rgb(238, 241, 246); |
| | | // } |
| | | .mk-design-view { |
| | | #mk-tabview-wrap { |
| | | z-index: unset; |
| | | >.content-header { |
| | | >.ant-tabs { |
| | | z-index: 21; |
| | | background: #ffffff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import { Menu, Icon, notification } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyTabview, resetEditLevel, modifyMenuTree, modifyMainMenu } from '@/store/action' |
| | | import { resetEditLevel, modifyMenuTree, modifyMainMenu } from '@/store/action' |
| | | import { SySMenuList } from './config' |
| | | import options from '@/store/options.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const EditSecMenu = asyncComponent(() => import('@/templates/menuconfig/editsecmenu')) |
| | |
| | | return |
| | | } |
| | | |
| | | let tabs = fromJS(this.props.tabviews).toJS() |
| | | tabs = tabs.filter(tab => { |
| | | tab.selected = false |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | | this.setState({}, () => { |
| | | menu.selected = true |
| | | tabs.push(menu) |
| | | this.props.modifyTabview(tabs) |
| | | }) |
| | | MKEmitter.emit('modifyTabs', menu, 'plus') |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | mainMenu: state.mainMenu, |
| | | menuTree: state.menuTree, |
| | | memberLevel: state.memberLevel, |
| | |
| | | return { |
| | | modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)), |
| | | modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)), |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | resetEditLevel: (level) => dispatch(resetEditLevel(level)) |
| | | } |
| | | } |