From 936a96b184d6ba41cf4623c38c23d1a19868a12c Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Mon, 27 Jul 2026 17:09:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(map):=20=E4=BF=AE=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=8F=B3=E4=BE=A7=E7=BA=AF=E5=87=80=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E4=BC=9A=E6=B8=85=E7=A9=BA=E4=B8=8B=E6=96=B9=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Map/components/BottomUtils/index.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/pages/Container/Map/components/BottomUtils/index.js b/src/pages/Container/Map/components/BottomUtils/index.js index 8fc1515..350c7f8 100644 --- a/src/pages/Container/Map/components/BottomUtils/index.js +++ b/src/pages/Container/Map/components/BottomUtils/index.js @@ -8,10 +8,10 @@ import bg8 from "~/assets/images/map_bi/bottom_utils/bg8.png"; import titleImg from "~/assets/images/map_bi/bottom_utils/title.png"; import titleOnImg from "~/assets/images/map_bi/bottom_utils/title_on.png"; import { NS_BI_MARK } from "~/enumerate/namespace"; -import { branchOfficeUtilsList } from "~/pages/Container/Map/components/BottomUtils/branchOfficeUtilsList"; import { Context } from "~/pages/Container/Map/js/context"; import usePeoplePosition from "~/pages/Container/Map/js/usePeoplePosition"; -import PeopleTrajectorySelect from "~/pages/Container/Map/components/PeopleTrajectorySelect"; +import PeopleTrajectorySelect from "../PeopleTrajectorySelect"; +import { branchOfficeUtilsList } from "./branchOfficeUtilsList"; import { portUtilsList } from "./portUtilsList"; import { usePortUtilsAnimation } from "./usePortUtilsAnimation"; import "./index.less"; @@ -75,13 +75,15 @@ function BottomUtils(props) { setPeopleList, ); - const bottomUtilsMode = !pureMap && currentPort && !currentBranchOffice + // 菜单数据只由地图层级决定;纯净地图仅隐藏工具栏,不能重置已选菜单。 + const bottomUtilsBaseMode = currentPort && !currentBranchOffice ? "port" - : !pureMap && currentPort && currentBranchOffice ? "branchOffice" : null; - const [list, setList] = useState(() => bottomUtilsMode === "port" + : currentPort && currentBranchOffice ? "branchOffice" : null; + const bottomUtilsMode = pureMap ? null : bottomUtilsBaseMode; + const [list, setList] = useState(() => bottomUtilsBaseMode === "port" ? portUtilsList - : bottomUtilsMode === "branchOffice" ? branchOfficeUtilsList : []); - const [listMode, setListMode] = useState(bottomUtilsMode); + : bottomUtilsBaseMode === "branchOffice" ? branchOfficeUtilsList : []); + const [listMode, setListMode] = useState(bottomUtilsBaseMode); const { parentControls: portUtilsParentControls, @@ -112,17 +114,17 @@ function BottomUtils(props) { }; useEffect(() => { - if (bottomUtilsMode === "port") { + if (bottomUtilsBaseMode === "port") { setList(portUtilsList); } - else if (bottomUtilsMode === "branchOffice") { + else if (bottomUtilsBaseMode === "branchOffice") { setList(branchOfficeUtilsList); } else { setList([]); } - setListMode(bottomUtilsMode); - }, [bottomUtilsMode]); + setListMode(bottomUtilsBaseMode); + }, [bottomUtilsBaseMode]); useEffect(() => { resetAllCheck();