| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { DndProvider } from 'react-dnd' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Button } from 'antd' |
| | |
| | | |
| | | class EditMenu extends Component { |
| | | static propTpyes = { |
| | | menuTree: PropTypes.array, // 菜单树 |
| | | menulist: PropTypes.any, // 三级菜单列表 |
| | | exitEdit: PropTypes.func, // 退出编辑状态 |
| | | supMenu: PropTypes.object, // 对应的上级菜单 |
| | |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: menu.card.MenuID |
| | | } |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | | } else { |
| | |
| | | handleMVisible: true, |
| | | sysMenu: _menu |
| | | }) |
| | | } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(_menu.PageParam.Template)) { |
| | | } else if (['CommonTable', 'TreePage'].includes(_menu.PageParam.Template)) { |
| | | sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(_menu))) |
| | | |
| | |
| | | } else if (_menu.PageParam.Template === 'BaseTable') { |
| | | sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(_menu))) |
| | | |
| | | |
| | | window.open(`#/tabledesign/${_param}`) |
| | | } else if (_menu.PageParam.Template === 'CustomPage') { |
| | | let _param = { |
| | |
| | | title: '确认调整菜单顺序吗?', |
| | | content: '', |
| | | onOk() { |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | that.setState({ change: false }) |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | |
| | | confirmLoading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | confirmLoading: false, |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menuTree: state.menuTree |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(EditMenu) |
| | | export default EditMenu |