| | |
| | | const { confirm } = Modal |
| | | const { Search } = Input |
| | | const Resetpwd = asyncComponent(() => import('@/components/resetPassword')) |
| | | const QrCode = asyncComponent(() => import('@/components/qrcode')) |
| | | const LoginForm = asyncSpinComponent(() => import('./loginform')) |
| | | |
| | | class Header extends Component { |
| | |
| | | |
| | | changeMenu (value) { |
| | | // 主菜单切换 |
| | | if (value.OpenType === 'outpage') { |
| | | window.open(value.linkUrl) |
| | | if (value.OpenType === 'newpage') { |
| | | window.open(value.src) |
| | | } else if (value.OpenType === 'newtab') { |
| | | MKEmitter.emit('modifyTabs', value) |
| | | } else if (value.OpenType === 'menu') { |
| | | this.props.modifyMainMenu(value) |
| | | } |
| | |
| | | |
| | | window.GLOB.mkThdMenus = [...thdMenuList, {MenuID: 'home_page_id', EasyCode: '', MenuName: 'home', type: 'CustomPage'}] |
| | | |
| | | if (_menu) { // 延时打开,防止标签组未完成加载 |
| | | setTimeout(() => { |
| | | MKEmitter.emit('modifyTabs', _menu) |
| | | }, 200) |
| | | if (_menu) { |
| | | this.openTab(_menu, 0) |
| | | } |
| | | MKEmitter.emit('mkMenuLoaded') |
| | | }) |
| | | |
| | | // 获取角色权限, edition_type 接口版本控制 ''、'Y'、'A' |
| | |
| | | }) |
| | | } |
| | | |
| | | MKEmitter.emit('mkActionLoaded') |
| | | window.GLOB.mkActions = _permAction |
| | | }) |
| | | }, 50) |
| | | } |
| | | |
| | | openTab = (menu, times) => { |
| | | if (times > 50) return |
| | | times++ |
| | | |
| | | let tabgroup = document.getElementById('mk-tabgroup-wrap') |
| | | |
| | | if (window.GLOB.mkActions.loaded && tabgroup) { |
| | | MKEmitter.emit('modifyTabs', menu) |
| | | } else { |
| | | setTimeout(() => { |
| | | this.openTab(times) |
| | | }, 200) |
| | | } |
| | | } |
| | | |
| | | getMenulist = (result) => { |
| | |
| | | let PageParam = JSON.parse(fst.PageParam) |
| | | |
| | | if (PageParam.OpenType === 'outpage' && PageParam.linkUrl) { |
| | | fstItem.OpenType = 'outpage' |
| | | fstItem.linkUrl = PageParam.linkUrl |
| | | fstItem.OpenType = 'newpage' |
| | | fstItem.src = PageParam.linkUrl |
| | | if (/#\/iframe\//.test(fstItem.src)) { |
| | | fstItem.src = fstItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) |
| | | fstItem.type = 'iframe' |
| | | fstItem.OpenType = 'newtab' |
| | | } |
| | | } |
| | | } catch (e) {} |
| | | } |
| | |
| | | trdItem.hidden = PageParam.hidden || 'false' |
| | | |
| | | if (trdItem.type === 'NewPage') { |
| | | trdItem.OpenType = 'newpage' |
| | | trdItem.src = PageParam.url || '' |
| | | if (/#\/iframe\//.test(trdItem.src)) { |
| | | trdItem.src = trdItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) |
| | | trdItem.type = 'iframe' |
| | | trdItem.OpenType = 'newtab' |
| | | } |
| | | } else if (trdItem.OpenType === 'view') { |
| | | trdItem.OpenType = 'newpage' |
| | | trdItem.src = '#/view/' + trd.MenuID |
| | | } else { |
| | | trdItem.src = '#/tab/' + trd.MenuID |
| | | } |
| | | } catch (e) {} |
| | | } |
| | | |
| | | if (trdItem.type !== 'NewPage') { |
| | | } else { |
| | | trdItem.src = '#/tab/' + trd.MenuID |
| | | } |
| | | |
| | | trdItem.OpenType = trdItem.OpenType.toLowerCase() // NewPage为打开外部页面地址 |
| | | |
| | | if (names.has(trdItem.menu_name)) { |
| | | doublenames.set(trdItem.menu_name, true) |
| | |
| | | loginVisible: true |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | this.props.modifyMainMenu(null) |
| | | |
| | | this.props.history.replace('/design') |
| | |
| | | sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('cloudRole_id', res.role_id || '') |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | if (param.remember) { |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password})))) |
| | | } else { |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: ''})))) |
| | | } |
| | | |
| | | this.props.modifyMainMenu(null) |
| | |
| | | window.addEventListener('storage', (e) => { |
| | | 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})) |
| | | } else if (e.key === 'menuUpdate') { |
| | | let menuId = e.newValue.split(',')[1] |
| | | if (menuId) { |
| | |
| | | |
| | | changeVerMenu(menu, type) { |
| | | if (type === 'first') { |
| | | if (menu.OpenType === 'outpage') { |
| | | window.open(menu.linkUrl) |
| | | if (menu.OpenType === 'newpage') { |
| | | window.open(menu.src) |
| | | } else if (menu.OpenType === 'newtab') { |
| | | MKEmitter.emit('modifyTabs', menu) |
| | | } |
| | | } else { |
| | | if (menu.OpenType === 'newpage') { |
| | |
| | | }) |
| | | } |
| | | |
| | | wxnotice = () => { |
| | | Modal.success({ |
| | | className: 'mk-wx-notice', |
| | | title: <QrCode card={{qrWidth: 320, color: '#000000'}} value={window.GLOB.baseurl + 'mob/wxnotice.html?userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')}/>, |
| | | okText: '关闭' |
| | | }) |
| | | } |
| | | |
| | | changeToHome = () => { |
| | | if (!['linkage', 'menu_board'].includes(window.GLOB.navBar)) return |
| | | |
| | |
| | | <Menu.Item key="verup" onClick={this.verup}> |
| | | 页面更新 |
| | | </Menu.Item> |
| | | {window.GLOB.WXNotice ? <Menu.Item key="wxnotice" onClick={this.wxnotice}> |
| | | 微信消息 |
| | | </Menu.Item> : null} |
| | | {window.GLOB.appVersion ? <Menu.Item key="version" onClick={this.about}> |
| | | 关于 |
| | | </Menu.Item> : null} |