This commit is contained in:
何美荣 2026-05-25 18:14:44 +08:00
commit 0effc0a205

View File

@ -394,42 +394,6 @@ const NavOpton = (props) => {
} }
}; };
const FullScreenOpton = (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) { if (window.navigator.userAgent.indexOf('Windows') < 1) {
return <div></div>; return <div></div>;
} else { } else {
@ -438,31 +402,11 @@ const FullScreenOpton = (props) => {
<div <div
type="primary" type="primary"
onClick={() => { onClick={() => {
setshowModal(true); window.open('#/popup', '_blank', 'noreferrer');
requestFullScreenMethod(document.body); // 进入全屏
}} }}
> >
<Icon type="alert" className="header__right-icon"></Icon> <Icon type="alert" className="header__right-icon"></Icon>
{/* <IconFont
type="icon-line-108"
style={{ fontSize: "22px", color: "#333333", cursor: "pointer" }}
></IconFont> */}
</div> </div>
<Modal
title="功能导航"
visible={showModal}
width="100%"
centered={true}
onOk={() => {
setshowModal(false);
}}
onCancel={() => {
setshowModal(false);
}}
className="fullScreen"
>
<FullScreenPage />
</Modal>
</div> </div>
); );
} }
@ -480,6 +424,38 @@ function Header(props) {
if (window.navigator.userAgent.indexOf('Windows') < 1) { if (window.navigator.userAgent.indexOf('Windows') < 1) {
isMobile = true; 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 ( return (
<div className={`header ${props.matchLogin ? 'login' : ''}`}> <div className={`header ${props.matchLogin ? 'login' : ''}`}>
@ -503,7 +479,7 @@ function Header(props) {
{!props.matchLogin ? ( {!props.matchLogin ? (
<div className="header__right"> <div className="header__right">
{/* <RiskFourColor/> */} {/* <RiskFourColor/> */}
{/* <FullScreen /> */} {haveTarget && <FullScreen />}
{/* {window.location.host == "121.41.2.71:8001" ? <FullScreen /> : ""} */} {/* {window.location.host == "121.41.2.71:8001" ? <FullScreen /> : ""} */}
<GuideCode /> <GuideCode />
<HeaderNav /> <HeaderNav />