| | |
| | | } |
| | | |
| | | render () { |
| | | const { mainMenu } = this.props |
| | | const { mainMenu, editLevel } = this.props |
| | | const { menulist } = this.state |
| | | |
| | | const menu = ( |
| | | <Menu className="header-dropdown"> |
| | | <Menu.Item key="switch"> |
| | | {this.state.dict['main.edit']} |
| | | <Switch size="small" style={{marginLeft: '7px'}} disabled={!!this.props.editLevel} checked={true} onChange={this.changeEditState} /> |
| | | </Menu.Item> |
| | | <Menu.Item key="doc" onClick={this.gotoDoc}>{this.state.dict['main.doc']}</Menu.Item> |
| | | <Menu.Item key="logout" onClick={this.logout}>{this.state.dict['main.logout']}</Menu.Item> |
| | | </Menu> |
| | | ) |
| | | |
| | | return ( |
| | | <header className={'sys-header-container ant-menu-dark ' + (this.props.editLevel === 'level2' || this.props.editLevel === 'level3' ? 'mask' : '')} id="main-header-container"> |
| | | <header className={'sys-header-container ant-menu-dark ' + (['level2', 'level3', 'HS'].includes(editLevel) ? 'mask' : '')} id="main-header-container"> |
| | | <div className="header-logo"><img src={MainLogo} alt=""/></div> |
| | | <div className="header-collapse"> |
| | | <Icon type="menu-fold"/> |
| | | </div> |
| | | {/* 正常菜单 */} |
| | | {this.props.editLevel !== 'level1' && menulist ? |
| | | <ul className={'header-menu ' + this.props.editLevel}>{ |
| | | {editLevel !== 'level1' && menulist ? |
| | | <ul className={'header-menu ' + editLevel}>{ |
| | | menulist.map(item => { |
| | | return ( |
| | | <li key={item.MenuID} onClick={() => {this.changeMenu(item)}} className={mainMenu && mainMenu.MenuID === item.MenuID ? 'active' : ''}> |
| | |
| | | </li> |
| | | ) |
| | | })} |
| | | {!this.props.editLevel || this.props.editLevel === 'HS' ? |
| | | <li key="HS" onClick={this.enterEditManage} className={this.props.editLevel === 'HS' ? 'active' : ''}> |
| | | {!editLevel || editLevel === 'HS' ? |
| | | <li key="HS" onClick={this.enterEditManage} className={editLevel === 'HS' ? 'active' : ''}> |
| | | <span>HS</span> |
| | | </li> : null |
| | | } |
| | | </ul> : null |
| | | } |
| | | {this.props.editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null} |
| | | {editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null} |
| | | {/* 进入编辑按钮 */} |
| | | {!this.props.editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {/* {!this.props.editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' ? |
| | | {!editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {/* {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' ? |
| | | <a href="#/mobmanage" target="_blank" className="mobile" type="edit"> 应用管理 <Icon type="arrow-right" /></a> : null |
| | | } */} |
| | | {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '首页' }))) */} |
| | | {!this.props.editLevel && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? |
| | | {!editLevel && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? |
| | | <a className="home-edit" href={`#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=`} target="_blank" rel="noopener noreferrer"> |
| | | 首页 <Icon type="arrow-right" /> |
| | | </a> : null |
| | | } |
| | | {/* 编辑菜单 */} |
| | | {this.props.editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null} |
| | | {editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null} |
| | | {/* 头像、用户名 */} |
| | | <Dropdown className="header-setting" overlay={menu}> |
| | | <Dropdown className="header-setting" overlay={ |
| | | <Menu className="header-dropdown"> |
| | | <Menu.Item key="switch"> |
| | | {this.state.dict['main.edit']} |
| | | <Switch size="small" style={{marginLeft: '7px'}} disabled={!!editLevel} checked={true} onChange={this.changeEditState} /> |
| | | </Menu.Item> |
| | | <Menu.Item key="doc" onClick={this.gotoDoc}>{this.state.dict['main.doc']}</Menu.Item> |
| | | <Menu.Item key="logout" onClick={this.logout}>{this.state.dict['main.logout']}</Menu.Item> |
| | | </Menu> |
| | | }> |
| | | <div> |
| | | <img src={this.state.avatar || avatar} alt=""/> |
| | | <span> |