diff --git a/src/pages/Container/Map/components/Content/branchOffice/Camera/index.less b/src/pages/Container/Map/components/Content/branchOffice/Camera/index.less
index 118ef94..7586479 100644
--- a/src/pages/Container/Map/components/Content/branchOffice/Camera/index.less
+++ b/src/pages/Container/Map/components/Content/branchOffice/Camera/index.less
@@ -1,24 +1,4 @@
.map_content_branch_office_camera_modal {
- .@{ant-prefix}-modal {
- .@{ant-prefix}-modal-header {
- background-color: #06103b;
- padding: 16px 20px;
-
- .@{ant-prefix}-modal-title {
- color: #fff;
- }
- }
-
- .@{ant-prefix}-modal-content {
- padding: 0;
- background-color: #020828;
- }
-
- .@{ant-prefix}-modal-close {
- color: #fff;
- }
- }
-
.container {
padding: 27px 14px;
diff --git a/src/pages/Container/Map/components/Content/modal/MeteorologicalMonitoring/index.js b/src/pages/Container/Map/components/Content/modal/MeteorologicalMonitoring/index.js
new file mode 100644
index 0000000..8734f4b
--- /dev/null
+++ b/src/pages/Container/Map/components/Content/modal/MeteorologicalMonitoring/index.js
@@ -0,0 +1,15 @@
+const MeteorologicalMonitoring = () => {
+ return (
+
+
+
+ );
+};
+
+export default MeteorologicalMonitoring;
diff --git a/src/pages/Container/Map/components/Content/modal/index.js b/src/pages/Container/Map/components/Content/modal/index.js
new file mode 100644
index 0000000..fb07158
--- /dev/null
+++ b/src/pages/Container/Map/components/Content/modal/index.js
@@ -0,0 +1,26 @@
+import { Modal } from "antd";
+import { useContext } from "react";
+import { Context } from "~/pages/Container/Map/js/context";
+import MeteorologicalMonitoring from "./MeteorologicalMonitoring";
+
+const CustomModal = () => {
+ const { modalVisible, modalData, actions } = useContext(Context);
+
+ return (
+
{
+ actions.resetMark();
+ }}
+ title={modalData.title || ""}
+ wrapClassName="map_bi_model"
+ >
+
+
+ );
+};
+
+export default CustomModal;
diff --git a/src/pages/Container/Map/components/RightUtils/index.js b/src/pages/Container/Map/components/RightUtils/index.js
index ecd18d2..3237ce8 100644
--- a/src/pages/Container/Map/components/RightUtils/index.js
+++ b/src/pages/Container/Map/components/RightUtils/index.js
@@ -106,6 +106,9 @@ function RightUtils(props) {
case "pureMap":
actions.setPureMap(!pureMap);
break;
+ case "weather":
+ actions.selectMark({ title: "气象监测" });
+ break;
case "fourColor":
if (!currentPort) {
message.warning("请选择要查看的港口");
diff --git a/src/pages/Container/Map/index.js b/src/pages/Container/Map/index.js
index d2cc383..f44d6f3 100644
--- a/src/pages/Container/Map/index.js
+++ b/src/pages/Container/Map/index.js
@@ -1,11 +1,12 @@
import { useFullscreen, useMount } from "ahooks";
import { message } from "antd";
import autoFit from "autofit.js";
-import { useEffect, useMemo, useReducer, useRef } from "react";
+import { useEffect, useMemo, useReducer, useRef, useState } from "react";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import BottomUtils from "./components/BottomUtils";
import CenterUtils from "./components/CenterUtils";
import Content from "./components/Content";
+import CustomModal from "./components/Content/modal";
import Header from "./components/Header";
import RightUtils from "./components/RightUtils";
import { Context, initialMapState, MAP_ACTION, mapReducer } from "./js/context";
@@ -14,6 +15,7 @@ import mitt from "./js/mitt";
import {
changeCoverMaskVisibleMittKey,
clickBranchOfficePointMittKey,
+ clickMarkPointMittKey,
clickPortPointMittKey,
resetBottomUtilsMittKey,
} from "./js/mittKey";
@@ -23,6 +25,7 @@ function Map(props) {
const query = useGetUrlQuery();
const { viewer, mapMethods, initMap, externalEntryPort } = useInitMap();
+ const [isRenderContent, setIsRenderContent] = useState(false);
const fullscreenRef = useRef(null); // 全屏容器的ref
const [isFullscreen, { toggleFullscreen }] = useFullscreen(fullscreenRef);
const [state, dispatch] = useReducer(mapReducer, initialMapState);
@@ -31,6 +34,8 @@ function Map(props) {
const actions = useMemo(() => ({
selectPort: data => dispatch({ type: MAP_ACTION.SELECT_PORT, payload: data }),
selectBranchOffice: data => dispatch({ type: MAP_ACTION.SELECT_BRANCH_OFFICE, payload: data }),
+ selectMark: data => dispatch({ type: MAP_ACTION.SELECT_MARK, payload: data }),
+ resetMark: () => dispatch({ type: MAP_ACTION.RESET_MARK }),
setArea: area => dispatch({ type: MAP_ACTION.SET_AREA, payload: area }),
setBottomUtilsIndex: index => dispatch({ type: MAP_ACTION.SET_BOTTOM_UTILS_INDEX, payload: index }),
resetBottomUtils: () => dispatch({ type: MAP_ACTION.RESET_BOTTOM_UTILS }),
@@ -61,6 +66,7 @@ function Map(props) {
// Cesium 工具层暂时通过 mitt 通知;所有事件在根组件统一转成 reducer action。
const handlePortClick = data => actions.selectPort(data);
const handleBranchOfficeClick = data => actions.selectBranchOffice(data);
+ const handleMarkClick = data => actions.selectMark(data);
const handleCoverMaskVisible = (visible) => {
actions.setCoverMaskVisible(visible);
if (!visible) {
@@ -70,6 +76,7 @@ function Map(props) {
const handleResetBottomUtils = () => actions.resetBottomUtils();
mitt.on(clickPortPointMittKey, handlePortClick);
mitt.on(clickBranchOfficePointMittKey, handleBranchOfficeClick);
+ mitt.on(clickMarkPointMittKey, handleMarkClick);
mitt.on(changeCoverMaskVisibleMittKey, handleCoverMaskVisible);
mitt.on(resetBottomUtilsMittKey, handleResetBottomUtils);
@@ -77,6 +84,7 @@ function Map(props) {
autoFit.off();
mitt.off(clickPortPointMittKey, handlePortClick);
mitt.off(clickBranchOfficePointMittKey, handleBranchOfficeClick);
+ mitt.off(clickMarkPointMittKey, handleMarkClick);
mitt.off(changeCoverMaskVisibleMittKey, handleCoverMaskVisible);
mitt.off(resetBottomUtilsMittKey, handleResetBottomUtils);
};
@@ -87,6 +95,10 @@ function Map(props) {
query.clientId && window.sessionStorage.setItem("clientId", query.clientId);
query.orgId && window.sessionStorage.setItem("orgId", query.orgId);
query.token && window.sessionStorage.setItem("token", query.token);
+ setTimeout(() => {
+ if (window.sessionStorage.getItem("token"))
+ setIsRenderContent(true);
+ });
}, []);
const providerValues = useMemo(
@@ -99,11 +111,16 @@ function Map(props) {
-
-
-
-
-
+ {isRenderContent && (
+ <>
+
+
+
+
+
+
+ >
+ )}
{
+ mitt.emit(clickMarkPointMittKey, data);
+ };
+
// 点位点击
const pointClickEvent = (pick) => {
const data = pick.monitorItems.data;
@@ -114,6 +119,8 @@ export default function usePointClickEvent(viewerRef, mapMethods) {
clickPortPoint(data);
if (data.mapType === "分公司")
clickBranchOfficePoint(data);
+ if (data.mapType.includes("标记点"))
+ clickMarkPoint(data);
};
return {