2026-01-07 16:38:01 +08:00
|
|
|
import { useContext } from "react";
|
|
|
|
|
import { CSSTransition, SwitchTransition } from "react-transition-group";
|
|
|
|
|
import backImg1 from "~/assets/images/map_bi/back1.png";
|
|
|
|
|
import backImg2 from "~/assets/images/map_bi/back2.png";
|
2026-01-05 14:53:49 +08:00
|
|
|
import guangImg from "~/assets/images/map_bi/guang.png";
|
2026-01-07 16:38:01 +08:00
|
|
|
import topImg1 from "~/assets/images/map_bi/top1.png";
|
|
|
|
|
import topImg2 from "~/assets/images/map_bi/top2.png";
|
2026-01-05 14:53:49 +08:00
|
|
|
import { Context } from "~/pages/Container/Map/js/context";
|
|
|
|
|
import mitt from "~/pages/Container/Map/js/mitt";
|
|
|
|
|
import {
|
|
|
|
|
changeBottomUtilsAnimationMittKey,
|
|
|
|
|
changeContentAnimationKeyMittKey,
|
|
|
|
|
changePeopleTrajectorySelectVisibleMittKey,
|
|
|
|
|
clickBackMittKey,
|
|
|
|
|
clickBranchOfficePointMittKey,
|
|
|
|
|
clickPortPointMittKey,
|
|
|
|
|
deletePeoplePositionPointMittKey,
|
|
|
|
|
resetAllBottomUtilsCheckMittKey,
|
|
|
|
|
resetBottomCurrentIndexMittKey,
|
|
|
|
|
} from "~/pages/Container/Map/js/mittKey";
|
|
|
|
|
import "./index.less";
|
|
|
|
|
|
2026-01-07 16:38:01 +08:00
|
|
|
function Header(props) {
|
2026-01-05 14:53:49 +08:00
|
|
|
const { currentPort, currentBranchOffice, mapMethods, area } = useContext(Context);
|
|
|
|
|
|
|
|
|
|
const onBack = () => {
|
2026-01-07 16:38:01 +08:00
|
|
|
sessionStorage.removeItem("mapCurrentBranchOfficeId");
|
2026-01-05 14:53:49 +08:00
|
|
|
mitt.emit(deletePeoplePositionPointMittKey);
|
|
|
|
|
if (currentPort !== "00003" && currentBranchOffice) {
|
2026-01-07 16:38:01 +08:00
|
|
|
mitt.emit(clickPortPointMittKey, { id: "", name: "秦港股份" });
|
|
|
|
|
mitt.emit(clickBranchOfficePointMittKey, { id: "", corpName: "秦港股份" });
|
2026-01-05 14:53:49 +08:00
|
|
|
mapMethods.current.removeWall();
|
|
|
|
|
mapMethods.current.removeFourColorDiagram();
|
|
|
|
|
mapMethods.current.removeBranchOfficePoint();
|
|
|
|
|
mapMethods.current.removeMarkPoint();
|
|
|
|
|
mapMethods.current.flyTo();
|
|
|
|
|
mapMethods.current.addPortPoint();
|
|
|
|
|
}
|
|
|
|
|
else if (currentBranchOffice) {
|
2026-01-07 16:38:01 +08:00
|
|
|
mitt.emit(clickBranchOfficePointMittKey, { id: "", corpName: "秦港股份" });
|
2026-01-05 14:53:49 +08:00
|
|
|
mapMethods.current.removeBranchOfficePoint();
|
|
|
|
|
mapMethods.current.removeMarkPoint();
|
|
|
|
|
mapMethods.current.returnPreviousCenterPoint();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
mapMethods.current.addBranchOfficePoint(area);
|
|
|
|
|
}, 2000);
|
|
|
|
|
}
|
|
|
|
|
else if (currentPort) {
|
2026-01-07 16:38:01 +08:00
|
|
|
mitt.emit(clickPortPointMittKey, { id: "", name: "秦港股份" });
|
2026-01-05 14:53:49 +08:00
|
|
|
mapMethods.current.removeWall();
|
|
|
|
|
mapMethods.current.removeFourColorDiagram();
|
|
|
|
|
mapMethods.current.removeBranchOfficePoint();
|
|
|
|
|
mapMethods.current.removeMarkPoint();
|
|
|
|
|
mapMethods.current.flyTo();
|
|
|
|
|
mapMethods.current.addPortPoint();
|
|
|
|
|
}
|
|
|
|
|
mitt.emit(changeBottomUtilsAnimationMittKey);
|
|
|
|
|
mitt.emit(resetBottomCurrentIndexMittKey);
|
|
|
|
|
mitt.emit(resetAllBottomUtilsCheckMittKey);
|
|
|
|
|
mitt.emit(clickBackMittKey);
|
|
|
|
|
mitt.emit(changeContentAnimationKeyMittKey);
|
|
|
|
|
mitt.emit(changePeopleTrajectorySelectVisibleMittKey, false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
2026-01-08 11:27:19 +08:00
|
|
|
<div className="map_content_header_container">
|
2026-01-07 16:38:01 +08:00
|
|
|
<SwitchTransition>
|
|
|
|
|
<CSSTransition
|
|
|
|
|
timeout={1000}
|
|
|
|
|
classNames={{
|
|
|
|
|
enter: "animate__animated",
|
|
|
|
|
enterActive: "animate__animated animate__fadeInDown",
|
|
|
|
|
exit: "animate__animated",
|
|
|
|
|
exitActive: "animate__animated animate__fadeOutUp",
|
|
|
|
|
}}
|
|
|
|
|
unmountOnExit
|
|
|
|
|
key={currentBranchOffice || 1}
|
|
|
|
|
>
|
|
|
|
|
<header
|
|
|
|
|
className={`${props.headerTitle === "秦港股份安全监管平台" ? "port" : "branch_office"}`}
|
|
|
|
|
style={{ backgroundImage: `url(${props.headerTitle === "秦港股份安全监管平台" ? topImg1 : topImg2})` }}
|
2026-01-05 14:53:49 +08:00
|
|
|
>
|
2026-01-07 16:38:01 +08:00
|
|
|
{(currentPort && props.headerTitle === "秦港股份安全监管平台") && (
|
|
|
|
|
<div
|
|
|
|
|
style={{ backgroundImage: `url(${backImg1})` }}
|
|
|
|
|
className="back"
|
|
|
|
|
onClick={onBack}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
{props.headerTitle !== "秦港股份安全监管平台" && (
|
|
|
|
|
<div className="back" onClick={onBack}>
|
|
|
|
|
<img src={backImg2} alt="" />
|
|
|
|
|
<div>返回</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
<div className="title">{props.headerTitle}</div>
|
|
|
|
|
<div style={{ backgroundImage: `url(${guangImg})` }} className="guang" />
|
|
|
|
|
</header>
|
|
|
|
|
</CSSTransition>
|
|
|
|
|
</SwitchTransition>
|
2026-01-05 14:53:49 +08:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Header;
|