From e83e0dd1b6fffd09c48561f3b69fa5a50df4a942 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 04 二月 2021 19:01:01 +0800
Subject: [PATCH] 2021-02-04

---
 src/views/design/header/index.jsx |   44 +++++++++++++++++++++-----------------------
 1 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx
index ddc65dd..99584b2 100644
--- a/src/views/design/header/index.jsx
+++ b/src/views/design/header/index.jsx
@@ -299,29 +299,18 @@
   }
 
   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>
         {/* 姝e父鑿滃崟 */}
-        {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' : ''}>
@@ -329,29 +318,38 @@
                 </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>

--
Gitblit v1.8.0