From 18a7123259596bda25278789656415df9b3148c9 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Mon, 20 Jul 2026 17:47:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(map):=20portIndex=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bi/index.js | 12 ++ .../Map/components/CenterUtils/index.js | 20 +-- .../Container/Map/components/Content/index.js | 4 +- .../components/Content/port/Index/index.js | 165 +++++++++++------- src/pages/Container/Map/js/context.js | 2 +- 5 files changed, 124 insertions(+), 79 deletions(-) diff --git a/src/api/bi/index.js b/src/api/bi/index.js index 3af0fa7..cfc4518 100644 --- a/src/api/bi/index.js +++ b/src/api/bi/index.js @@ -44,3 +44,15 @@ export const getKeyProjectLargeScreenStatistics = declareRequest( "indexInfoKeyProjectLoading", "Post > @/keyProject/keyProject/largeScreenStatistics", ); +export const getRiskPointCorpRiskLevel = declareRequest( + "portIndexRiskLoading", + "Post > @/risk/riskPoint/corpRiskLevel", +); +export const getCorpInfoCorpUserSummary = declareRequest( + "portIndexBasicInfoSummaryLoading", + "Post > @/basicInfo/corpInfo/corpUserSummary", +); +export const getCorpInfoCorpUserStatisticPage = declareRequest( + "portIndexBasicInfoStatisticPageLoading", + "Post > @/basicInfo/corpInfo/corpUserStatisticPage", +); diff --git a/src/pages/Container/Map/components/CenterUtils/index.js b/src/pages/Container/Map/components/CenterUtils/index.js index ec45c59..b492429 100644 --- a/src/pages/Container/Map/components/CenterUtils/index.js +++ b/src/pages/Container/Map/components/CenterUtils/index.js @@ -1,5 +1,5 @@ import { AnimatePresence, motion } from "motion/react"; -import { useContext, useState } from "react"; +import { useContext } from "react"; import statisticsTitleImg from "~/assets/images/map_bi/center_utils/statistics_title.png"; import guangImg from "~/assets/images/map_bi/center_utils/tabguang.png"; import tabLeftImg from "~/assets/images/map_bi/center_utils/tableft.png"; @@ -43,24 +43,22 @@ const statisticAnimation = { }; function CenterUtils() { - const { currentPort, currentBranchOffice, pureMap, mapMethods, actions } = useContext(Context); + const { currentPort, currentBranchOffice, pureMap, mapMethods, actions, portArea } = useContext(Context); const list = [ { label: "秦皇岛西", portArea: 3 }, { label: "秦皇岛港区", portArea: 1 }, { label: "秦皇岛东", portArea: 2 }, ]; - const [activePortArea, setActivePortArea] = useState(1); const isVisible = currentPort === "00003" && !currentBranchOffice && !pureMap; - const onChangePortArea = (portArea) => { - if (portArea === activePortArea) + const onChangePortArea = (currentSelectPortArea) => { + if (portArea === currentSelectPortArea) return; - setActivePortArea(portArea); - actions.setPortArea(portArea); + actions.setPortArea(currentSelectPortArea); mapMethods.current.removeBranchOfficePoint(); - mapMethods.current.addBranchOfficePoint(portArea); + mapMethods.current.addBranchOfficePoint(currentSelectPortArea); actions.resetBottomUtils(); }; @@ -79,7 +77,7 @@ function CenterUtils() { key={index} className={`option option${index}`} style={{ - backgroundImage: `url(${activePortArea === item.portArea + backgroundImage: `url(${portArea === item.portArea ? [tabLeftOnImg, tabMidOnImg, tabRightOnImg][index] : [tabLeftImg, tabMidImg, tabRightImg][index]})`, }} @@ -91,7 +89,7 @@ function CenterUtils() {