| | |
| | | import React, {Component} from 'react' |
| | | import { connect } from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Menu, notification, Popover } from 'antd' |
| | | import { EditOutlined, CloseOutlined, SwapOutlined, PlusOutlined, UnlockOutlined, SettingOutlined } from '@ant-design/icons' |
| | | import { Menu, notification, Popover, Modal, Spin } from 'antd' |
| | | import { EditOutlined, SwapOutlined, PlusOutlined, UnlockOutlined, SettingOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { resetEditLevel, modifyMenuTree, modifyMainMenu } from '@/store/action' |
| | |
| | | import MkIcon from '@/components/mk-icon' |
| | | import './index.scss' |
| | | |
| | | const EditSecMenu = asyncComponent(() => import('@/templates/menuconfig/editsecmenu')) |
| | | const EditThdMenu = asyncComponent(() => import('@/templates/menuconfig/editthdmenu')) |
| | | const EditSecMenu = asyncComponent(() => import('./editsecmenu')) |
| | | const EditThdMenu = asyncComponent(() => import('./editthdmenu')) |
| | | const TransferForm = asyncComponent(() => import('@/templates/zshare/basetransferform')) |
| | | const { SubMenu } = Menu |
| | | |
| | | class Sidemenu extends Component { |
| | |
| | | |
| | | render () { |
| | | const { mainMenu, editLevel } = this.props |
| | | const { visible } = this.state |
| | | |
| | | let isnew = false |
| | | let isnew = true |
| | | |
| | | return ( |
| | | <aside className="mk-sys-side-menu ant-menu-dark mk-edit"> |
| | |
| | | {item.children.map(cell => { |
| | | return ( |
| | | <Menu.Item key={cell.MenuID}> |
| | | {editLevel !== 'HS' && isnew ? |
| | | <Popover overlayClassName="mk-popover-control-wrap mk-menu-control" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" onClick={() => this.editmenu(cell)} /> |
| | | <CloseOutlined className="close" onClick={() => {}} /> |
| | | </div> |
| | | } trigger="hover" placement="top"> |
| | | <span className="editable-menu-item">{cell.MenuName}</span> |
| | | </Popover> : |
| | | {editLevel !== 'HS' ? |
| | | <span className="editable-menu-item" onDoubleClick={() => this.editmenu(cell)}>{cell.MenuName}</span> : |
| | | <a href={cell.src} id={cell.MenuID} onClick={(e) => this.changemenu(e, cell)}>{cell.MenuName}</a> |
| | | } |
| | | </Menu.Item> |
| | |
| | | exitEdit={this.exitEdit} |
| | | /> : null |
| | | } |
| | | <Modal |
| | | title="解冻菜单" |
| | | width={600} |
| | | visible={visible} |
| | | onOk={this.thawMemuSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={this.thawMemuCancel} |
| | | destroyOnClose |
| | | > |
| | | {!this.state.thawmenulist ? <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" /> : |
| | | <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/>} |
| | | </Modal> |
| | | </aside> |
| | | ) |
| | | } |
| | |
| | | return { |
| | | mainMenu: state.mainMenu, |
| | | menuTree: state.menuTree, |
| | | memberLevel: state.memberLevel, |
| | | editLevel: state.editLevel |
| | | } |
| | | } |