@@ -275,4 +275,4 @@ function Index() {
);
}
-export default Index;
+export default IndexLeft;
diff --git a/src/pages/Container/Map/components/Content/branchOffice/Index/index.less b/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/index.less
similarity index 99%
rename from src/pages/Container/Map/components/Content/branchOffice/Index/index.less
rename to src/pages/Container/Map/components/Content/branchOffice/IndexLeft/index.less
index ca64d2f..9bea5cc 100644
--- a/src/pages/Container/Map/components/Content/branchOffice/Index/index.less
+++ b/src/pages/Container/Map/components/Content/branchOffice/IndexLeft/index.less
@@ -1,4 +1,4 @@
-.branch_office_index {
+.branch_office_index_left {
.block1 {
background-color: rgba(12, 28, 88, 0.4);
diff --git a/src/pages/Container/Map/components/Content/branchOffice/IndexRight/index.js b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/index.js
new file mode 100644
index 0000000..2d80263
--- /dev/null
+++ b/src/pages/Container/Map/components/Content/branchOffice/IndexRight/index.js
@@ -0,0 +1,7 @@
+function IndexRight() {
+ return (
+
+ );
+}
+
+export default IndexRight;
diff --git a/src/pages/Container/Map/components/Content/index.js b/src/pages/Container/Map/components/Content/index.js
index 4ad80d7..21a543a 100644
--- a/src/pages/Container/Map/components/Content/index.js
+++ b/src/pages/Container/Map/components/Content/index.js
@@ -1,12 +1,12 @@
-import { useContext, useEffect, useState } from "react";
-import { CSSTransition, SwitchTransition } from "react-transition-group";
+import { useContext, useState } from "react";
import collapseMenuImg1 from "~/assets/images/map_bi/content/collapse_menu1.png";
import collapseMenuImg2 from "~/assets/images/map_bi/content/collapse_menu2.png";
import collapseMenuBg1 from "~/assets/images/map_bi/content/collapse_menu_bg1.png";
import collapseMenuBg2 from "~/assets/images/map_bi/content/collapse_menu_bg2.png";
import { branchOfficeUtilsList } from "~/pages/Container/Map/components/BottomUtils/branchOfficeUtilsList";
import { portUtilsList } from "~/pages/Container/Map/components/BottomUtils/portUtilsList";
-import BranchOfficeIndex from "~/pages/Container/Map/components/Content/branchOffice/Index";
+import BranchOfficeIndexLeft from "~/pages/Container/Map/components/Content/branchOffice/IndexLeft";
+import BranchOfficeIndexRight from "~/pages/Container/Map/components/Content/branchOffice/IndexRight";
import IndexInfo from "~/pages/Container/Map/components/Content/IndexInfo";
import PortFengBi from "~/pages/Container/Map/components/Content/port/FengBi";
import PortIndex from "~/pages/Container/Map/components/Content/port/Index";
@@ -17,33 +17,13 @@ import PortWeiXian from "~/pages/Container/Map/components/Content/port/WeiXian";
import PortXiaoFang from "~/pages/Container/Map/components/Content/port/XiaoFang";
import PortZhongDian from "~/pages/Container/Map/components/Content/port/ZhongDian";
import { Context } from "~/pages/Container/Map/js/context";
-import mitt from "~/pages/Container/Map/js/mitt";
-import { changeContentAnimationKeyMittKey } from "~/pages/Container/Map/js/mittKey";
import "./index.less";
function Content() {
const { currentPort, currentBranchOffice, pureMap, bottomUtilsCurrentIndex } = useContext(Context);
- const [animationKey, setAnimationKey] = useState(0);
- const [collapse, setCollapse] = useState(false);
-
- useEffect(() => {
- setAnimationKey(Math.random());
-
- mitt.on(changeContentAnimationKeyMittKey, () => {
- setAnimationKey(Math.random());
- setCollapse(false);
- });
-
- return () => {
- mitt.off(changeContentAnimationKeyMittKey);
- };
- }, []);
-
- const onChangeCollapse = () => {
- setAnimationKey(Math.random());
- setCollapse(!collapse);
- };
+ const [collapseLeft, setCollapseLeft] = useState(false);
+ const [collapseRight, setCollapseRight] = useState(false);
const renderPortContent = () => {
const bottomUtilsCurrentType = bottomUtilsCurrentIndex !== -1 ? portUtilsList[bottomUtilsCurrentIndex].type : "";
@@ -65,72 +45,98 @@ function Content() {
return
;
};
- const renderBranchOfficeContent = () => {
+ const renderBranchOfficeContentLeft = () => {
const bottomUtilsCurrentType = bottomUtilsCurrentIndex !== -1 ? branchOfficeUtilsList[bottomUtilsCurrentIndex].type : "";
- if (bottomUtilsCurrentType === "")
- return
;
+ if (bottomUtilsCurrentType === "") {
+ return
;
+ }
+ };
+
+ const renderBranchOfficeContentRight = () => {
+ const bottomUtilsCurrentType = bottomUtilsCurrentIndex !== -1 ? branchOfficeUtilsList[bottomUtilsCurrentIndex].type : "";
+ if (bottomUtilsCurrentType === "") {
+ return
;
+ }
};
const renderContent = () => {
- if (pureMap || collapse)
+ if (pureMap)
return null;
return (
-
- {!currentPort && }
- {(currentPort === "00003" && !currentBranchOffice) && renderPortContent()}
- {currentBranchOffice && renderBranchOfficeContent()}
-
+ <>
+ {!collapseLeft && (
+
+ {!currentPort && }
+ {(currentPort === "00003" && !currentBranchOffice) && renderPortContent()}
+ {currentBranchOffice && renderBranchOfficeContentLeft()}
+
+ )}
+ {!collapseRight && (
+
+ {currentBranchOffice && renderBranchOfficeContentRight()}
+
+ )}
+ >
);
};
const renderCollapseMenu = () => {
if (pureMap)
return null;
+
if (currentPort === "00003" && !currentBranchOffice) {
return (
{
+ setCollapseLeft(!collapseLeft);
+ }}
>
);
}
+
if (currentBranchOffice) {
return (
-
-

-
+ <>
+
{
+ setCollapseLeft(!collapseLeft);
+ }}
+ >
+

+
+ {bottomUtilsCurrentIndex === -1 && (
+
{
+ setCollapseRight(!collapseRight);
+ }}
+ >
+

+
+ )}
+ >
);
}
};
return (
-
-
-
- {renderContent()}
- {renderCollapseMenu()}
-
-
-
+ {renderContent()}
+ {renderCollapseMenu()}
);
}
diff --git a/src/pages/Container/Map/components/Content/index.less b/src/pages/Container/Map/components/Content/index.less
index 20559df..a2c7199 100644
--- a/src/pages/Container/Map/components/Content/index.less
+++ b/src/pages/Container/Map/components/Content/index.less
@@ -1,87 +1,130 @@
.map_content_container {
+ // 定义循环混合宏
+ .loop (@i: 1) when (@i <= 5) {
+ .line-@{i} {
+ // 第1行:单行省略
+ & when (@i = 1) {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ // 第2-5行:多行省略
+ & when not (@i = 1) {
+ display: -webkit-box !important;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ word-break: break-all;
+ -webkit-line-clamp: @i;
+ -webkit-box-orient: vertical !important;
+ }
+ }
+ // 递归调用
+ .loop(@i + 1);
+ }
+
+ // 执行循环
+ .loop();
+
&__content {
width: 430px;
position: absolute;
- left: 35px;
- &.port{
+ &.port {
top: 75px;
max-height: calc(100vh - 75px);
}
- &.branch_office{
+ &.branch_office {
top: 70px;
max-height: calc(100vh - 70px);
}
-
- // 定义循环混合宏
- .loop (@i: 1) when (@i <= 5) {
- .line-@{i} {
- // 第1行:单行省略
- & when (@i = 1) {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
-
- // 第2-5行:多行省略
- & when not (@i = 1) {
- display: -webkit-box !important;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- -webkit-line-clamp: @i;
- -webkit-box-orient: vertical !important;
- }
- }
- // 递归调用
- .loop(@i + 1);
- }
-
- // 执行循环
- .loop();
}
.collapse_menu {
position: absolute;
- left: 465px;
top: calc(50vh - 44.5px);
background-repeat: no-repeat;
background-size: 100% 100%;
cursor: pointer;
- &.active {
- left: 0;
+ &.left {
+ left: 465px;
+
+ &.active {
+ left: 0;
+
+ img {
+ transform: translate(-50%, -50%) rotate(180deg);
+ }
+ }
img {
- transform: translate(-50%, -50%) rotate(180deg);
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%) rotate(0);
+ }
+
+ &.port {
+ width: 30px;
+ height: 89px;
+
+ img {
+ width: 10px;
+ height: 17px;
+ }
+ }
+
+ &.branch_office {
+ width: 33px;
+ height: 116px;
+
+ img {
+ width: 13px;
+ height: 34px;
+ }
}
}
- img {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%) rotate(0);
- }
+ &.right {
+ right: 465px;
- &.port {
- width: 30px;
- height: 89px;
+ &.active {
+ right: 0;
- .img {
- width: 10px;
- height: 17px;
+ img {
+ transform: translate(-50%, -50%) rotate(180deg);
+ }
}
- }
- &.branch_office {
- width: 33px;
- height: 116px;
+ img {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%) rotate(0);
+ }
- .img {
- width: 13px;
- height: 34px;
+ &.port {
+ width: 30px;
+ height: 89px;
+ transform: rotate(180deg);
+
+ img {
+ width: 10px;
+ height: 17px;
+ }
+ }
+
+ &.branch_office {
+ width: 33px;
+ height: 116px;
+ transform: rotate(180deg);
+
+ img {
+ width: 13px;
+ height: 34px;
+ }
}
}
}
diff --git a/src/pages/Container/Map/components/Header/index.js b/src/pages/Container/Map/components/Header/index.js
index 5ec7179..351ae0a 100644
--- a/src/pages/Container/Map/components/Header/index.js
+++ b/src/pages/Container/Map/components/Header/index.js
@@ -1,5 +1,4 @@
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";
import guangImg from "~/assets/images/map_bi/guang.png";
@@ -8,8 +7,6 @@ import topImg2 from "~/assets/images/map_bi/top2.png";
import { Context } from "~/pages/Container/Map/js/context";
import mitt from "~/pages/Container/Map/js/mitt";
import {
- changeBottomUtilsAnimationMittKey,
- changeContentAnimationKeyMittKey,
changePeopleTrajectorySelectVisibleMittKey,
clickBackMittKey,
clickBranchOfficePointMittKey,
@@ -54,50 +51,34 @@ function Header(props) {
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 (
-
-
-
- {(currentPort && props.headerTitle === "秦港股份安全监管平台") && (
-
- )}
- {props.headerTitle !== "秦港股份安全监管平台" && (
-
-

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

+
返回
+
+ )}
+ {props.headerTitle}
+
+
);
}
diff --git a/src/pages/Container/Map/components/RightUtils/index.js b/src/pages/Container/Map/components/RightUtils/index.js
index 31f3a34..4e58703 100644
--- a/src/pages/Container/Map/components/RightUtils/index.js
+++ b/src/pages/Container/Map/components/RightUtils/index.js
@@ -1,14 +1,11 @@
import { message } from "antd";
import { useContext, useEffect, useState } from "react";
-import { CSSTransition, SwitchTransition } 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";
import { Context } from "~/pages/Container/Map/js/context";
import mitt from "~/pages/Container/Map/js/mitt";
import {
- changeBottomUtilsAnimationMittKey,
- changeContentAnimationKeyMittKey,
changePeopleTrajectorySelectVisibleMittKey,
clickBackMittKey,
clickMarkPointMittKey,
@@ -21,7 +18,7 @@ import { portUtilsList } from "./portUtilsList";
import "./index.less";
function RightUtils(props) {
- const { currentPort, mapMethods, pureMap, currentBranchOffice } = useContext(Context);
+ const { currentPort, mapMethods, pureMap, currentBranchOffice, bottomUtilsCurrentIndex } = useContext(Context);
const [list, setList] = useState(portUtilsList);
const [isShowChildLevel, setIsShowChildLevel] = useState(true);
@@ -80,8 +77,6 @@ function RightUtils(props) {
break;
case "pureMap":
props.setPureMap(!pureMap);
- mitt.emit(changeBottomUtilsAnimationMittKey);
- mitt.emit(changeContentAnimationKeyMittKey);
break;
case "weather":
mitt.emit(clickMarkPointMittKey, {
@@ -139,17 +134,7 @@ function RightUtils(props) {
const renderBranchOfficeUtils = () => {
return (
-
+ {(isShowChildLevel && bottomUtilsCurrentIndex !== -1) && (
{
list.map((item, index) => (
@@ -164,34 +149,22 @@ function RightUtils(props) {
))
}
-
-
setIsShowChildLevel(!isShowChildLevel)}
- >
-

-
+ )}
+ {bottomUtilsCurrentIndex !== -1 && (
+
setIsShowChildLevel(!isShowChildLevel)}
+ >
+

+
+ )}
);
};
return (
-
-
- {!currentBranchOffice ? renderPortUtils() : renderBranchOfficeUtils()}
-
-
+ {!currentBranchOffice ? renderPortUtils() : renderBranchOfficeUtils()}
);
}
diff --git a/src/pages/Container/Map/js/mittKey.js b/src/pages/Container/Map/js/mittKey.js
index 1c7c5a5..bcb85d7 100644
--- a/src/pages/Container/Map/js/mittKey.js
+++ b/src/pages/Container/Map/js/mittKey.js
@@ -6,8 +6,6 @@ export const clickBranchOfficePointMittKey = "clickBranchOfficePoint";
export const clickMarkPointMittKey = "clickMarkPoint";
// 点击左上角返回
export const clickBackMittKey = "clickBack";
-// 重新执行底部工具栏动画
-export const changeBottomUtilsAnimationMittKey = "changeBottomUtilsAnimation";
// 重置底部工具栏当前索引
export const resetBottomCurrentIndexMittKey = "resetBottomCurrentIndex";
// 重置所有底部工具栏选中状态
@@ -16,8 +14,6 @@ export const resetAllBottomUtilsCheckMittKey = "resetAllBottomUtilsCheck";
export const initBottomUtilsMittKey = "initBottomUtils";
// 改变覆盖蒙版显隐
export const changeCoverMaskVisibleMittKey = "changeCoverMaskVisible";
-// 改变内容动画显隐
-export const changeContentAnimationKeyMittKey = "changeContentAnimationKey";
// 改变人员轨迹选择窗口显隐
export const changePeopleTrajectorySelectVisibleMittKey = "changePeopleTrajectorySelectVisible";
// 将人员定位列表提供给人员轨迹选择窗口
diff --git a/src/pages/Container/Map/js/pointClickEvent.js b/src/pages/Container/Map/js/pointClickEvent.js
index 3024d89..cb8c5c8 100644
--- a/src/pages/Container/Map/js/pointClickEvent.js
+++ b/src/pages/Container/Map/js/pointClickEvent.js
@@ -4,8 +4,6 @@ import PopupInfo from "../components/popup/js/PopupInfo";
import { getPosition } from "./mapUtils";
import mitt from "./mitt";
import {
- changeBottomUtilsAnimationMittKey,
- changeContentAnimationKeyMittKey,
clickBranchOfficePointMittKey,
clickMarkPointMittKey,
clickPortPointMittKey,
@@ -87,10 +85,8 @@ export default class PointClickEvent {
sessionStorage.setItem("mapCurrentBranchOfficeId", data.corpinfoId);
}
}, 2000);
- mitt.emit(changeBottomUtilsAnimationMittKey);
mitt.emit(resetBottomCurrentIndexMittKey);
mitt.emit(resetAllBottomUtilsCheckMittKey);
- mitt.emit(changeContentAnimationKeyMittKey);
};
// 分公司点位点击
@@ -123,10 +119,8 @@ export default class PointClickEvent {
mitt.emit(deletePeoplePositionPointMittKey);
mitt.emit(clickBranchOfficePointMittKey, data);
sessionStorage.setItem("mapCurrentBranchOfficeId", data.corpinfoId);
- mitt.emit(changeBottomUtilsAnimationMittKey);
mitt.emit(resetBottomCurrentIndexMittKey);
mitt.emit(resetAllBottomUtilsCheckMittKey);
- mitt.emit(changeContentAnimationKeyMittKey);
};
// 标记点位点击