| | |
| | | import React, { Component } from 'react' |
| | | import { connect } from 'react-redux' |
| | | import { DndProvider } from 'react-dnd' |
| | | import { withRouter } from 'react-router' |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | |
| | | localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | }) |
| | | this.getAppMessage() |
| | | } else if (param.type === 'view') { |
| | | this.setState({ |
| | | MenuId: param.MenuID |
| | | }, () => { |
| | | this.getMenuParam() |
| | | }) |
| | | } |
| | | this.getAppMessage() |
| | | } catch { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单信息解析错误!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (this.props.match.params.param !== nextProps.match.params.param) { |
| | | window.location.reload() |
| | | } |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: menu.MenuID, type: 'view'})))) |
| | | window.location.reload() |
| | | this.props.history.push('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: menu.MenuID, copyMenuId: menu.copyMenuId || '', type: 'view'})))) |
| | | } |
| | | |
| | | getAppMessage = () => { |
| | |
| | | } |
| | | |
| | | let homeId = '' |
| | | if (this.state.MenuId) { |
| | | let appViewList = res.data && res.data.length > 0 ? res.data : [] |
| | | |
| | | homeId = this.state.MenuId |
| | | |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | } else { |
| | | let appViewList = [] |
| | | if (res.data && res.data.length > 0) { |
| | | appViewList = res.data |
| | |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | } |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | |
| | | this.setState({MenuId: homeId}, () => { |
| | | this.getMenuParam() |
| | | } |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(MenuDesign) |
| | | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MenuDesign)) |