diff --git a/src/assets/images/public/white/back.png b/src/assets/images/public/white/back.png new file mode 100644 index 0000000..2aa7cad Binary files /dev/null and b/src/assets/images/public/white/back.png differ diff --git a/src/pages/Container/Map/components/Header/index.js b/src/pages/Container/Map/components/Header/index.js index c25ae38..6b4548c 100644 --- a/src/pages/Container/Map/components/Header/index.js +++ b/src/pages/Container/Map/components/Header/index.js @@ -27,7 +27,15 @@ function Header(props) { const onBack = () => { sessionStorage.removeItem("mapCurrentBranchOfficeId"); mitt.emit(deletePeoplePositionPointMittKey); - if (currentPort !== "00003" && currentBranchOffice) { + if (!currentPort) { + window.close(); + setTimeout(() => { + if (!window.closed && !window.opener) { + window.location.href = "https://gbs-gateway.qhdsafety.com/"; + } + }, 500); + } + else if (currentPort !== "00003" && currentBranchOffice) { mitt.emit(clickPortPointMittKey, { id: "", name: "秦港股份" }); mitt.emit(clickBranchOfficePointMittKey, { id: "", corpName: "秦港股份" }); mapMethods.current.removeWall(); @@ -70,7 +78,7 @@ function Header(props) { className={`${displayedTitle === "秦港股份安全监管平台" ? "port" : "branch_office"}`} style={{ backgroundImage: `url(${displayedTitle === "秦港股份安全监管平台" ? topImg1 : topImg2})` }} > - {(currentPort && displayedTitle === "秦港股份安全监管平台") && ( + {(displayedTitle === "秦港股份安全监管平台") && (
)} {displayedTitle !== "秦港股份安全监管平台" && ( diff --git a/src/pages/Container/Map/components/RightUtils/index.js b/src/pages/Container/Map/components/RightUtils/index.js index 4c05c19..3ab084c 100644 --- a/src/pages/Container/Map/components/RightUtils/index.js +++ b/src/pages/Container/Map/components/RightUtils/index.js @@ -65,7 +65,12 @@ function RightUtils(props) { switch (type) { case "back": - // router.push("/"); + window.close(); + setTimeout(() => { + if (!window.closed && !window.opener) { + window.location.href = "https://gbs-gateway.qhdsafety.com/"; + } + }, 500); break; case "full": props.toggleFullscreen(); diff --git a/src/pages/Container/Map/index.js b/src/pages/Container/Map/index.js index 1029659..cda5463 100644 --- a/src/pages/Container/Map/index.js +++ b/src/pages/Container/Map/index.js @@ -1,7 +1,7 @@ import { useFullscreen, useMount } from "ahooks"; import { message } from "antd"; import autoFit from "autofit.js"; -import { useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import BottomUtils from "./components/BottomUtils"; import CenterUtils from "./components/CenterUtils"; @@ -84,6 +84,13 @@ function Map(props) { }; }); + useEffect(() => { + query.accessTicket && window.sessionStorage.setItem("accessTicket", query.accessTicket); + query.clientId && window.sessionStorage.setItem("clientId", query.clientId); + query.orgId && window.sessionStorage.setItem("orgId", query.orgId); + query.token && window.sessionStorage.setItem("token", query.token); + }, []); + const providerValues = useMemo( () => ({ viewer, mapMethods, currentPort, currentBranchOffice, area, bottomUtilsCurrentIndex, pureMap }), [viewer, mapMethods, currentPort, currentBranchOffice, area, bottomUtilsCurrentIndex, pureMap], @@ -96,7 +103,7 @@ function Map(props) {