| | |
| | | import { |
| | | toggleCollapse, |
| | | modifyMainMenu, |
| | | initActionPermission, |
| | | initMenuPermission, |
| | | logout |
| | | } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncSpinComponent' |
| | |
| | | } |
| | | |
| | | this.props.modifyMainMenu(mainMenu) |
| | | this.props.initMenuPermission([...thdMenuList, {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'}]) |
| | | |
| | | window.GLOB.mkThdMenus = [...thdMenuList, {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'}] |
| | | |
| | | if (_menu) { // 延时打开,防止标签组未完成加载 |
| | | setTimeout(() => { |
| | |
| | | } |
| | | }, 200) |
| | | } |
| | | MKEmitter.emit('mkMenuLoaded') |
| | | }) |
| | | |
| | | // 获取角色权限, edition_type 接口版本控制 ''、'Y'、'A' |
| | |
| | | }).then(result => { |
| | | let _permAction = {loaded: true} // 按钮权限 |
| | | |
| | | if (result && result.status) { |
| | | if (result.status) { |
| | | if (result.UserRoles_Menu) { |
| | | result.UserRoles_Menu.forEach(menu => { |
| | | if (!menu.MenuID) return |
| | | _permAction[menu.MenuID] = true |
| | | }) |
| | | } |
| | | } else if (result) { |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | | message: result.message, |
| | |
| | | }) |
| | | } |
| | | |
| | | this.props.initActionPermission(_permAction) |
| | | MKEmitter.emit('mkActionLoaded') |
| | | window.GLOB.mkActions = _permAction |
| | | }) |
| | | }, 50) |
| | | } |
| | |
| | | return ( |
| | | <header className="header-container ant-menu-dark" id="main-header-container"> |
| | | <div className={'header-logo ' + (collapse && navBar !== 'topmenu' ? 'collapse' : '')} onClick={this.changeToHome}><img src={this.state.logourl} alt=""/></div> |
| | | <div className={'header-collapse ' + (collapse && navBar !== 'topmenu' ? 'collapse' : '')}> |
| | | {navBar !== 'topmenu' ? (collapse ? <MenuUnfoldOutlined onClick={this.handleCollapse}/> : <MenuFoldOutlined onClick={this.handleCollapse}/>) : null} |
| | | </div> |
| | | {navBar !== 'topmenu' ? <div className={'header-collapse ' + (collapse ? 'collapse' : '')}> |
| | | {collapse ? <MenuUnfoldOutlined onClick={this.handleCollapse}/> : <MenuFoldOutlined onClick={this.handleCollapse}/>} |
| | | </div> : <div style={{width: '20px', height: '45px'}}></div>} |
| | | {/* 正常菜单 */} |
| | | {navBar !== 'topmenu' && menulist ? |
| | | <ul className="header-menu">{ |
| | |
| | | })} |
| | | </ul> : null |
| | | } |
| | | {/* 头像、用户名 */} |
| | | <Dropdown className="header-setting" overlay={menu}> |
| | | <div> |
| | | <img src={this.state.avatar || avatar} alt=""/> |
| | | <span> |
| | | <span className="username"><span>{this.state.fullName}</span>{this.state.userName ? <span>{this.state.userName}</span> : null}</span> <DownOutlined /> |
| | | </span> |
| | | </div> |
| | | </Dropdown> |
| | | {!menulist ? |
| | | <div className="header-menu"></div> : null |
| | | } |
| | | {/* 菜单搜索 */} |
| | | {thdMenuList.length > 0 ? |
| | | <Dropdown overlayClassName="menu-select-dropdown" getPopupContainer={() => document.getElementById('main-header-container')} overlay={ |
| | |
| | | <SearchOutlined className="search-menu" /> |
| | | </Dropdown> : null |
| | | } |
| | | {/* 头像、用户名 */} |
| | | <Dropdown className="header-setting" overlay={menu}> |
| | | <div> |
| | | <img src={this.state.avatar || avatar} alt=""/> |
| | | <span> |
| | | <span className="username"><span>{this.state.fullName}</span>{this.state.userName ? <span>{this.state.userName}</span> : null}</span> <DownOutlined /> |
| | | </span> |
| | | </div> |
| | | </Dropdown> |
| | | {/* 修改密码 */} |
| | | <Modal |
| | | title={this.state.dict['main.password']} |
| | |
| | | return { |
| | | toggleCollapse: (collapse) => dispatch(toggleCollapse(collapse)), |
| | | modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)), |
| | | initActionPermission: (permAction) => dispatch(initActionPermission(permAction)), |
| | | initMenuPermission: (permMenus) => dispatch(initMenuPermission(permMenus)), |
| | | logout: () => dispatch(logout()) |
| | | } |
| | | } |