king
2023-12-30 db04710a709c31c6635db621ac19a467d2e2c928
src/components/header/index.jsx
@@ -30,7 +30,7 @@
    systems: [],
    searchkey: '',
    thdMenuList: [],
    debug: sessionStorage.getItem('debug') === 'true',
    debug: sessionStorage.getItem('debug') === 'true' && window.GLOB.memberLevel > 0,
    collapse: sessionStorage.getItem('collapse') === 'true'
  }
@@ -60,7 +60,7 @@
      if (e.key === 'getSessionStorage' && e.newValue === window.GLOB.appkey) {
        localStorage.setItem('sessionStorage', JSON.stringify(sessionStorage))
      } else if (e.key === 'getSysPermission' && e.newValue === window.GLOB.appkey) {
        localStorage.setItem('sysPermissions', JSON.stringify({mkThdMenus: window.GLOB.mkThdMenus, mkActions: window.GLOB.mkActions}))
        localStorage.setItem('sysPermissions', JSON.stringify({mkThdMenus: this.state.thdMenuList, mkActions: window.GLOB.mkActions}))
      } else if (e.key === 'menuUpdate') {
        let vals = e.newValue.split(',')
        let menuId = vals[1]
@@ -180,13 +180,22 @@
      }
      window.GLOB.mainMenu = mainMenu
      window.GLOB.mkThdMenus = [...thdMenuList, {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'}]
      thdMenuList.forEach(item => {
        window.GLOB.mkThdMenus.set(item.MenuID, item)
      })
      window.GLOB.mkThdMenus.set('home_page_id', {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'})
      MKEmitter.emit('mainMenuChange')
      if (_menu) {
        this.openTab(_menu, 0)
      }
      setTimeout(() => {
        this.getwork()
      }, 100)
    })
    
    // 获取角色权限, edition_type 接口版本控制 ''、'Y'、'A'
@@ -205,7 +214,7 @@
              _permAction[menu.MenuID] = true
            })
          }
        } else {
        } else if (!/PRIMARY KEY/ig.test(result.message)) {
          notification.error({
            top: 92,
            message: result.message,
@@ -218,6 +227,29 @@
    }, 50)
  }
  getwork = () => {
    if (sessionStorage.getItem('work_grade')) return
    let param = {func: 's_get_local_my_worker_v1'}
    if (window.GLOB.forcedUpdate) {
      param.s_version_up = 'true'
    }
    Api.genericInterface(param).then(result => {
      sessionStorage.setItem('work_grade', result.work_grade || 0)
      sessionStorage.setItem('work_group', result.work_group || '')
      if (!result.status && sessionStorage.getItem('debug') === 'true') {
        notification.error({
          top: 92,
          message: /s_get_local_my_worker_v1/.test(result.message) ? '职员信息获取失败,请联系管理员。' : result.message,
          duration: 10
        })
      }
    })
  }
  openTab = (menu, times) => {
    if (times > 50) return
    times++
@@ -228,7 +260,7 @@
      MKEmitter.emit('modifyTabs', menu)
    } else {
      setTimeout(() => {
        this.openTab(times)
        this.openTab(menu, times)
      }, 200)
    }
  }
@@ -302,6 +334,7 @@
                  trdItem.type = PageParam.Template || 'CommonTable'
                  trdItem.OpenType = PageParam.OpenType || 'newtab'
                  trdItem.hidden = PageParam.hidden || 'false'
                  trdItem.menuColor = PageParam.menuColor || ''
                  if (trdItem.type === 'NewPage') {
                    trdItem.OpenType = 'newpage'
@@ -680,7 +713,7 @@
                            <div className="title" onClick={e => e.stopPropagation()}>{cell.MenuName}</div>
                            <div className="menu-detail">
                              {cell.children && cell.children.map(m => (
                                <div key={m.MenuID} title={m.MenuName} onClick={() => {this.changeVerMenu(m)}}>
                                <div key={m.MenuID} title={m.MenuName} style={m.menuColor ? {color: m.menuColor} : null} onClick={() => {this.changeVerMenu(m)}}>
                                  {m.MenuName}
                                </div>
                              ))}