- {(activeIndex === 0 || activeIndex === 1) && (
+
西港区
@@ -69,8 +92,18 @@ function CenterUtils(props) {
车辆:33辆
- )}
- {(activeIndex === 2 || activeIndex === 1) && (
+
+
东港区
@@ -78,10 +111,10 @@ function CenterUtils(props) {
车辆:33辆
- )}
+
- )}
+
);
}
diff --git a/src/pages/Container/Map/components/Header/index.js b/src/pages/Container/Map/components/Header/index.js
index 351ae0a..28b7e99 100644
--- a/src/pages/Container/Map/components/Header/index.js
+++ b/src/pages/Container/Map/components/Header/index.js
@@ -1,4 +1,5 @@
-import { useContext } from "react";
+import { useContext, useEffect, useRef, useState } from "react";
+import { CSSTransition } from "react-transition-group";
import backImg1 from "~/assets/images/map_bi/back1.png";
import backImg2 from "~/assets/images/map_bi/back2.png";
import guangImg from "~/assets/images/map_bi/guang.png";
@@ -17,9 +18,26 @@ import {
} from "~/pages/Container/Map/js/mittKey";
import "./index.less";
+const animationTime = 1000;
function Header(props) {
const { currentPort, currentBranchOffice, mapMethods, area } = useContext(Context);
+ const [animationShow, setAnimationShow] = useState(false);
+ const [displayTitle, setDisplayTitle] = useState(props.headerTitle);
+ const timer = useRef(null);
+
+ useEffect(() => {
+ setAnimationShow(false);
+ timer.current = setTimeout(() => {
+ setDisplayTitle(props.headerTitle);
+ setAnimationShow(true);
+ }, animationTime);
+
+ return () => {
+ timer.current && clearTimeout(timer.current);
+ };
+ }, [props.headerTitle]);
+
const onBack = () => {
sessionStorage.removeItem("mapCurrentBranchOfficeId");
mitt.emit(deletePeoplePositionPointMittKey);
@@ -38,9 +56,9 @@ function Header(props) {
mapMethods.current.removeBranchOfficePoint();
mapMethods.current.removeMarkPoint();
mapMethods.current.returnPreviousCenterPoint();
- setTimeout(() => {
- mapMethods.current.addBranchOfficePoint(area);
- }, 2000);
+ // setTimeout(() => {
+ mapMethods.current.addBranchOfficePoint(area);
+ // }, 2000);
}
else if (currentPort) {
mitt.emit(clickPortPointMittKey, { id: "", name: "秦港股份" });
@@ -59,26 +77,34 @@ function Header(props) {
return (
-
- {(currentPort && props.headerTitle === "秦港股份安全监管平台") && (
-
- )}
- {props.headerTitle !== "秦港股份安全监管平台" && (
-
-

-
返回
-
- )}
- {props.headerTitle}
-
-
+
+ {(currentPort && displayTitle === "秦港股份安全监管平台") && (
+
+ )}
+ {displayTitle !== "秦港股份安全监管平台" && (
+
+

+
返回
+
+ )}
+ {displayTitle}
+
+
+
);
}
diff --git a/src/pages/Container/Map/components/RightUtils/index.js b/src/pages/Container/Map/components/RightUtils/index.js
index 4e58703..26dbe94 100644
--- a/src/pages/Container/Map/components/RightUtils/index.js
+++ b/src/pages/Container/Map/components/RightUtils/index.js
@@ -1,5 +1,6 @@
import { message } from "antd";
import { useContext, useEffect, useState } from "react";
+import { CSSTransition } from "react-transition-group";
import tooltipImg2 from "~/assets/images/map_bi/right_utils/branch_office/bg11.png";
import buttonBg from "~/assets/images/map_bi/right_utils/branch_office/button.png";
import tooltipImg1 from "~/assets/images/map_bi/right_utils/port/tooltip.png";
@@ -21,7 +22,7 @@ function RightUtils(props) {
const { currentPort, mapMethods, pureMap, currentBranchOffice, bottomUtilsCurrentIndex } = useContext(Context);
const [list, setList] = useState(portUtilsList);
- const [isShowChildLevel, setIsShowChildLevel] = useState(true);
+ const [isShowChildLevel, setIsShowChildLevel] = useState(false);
useEffect(() => {
mitt.on(initRightUtilsMittKey, () => {
@@ -134,7 +135,17 @@ function RightUtils(props) {
const renderBranchOfficeUtils = () => {
return (
- {(isShowChildLevel && bottomUtilsCurrentIndex !== -1) && (
+
{
list.map((item, index) => (
@@ -149,8 +160,8 @@ function RightUtils(props) {
))
}
- )}
- {bottomUtilsCurrentIndex !== -1 && (
+
+ {(bottomUtilsCurrentIndex !== -1) && (
setIsShowChildLevel(!isShowChildLevel)}