From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 09 十二月 2022 15:53:32 +0800
Subject: [PATCH] 2022-12-09

---
 src/components/header/index.jsx |  470 +++++++++++++++++++++-------------------------------------
 1 files changed, 171 insertions(+), 299 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 5b2824b..4ac4fbd 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -4,17 +4,15 @@
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
 import moment from 'moment'
-import { Dropdown, Menu, Modal, Form, notification, Switch, Input } from 'antd'
+import { Dropdown, Menu, Modal, notification, Switch, Input } from 'antd'
 import { SearchOutlined, DownOutlined, MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons'
 
 import {
   toggleCollapse,
   modifyMainMenu,
-  initActionPermission,
-  initMenuPermission,
   logout
 } from '@/store/action'
-import asyncComponent from '@/utils/asyncComponent'
+import asyncComponent from '@/utils/asyncSpinComponent'
 import Api from '@/api'
 import MKEmitter from '@/utils/events.js'
 import options from '@/store/options.js'
@@ -48,9 +46,7 @@
     systems: [],
     searchkey: '',
     thdMenuList: [],
-    debug: sessionStorage.getItem('debug') === 'true',
-    navBar: ['linkage_navigation', 'linkage', 'menu_board', 'menu_board_navigation'].includes(window.GLOB.navBar) ? 'topmenu' : '',
-    menuType: window.GLOB.navBar
+    debug: sessionStorage.getItem('debug') === 'true'
   }
 
   handleCollapse = () => {
@@ -67,6 +63,8 @@
   }
 
   resetPwdSubmit = () => {
+    if (!this.formRef) return
+
     this.formRef.handleConfirm().then(res => {
       this.setState({
         confirmLoading: true
@@ -133,7 +131,7 @@
 
   changeMenu (value) {
     // 涓昏彍鍗曞垏鎹�
-    if (value.OpenType === 'outpage' && value.linkUrl) {
+    if (value.OpenType === 'outpage') {
       window.open(value.linkUrl)
     } else if (value.OpenType === 'menu') {
       this.props.modifyMainMenu(value)
@@ -141,117 +139,91 @@
   }
 
   getRolesMenu () {
-    // 鑾峰彇瑙掕壊鏉冮檺
-    let roledefer = new Promise(resolve => {
-      // edition_type 鎺ュ彛鐗堟湰鎺у埗 ''銆�'Y'銆�'A'
-      setTimeout(() => {
-        Api.getSystemConfig({
-          func: 's_Get_TrdMenu_Role',
-          edition_type: 'A',
-          pro_sys: window.GLOB.systemType === 'production' ? 'Y' : ''
-        }).then(result => {
-          let _permAction = {loaded: true} // 鎸夐挳鏉冮檺
-  
-          if (result && result.status) {
-            if (result.UserRoles_Menu) {
-              result.UserRoles_Menu.forEach(menu => {
-                if (!menu.MenuID) return
-                _permAction[menu.MenuID] = true
-              })
-            }
-          } else if (result) {
-            notification.error({
-              top: 92,
-              message: result.message,
-              duration: 10
+    // 鑾峰彇涓昏彍鍗曞弬鏁�
+    let _param = {func: 's_get_pc_menus', systemType: options.sysType}
+    _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
+    
+    Api.getSystemConfig(_param).then(result => {
+      if (!result.status) {
+        notification.error({
+          top: 92,
+          message: result.message,
+          duration: 10
+        })
+        return
+      }
+
+      const { menulist, thdMenuList } = this.getMenulist(result)
+
+      let systems = []
+      if ((options.sysType === 'local' || options.sysType === 'SSO') && result.sys_list) {
+        systems = result.sys_list
+
+        if (options.sysType === 'local' && window.GLOB.systemType !== 'production' && systems.length > 10) {
+          systems.length = 10
+        }
+      }
+
+      this.setState({
+        menulist,
+        thdMenuList,
+        systems: systems
+      })
+      
+      let mainMenu = menulist[0] || ''
+      let _menu = null
+
+      if (sessionStorage.getItem('ThirdMenu')) { // 鏄惁涓烘墦寮�鏂伴〉闈�
+        let ThirdMenuId = sessionStorage.getItem('ThirdMenu')
+        _menu = thdMenuList.filter(item => item.MenuID === ThirdMenuId)[0] // 閫氳繃url涓璵enuid绛涢�夊嚭閫変腑鐨勪富鑿滃崟
+
+        sessionStorage.removeItem('ThirdMenu')
+      }
+
+      this.props.modifyMainMenu(mainMenu)
+
+      window.GLOB.mkThdMenus = [...thdMenuList, {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'}]
+
+      if (_menu) { // 寤舵椂鎵撳紑锛岄槻姝㈡爣绛剧粍鏈畬鎴愬姞杞�
+        setTimeout(() => {
+          MKEmitter.emit('modifyTabs', _menu)
+        }, 200)
+      }
+      MKEmitter.emit('mkMenuLoaded')
+    })
+    
+    // 鑾峰彇瑙掕壊鏉冮檺, edition_type 鎺ュ彛鐗堟湰鎺у埗 ''銆�'Y'銆�'A'
+    setTimeout(() => {
+      Api.getSystemConfig({
+        func: 's_Get_TrdMenu_Role',
+        edition_type: 'A',
+        pro_sys: window.GLOB.systemType === 'production' ? 'Y' : ''
+      }).then(result => {
+        let _permAction = {loaded: true} // 鎸夐挳鏉冮檺
+
+        if (result.status) {
+          if (result.UserRoles_Menu) {
+            result.UserRoles_Menu.forEach(menu => {
+              if (!menu.MenuID) return
+              _permAction[menu.MenuID] = true
             })
           }
-  
-          this.props.initActionPermission(_permAction)
-          resolve()
-        })
-      }, 50)
-    })
-
-    // 鑾峰彇涓昏彍鍗曞弬鏁�
-    let menudefer = new Promise(resolve => {
-      let _param = {func: 's_get_pc_menus', systemType: options.sysType}
-      _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
-      
-      Api.getSystemConfig(_param).then(result => {
-        if (!result.status) {
+        } else {
           notification.error({
             top: 92,
             message: result.message,
             duration: 10
           })
-          return
         }
 
-        const { menulist, thdMenuList } = this.getMenulist(result)
-
-        let systems = []
-        if ((options.sysType === 'local' || options.sysType === 'SSO') && result.sys_list) {
-          systems = result.sys_list
-
-          if (options.sysType === 'local' && window.GLOB.systemType !== 'production' && systems.length > 10) {
-            systems.length = 10
-          }
-        }
-
-        this.setState({
-          menulist,
-          thdMenuList,
-          systems: systems
-        })
-        
-        let mainMenu = menulist[0] || ''
-        let _menu = null
-
-        if (mainMenu === '') { // 鏄惁鏄剧ず渚ц竟鏍忔帶鍒�
-          let _url = window.location.href.split('#')[0]
-          localStorage.setItem(_url + '-sideHidden', 'true')
-        } else {
-          let _url = window.location.href.split('#')[0]
-          localStorage.removeItem(_url + '-sideHidden')
-        }
-
-        if (sessionStorage.getItem('ThirdMenu')) { // 鏄惁涓烘墦寮�鏂伴〉闈�
-          let ThirdMenuId = sessionStorage.getItem('ThirdMenu')
-          _menu = thdMenuList.filter(item => item.MenuID === ThirdMenuId)[0] // 閫氳繃url涓璵enuid绛涢�夊嚭閫変腑鐨勪富鑿滃崟
-
-          if (_menu) {
-            mainMenu = menulist.filter(item => item.MenuID === _menu.FstId)[0]
-            mainMenu = fromJS(mainMenu).toJS()
-            mainMenu.openId = _menu.ParentId
-          }
-
-          sessionStorage.removeItem('ThirdMenu')
-        }
-
-        this.props.modifyMainMenu(mainMenu)
-        this.props.initMenuPermission([...thdMenuList, {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'}])
-
-        resolve(_menu)
+        MKEmitter.emit('mkActionLoaded')
+        window.GLOB.mkActions = _permAction
       })
-    })
-    
-    Promise.all([roledefer, menudefer]).then(response => {
-      if (response[1]) {
-        let menu = fromJS(response[1]).toJS()
-
-        if (this.state.navBar === 'topmenu' && this.state.menuType !== 'menu_board_navigation') {
-          MKEmitter.emit('modifyTabs', menu, 'replace')
-        } else {
-          MKEmitter.emit('modifyTabs', menu, 'plus')
-        }
-      }
-    })
+    }, 50)
   }
 
   getMenulist = (result) => {
     let thdMenuList = []
-    let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt']
     let menulist = []
     result.fst_menu && result.fst_menu.forEach(fst => {
       let fstItem = {
@@ -262,14 +234,13 @@
       }
       if (fst.PageParam) {
         try {
-          fstItem.PageParam = JSON.parse(fst.PageParam)
-        } catch (e) {
-          fstItem.PageParam = null
-        }
-        if (fstItem.PageParam && fstItem.PageParam.OpenType === 'outpage' && fstItem.PageParam.linkUrl) {
-          fstItem.OpenType = 'outpage'
-          fstItem.linkUrl = fstItem.PageParam.linkUrl
-        }
+          let PageParam = JSON.parse(fst.PageParam)
+
+          if (PageParam.OpenType === 'outpage' && PageParam.linkUrl) {
+            fstItem.OpenType = 'outpage'
+            fstItem.linkUrl = PageParam.linkUrl
+          }
+        } catch (e) {}
       }
 
       if (fst.snd_menu) {
@@ -278,31 +249,16 @@
             ParentId: fst.MenuID,
             MenuID: snd.MenuID,
             MenuName: snd.MenuName,
-            PageParam: {Icon: 'folder'},
+            Icon: 'folder',
             children: []
           }
 
           if (snd.PageParam) {
             try {
-              sndItem.PageParam = JSON.parse(snd.PageParam)
-            } catch (e) {
-              sndItem.PageParam = {Icon: 'folder'}
-            }
-          }
+              let PageParam = JSON.parse(snd.PageParam)
 
-          let msg = {
-            UserID: sessionStorage.getItem('UserID'),
-            LoginUID: sessionStorage.getItem('LoginUID'),
-            User_Name: sessionStorage.getItem('User_Name'),
-            Full_Name: sessionStorage.getItem('Full_Name'),
-            Member_Level: sessionStorage.getItem('Member_Level'),
-            dataM: sessionStorage.getItem('dataM'),
-            avatar: sessionStorage.getItem('avatar'),
-            debug: sessionStorage.getItem('debug'),
-            role_id: sessionStorage.getItem('role_id'),
-            mainlogo: window.GLOB.mainlogo,
-            navBar: window.GLOB.navBar || '',
-            mstyle: window.GLOB.style
+              sndItem.Icon = PageParam.Icon || 'folder'
+            } catch (e) {}
           }
 
           if (snd.trd_menu) {
@@ -319,46 +275,26 @@
                 OpenType: 'newtab',
                 hidden: 'false'
               }
-  
-              if (trd.LinkUrl && iframes.includes(trd.LinkUrl.split('?')[0])) {
-                trdItem.type = 'iframe'
-                trdItem.LinkUrl = trd.LinkUrl.replace('&amp;', '&')
-              } else {
+
+              if (trd.PageParam) {
                 try {
-                  trdItem.PageParam = trd.PageParam ? JSON.parse(trd.PageParam) : {OpenType: 'newtab'}
-                } catch (e) {
-                  trdItem.PageParam = {OpenType: 'newtab'}
-                }
+                  let PageParam = JSON.parse(trd.PageParam)
 
-                trdItem.type = trdItem.PageParam.Template || trdItem.type
-                trdItem.OpenType = trdItem.PageParam.OpenType || trdItem.OpenType
-                trdItem.hidden = trdItem.PageParam.hidden || trdItem.hidden
+                  trdItem.type = PageParam.Template || 'CommonTable'
+                  trdItem.OpenType = PageParam.OpenType || 'newtab'
+                  trdItem.hidden = PageParam.hidden || 'false'
 
-                if (trdItem.type === 'NewPage') {
-                  trdItem.src = trdItem.PageParam.url || ''
-                  
-                  if (trdItem.src.indexOf('paramsmain/') > -1) {
-                    try {
-                      let _url = trdItem.src.split('paramsmain/')[0] + 'paramsmain/'
-                      let _param = JSON.parse(window.decodeURIComponent(window.atob(trdItem.src.split('paramsmain/')[1])))
-                      _param.UserID = sessionStorage.getItem('UserID')
-                      _param.LoginUID = sessionStorage.getItem('LoginUID')
-                      _param.User_Name = sessionStorage.getItem('User_Name')
-                      _param.Full_Name = sessionStorage.getItem('Full_Name')
-
-                      trdItem.src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
-                    } catch (e) {
-                      console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�')
-                    }
+                  if (trdItem.type === 'NewPage') {
+                    trdItem.src = PageParam.url || ''
                   }
-                } else {
-                  // 鎵撳紑鏂伴〉闈㈤摼鎺�
-                  trdItem.src = '#/paramsmain/' + window.btoa(window.encodeURIComponent(JSON.stringify({
-                    ...msg,
-                    ThirdMenu: trd.MenuID
-                  })))
-                }
+                } catch (e) {}
               }
+
+              if (trdItem.type !== 'NewPage') {
+                trdItem.src = '#/tab/' + trd.MenuID
+              }
+
+              trdItem.OpenType = trdItem.OpenType.toLowerCase() // NewPage涓烘墦寮�澶栭儴椤甸潰鍦板潃
 
               thdMenuList.push(trdItem)
 
@@ -399,12 +335,31 @@
   }
 
   loginSubmit = () => {
+    if (!this.loginRef) return
+
     this.setState({
       loginLoading: true
     })
+
     this.loginRef.handleConfirm().then(param => {
       Api.getusermsg(param.username, param.password, true).then(res => {
         if (res.status) {
+          this.setState({
+            loginLoading: false
+          })
+
+          if (res.modifydate) {
+            let s = (new Date().getTime() - new Date(res.modifydate).getTime()) / (1000 * 24 * 60 * 60)
+            if (!isNaN(s) && s > 90) {
+              Modal.warning({
+                width: 520,
+                title: <span>绯荤粺妫�娴嬪埌鎮ㄧ殑璐︽埛瀛樺湪椋庨櫓锛岃鍙婃椂鍒�<a target="_blank" rel="noopener noreferrer" href="https://cloud.mk9h.cn/admin/index.html">浜戜腑蹇�</a>淇敼瀵嗙爜锛�</span>,
+                okText: '鐭ラ亾浜�'
+              })
+              return
+            }
+          }
+
           sessionStorage.setItem('CloudUserID', res.UserID)
           sessionStorage.setItem('CloudLoginUID', res.LoginUID)
           sessionStorage.setItem('CloudUserName', res.UserName)
@@ -423,7 +378,6 @@
             localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password}))))
           }
 
-          this.setSystemFuncs()
           this.props.modifyMainMenu(null)
           this.props.history.replace('/design')
         } else {
@@ -441,106 +395,6 @@
           })
         }
       })
-    })
-  }
-
-  setSystemFuncs = () => {
-    if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
-      return
-    }
-    this.getfuncTime().then(res => {
-      Api.getSystemFuncs(res.createDate).then(result => {
-        if (!result.status) {
-          notification.error({
-            top: 92,
-            message: result.message,
-            duration: 10
-          })
-        } else if (result.func_detail && result.func_detail.length > 0) {
-          this.writeFuncs(result.func_detail)
-        }
-      })
-    })
-  }
-
-  writeFuncs = (funcs) => {
-    let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-
-    let sys_datetime = sessionStorage.getItem('sys_datetime')
-    let app_datetime = sessionStorage.getItem('app_datetime')
-    if (sys_datetime && app_datetime) {
-      let seconds = Math.floor((new Date().getTime() - app_datetime) / 1000)
-      timestamp = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss')
-    }
-
-    if (window.GLOB.WebSql) {
-      window.GLOB.WebSql.transaction(tx => {
-        tx.executeSql('DELETE FROM FUNCS')
-
-        funcs.forEach(item => {
-          if (!item.key_sql) return
-          tx.executeSql('INSERT INTO FUNCS (func_code, key_sql) VALUES (?, ?)', [item.func_code, item.key_sql])
-        })
-        tx.executeSql(`UPDATE VERSIONS SET createDate='${timestamp}' where CDefine1='funcs'`)
-      })
-    } else {
-      let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs')
-
-      objectStore.clear()
-
-      funcs.forEach(item => {
-        if (!item.key_sql) return
-        item.id = item.func_code
-        objectStore.add(item)
-      })
-
-      let funcStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version')
-      funcStore.put({id: 'funcs', version: '1.0', createDate: timestamp})
-    }
-  }
-
-  getfuncTime = () => {
-    return new Promise((resolve, reject) => {
-      if (window.GLOB.WebSql) {
-        window.GLOB.WebSql.transaction(tx => {
-          tx.executeSql("SELECT * FROM VERSIONS where CDefine1='funcs'", [], (tx, results) => {
-            let rows = results.rows
-            if (rows.length === 0) {
-              tx.executeSql('DELETE FROM FUNCS')
-              tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', ['1.0', '1970-01-01 14:59:09.000', 'funcs'])
-              resolve({createDate: '1970-01-01 14:59:09.000'})
-            } else {
-              resolve(rows[0])
-            }
-          }, (tx, results) => {
-            reject()
-            console.warn(results)
-          })
-        })
-      } else {
-        let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version')
-        let request = objectStore.get('funcs')
-
-        request.onerror = (event) => {
-          console.warn(event)
-          reject()
-        }
-
-        request.onsuccess = () => {
-          if (request.result) {
-            resolve(request.result)
-          } else {
-            let add = objectStore.add({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'})
-    
-            add.onerror = () => {
-              reject()
-            }
-            add.onsuccess = () => {
-              resolve({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'})
-            }
-          }
-        }
-      }
     })
   }
 
@@ -624,7 +478,7 @@
   componentDidMount () {
     // 鑾峰彇绯荤粺鐨勭増鏈俊鎭紝寤舵椂鏌ヨ
     setTimeout(() => {
-      Api.getAppVersion().then(() => {}, () => {})
+      Api.getAppVersion()
     }, 1000)
     // Api.genericInterface({
     //   func: 's_get_fcc_account_data',
@@ -632,6 +486,20 @@
     //   search_type: ''
     // }).then(res => {
     // })
+
+    // sessionStorage 璺ㄩ〉闈㈠叡浜�
+    window.addEventListener('storage', (e) => {
+      if (e.key === 'getSessionStorage' && e.newValue === window.GLOB.appkey) {
+        localStorage.setItem('sessionStorage', JSON.stringify(sessionStorage))
+      } else if (e.key === 'menuUpdate') {
+        let menuId = e.newValue.split(',')[1]
+        if (menuId) {
+          Api.getAppVersion(menuId).then(() => {
+            MKEmitter.emit('reloadMenuView', menuId)
+          })
+        }
+      }
+    })
   }
 
   shouldComponentUpdate (nextProps, nextState) {
@@ -653,26 +521,20 @@
       let url = `${ssodomain}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`
       window.open(url)
     } else if (options.sysType === 'SSO' || options.sysType === 'cloud') {
-      window.open(`${window.location.href.replace(/\/index.html(.*)|\/#(.*)/ig, '')}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`)
+      window.open(`${window.location.href.replace(/\/admin(.*)|\/index.html(.*)|\/#(.*)/ig, '')}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`)
     }
   }
 
   changeVerMenu(menu, type) {
     if (type === 'first') {
-      if (menu.OpenType === 'outpage' && menu.linkUrl) {
+      if (menu.OpenType === 'outpage') {
         window.open(menu.linkUrl)
-      } else if (menu.OpenType === 'menu') {
-
       }
     } else {
-      if (menu.OpenType === 'newpage' || menu.OpenType === 'NewPage') { // NewPage涓烘墦寮�澶栭儴椤甸潰鍦板潃锛宯ewpage涓烘墦寮�绯荤粺鑿滃崟
+      if (menu.OpenType === 'newpage') {
         window.open(menu.src)
-      } else if (menu.OpenType === 'blank') {
-        MKEmitter.emit('modifyTabs', menu, 'replace')
-      } else if (this.state.navBar === 'topmenu' && this.state.menuType !== 'menu_board_navigation') {
-        MKEmitter.emit('modifyTabs', menu, 'replace')
       } else {
-        MKEmitter.emit('modifyTabs', menu, 'plus')
+        MKEmitter.emit('modifyTabs', menu)
       }
   
       if (window.GLOB.systemType === 'production') {
@@ -717,9 +579,16 @@
     })
   }
 
+  changeToHome = () => {
+    if (!['linkage', 'menu_board'].includes(window.GLOB.navBar)) return
+
+    MKEmitter.emit('modifyTabs', {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'})
+  }
+
   render () {
     const { mainMenu, collapse } = this.props
-    const { thdMenuList, searchkey, debug, menulist, navBar, menuType, appVersion } = this.state
+    const { thdMenuList, searchkey, debug, menulist, appVersion } = this.state
+    const navBar = window.GLOB.navBar
 
     const menu = (
       <Menu className="header-dropdown">
@@ -746,12 +615,14 @@
 
     return (
       <header className="header-container ant-menu-dark" id="main-header-container">
-        <div className={'header-logo ' + (collapse && navBar !== 'topmenu' ? 'collapse' : '')}><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 === 'shutter' ?
+          <div className={'header-logo ' + (collapse ? 'collapse' : '')}><img src={this.state.logourl} alt=""/></div> : 
+          <div className="header-logo" onClick={this.changeToHome}><img src={this.state.logourl} alt=""/></div>}
+        {navBar === 'shutter' ? <div className={'header-collapse ' + (collapse ? 'collapse' : '')}>
+          {collapse ? <MenuUnfoldOutlined onClick={this.handleCollapse}/> : <MenuFoldOutlined onClick={this.handleCollapse}/>}
+        </div> : <div style={{width: '20px', height: '45px'}}></div>}
         {/* 姝e父鑿滃崟 */}
-        {navBar !== 'topmenu' && menulist ?
+        {navBar === 'shutter' && menulist ?
           <ul className="header-menu">{
             menulist.map(item => {
               return (
@@ -762,7 +633,7 @@
             })}
           </ul> : null
         }
-        {navBar === 'topmenu' && menuType !== 'menu_board' && menuType !== 'menu_board_navigation' && menulist ?
+        {(navBar === 'linkage' || navBar === 'linkage_navigation') && menulist ?
           <ul className="header-menu vertical-menu">{
             menulist.map(item => {
               if (item.children && item.children.length > 0) {
@@ -805,7 +676,7 @@
             })}
           </ul> : null
         }
-        {navBar === 'topmenu' && (menuType === 'menu_board' || menuType === 'menu_board_navigation') && menulist ?
+        {(navBar === 'menu_board' || navBar === 'menu_board_navigation') && menulist ?
           <ul className="header-menu vertical-menu">{
             menulist.map(item => {
               if (item.children && item.children.length > 0) {
@@ -843,15 +714,9 @@
             })}
           </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={
@@ -888,6 +753,15 @@
             <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']}
@@ -927,10 +801,8 @@
   return {
     toggleCollapse: (collapse) => dispatch(toggleCollapse(collapse)),
     modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)),
-    initActionPermission: (permAction) => dispatch(initActionPermission(permAction)),
-    initMenuPermission: (permMenus) => dispatch(initMenuPermission(permMenus)),
     logout: () => dispatch(logout())
   }
 }
 
-export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Form.create()(Header)))
\ No newline at end of file
+export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Header))
\ No newline at end of file

--
Gitblit v1.8.0