diff --git a/src/layout/Header.js b/src/layout/Header.js index 9a23bc3..df25439 100644 --- a/src/layout/Header.js +++ b/src/layout/Header.js @@ -394,42 +394,6 @@ const NavOpton = (props) => { } }; const FullScreenOpton = (props) => { - const [showModal, setshowModal] = useState(false); - const getChildCount = (val) => { - setshowModal(val); - }; - const [fullScreen, setFullScreen] = useState(false); - const [originResizeFunc, setOriginResizeFunc] = useState(); - const escFunction = () => { - let isFull = !!( - document.fullscreen || - document.mozFullScreen || - document.webkitIsFullScreen || - document.webkitFullScreen || - document.msFullScreen - ); - if (isFull) { - // / - } else { - // requestFullScreenMethod(document.body); - setshowModal(false); - } - }; - useEffect(() => { - // 监听退出全屏事件 --- chrome 用 esc 退出全屏并不会触发 keyup 事件 - document.addEventListener('webkitfullscreenchange', escFunction); /* Chrome, Safari and Opera */ - document.addEventListener('mozfullscreenchange', escFunction); /* Firefox */ - document.addEventListener('fullscreenchange', escFunction); /* Standard syntax */ - document.addEventListener('msfullscreenchange', escFunction); /* IE / Edge */ - return () => { - //销毁时清除监听 - document.removeEventListener('webkitfullscreenchange', escFunction); - document.removeEventListener('mozfullscreenchange', escFunction); - document.removeEventListener('fullscreenchange', escFunction); - document.removeEventListener('MSFullscreenChange', escFunction); - }; - }, []); - if (window.navigator.userAgent.indexOf('Windows') < 1) { return
; } else { @@ -438,31 +402,11 @@ const FullScreenOpton = (props) => {
{ - setshowModal(true); - requestFullScreenMethod(document.body); // 进入全屏 + window.open('#/popup', '_blank', 'noreferrer'); }} > - {/* */}
- { - setshowModal(false); - }} - onCancel={() => { - setshowModal(false); - }} - className="fullScreen" - > - - ); } @@ -480,6 +424,38 @@ function Header(props) { if (window.navigator.userAgent.indexOf('Windows') < 1) { isMobile = true; } + const { Menus } = props.login.loginInfo; + let haveTarget = false; + // 目标ID + const targetId = 'D83FBB6D-D865-D1BF-6843-0732358E5D01'; + + const findNodeById = (menuData, id) => { + const searchId = id.toLowerCase(); + + for (const item of menuData) { + // 检查当前节点 + if (item.Node && item.Node.ID && item.Node.ID.toLowerCase() === searchId) { + return item; + } + + // 递归查找子节点 + if (item.Children && item.Children.length > 0) { + const found = findNodeById(item.Children, id); + if (found) return found; + } + } + return null; + }; + + // 查找目标节点 + const targetNode = findNodeById(Menus, targetId); + + // 输出查找结果 + if (targetNode) { + haveTarget = true; + } else { + haveTarget = false; + } return (
@@ -503,7 +479,7 @@ function Header(props) { {!props.matchLogin ? (
{/* */} - {/* */} + {haveTarget && } {/* {window.location.host == "121.41.2.71:8001" ? : ""} */}