Compare commits
No commits in common. "f4427ab0e333a7b0a9527b3ad5f34bdd19941536" and "f23b8d0f0d980843fe4d70fb64873b55f8d42a6b" have entirely different histories.
f4427ab0e3
...
f23b8d0f0d
|
|
@ -132,7 +132,3 @@ export const getPrimeportClosedAreaPersonApplyScreenList = declareRequest(
|
||||||
"getPrimeportClosedAreaPersonApplyScreenListLoading",
|
"getPrimeportClosedAreaPersonApplyScreenListLoading",
|
||||||
"Post > @/primeport/closedAreaPersonApply/screenList",
|
"Post > @/primeport/closedAreaPersonApply/screenList",
|
||||||
);
|
);
|
||||||
export const getRiskPointHidden = declareRequest(
|
|
||||||
"getRiskPointHiddenLoading",
|
|
||||||
"Post > @/risk/listManager/riskPointHidden",
|
|
||||||
);
|
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,27 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|
||||||
import { useContext, useEffect, useState } from "react";
|
|
||||||
import { NS_BI_STATISTICS } from "~/enumerate/namespace";
|
|
||||||
import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel";
|
import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel";
|
||||||
import { Context } from "~/pages/Container/Map/js/context";
|
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
|
const records = [
|
||||||
|
{ levelName: "重大风险", riskCount: 21, notRiskCount: 3 },
|
||||||
|
{ levelName: "较大风险", riskCount: 21, notRiskCount: 3 },
|
||||||
|
{ levelName: "一般风险", riskCount: 21, notRiskCount: 3 },
|
||||||
|
{ levelName: "低风险", riskCount: 21, notRiskCount: 3 },
|
||||||
|
];
|
||||||
|
|
||||||
const levelColor = {
|
const levelColor = {
|
||||||
levelA: "#ff0000",
|
重大风险: "#ff0000",
|
||||||
levelB: "#ff3c00",
|
较大风险: "#ff3c00",
|
||||||
levelC: "#e5e72f",
|
一般风险: "#e5e72f",
|
||||||
levelD: "#0e7dfa",
|
低风险: "#0e7dfa",
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 负责展示不同风险等级的风险点与隐患覆盖情况。 */
|
/** 负责展示不同风险等级的风险点与隐患覆盖情况。 */
|
||||||
function RiskHazardPanel(props) {
|
function RiskHazardPanel() {
|
||||||
const { portArea, currentBranchOffice } = useContext(Context);
|
|
||||||
const [data, setData] = useState([]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const loadData = async () => {
|
|
||||||
const { data } = await props.getRiskPointHidden({ portArea, corpinfoId: currentBranchOffice });
|
|
||||||
|
|
||||||
setData(data);
|
|
||||||
};
|
|
||||||
|
|
||||||
loadData();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Panel title="风险点隐患" className="branch-office-index-left__risk-hazard">
|
<Panel title="风险点隐患" className="branch-office-index-left__risk-hazard">
|
||||||
<div className="branch-office-risk-hazard__content">
|
<div className="branch-office-risk-hazard__content">
|
||||||
{data.map((item) => {
|
{records.map((item) => {
|
||||||
const color = levelColor[item.level];
|
const color = levelColor[item.levelName];
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="branch-office-risk-hazard__item"
|
className="branch-office-risk-hazard__item"
|
||||||
|
|
@ -50,16 +40,13 @@ function RiskHazardPanel(props) {
|
||||||
<div className="branch-office-risk-hazard__info">
|
<div className="branch-office-risk-hazard__info">
|
||||||
<div>
|
<div>
|
||||||
风险点数:
|
风险点数:
|
||||||
{item.riskPointCount}
|
{item.riskCount}
|
||||||
</div>
|
</div>
|
||||||
<div className="branch-office-risk-hazard__details">
|
<div className="branch-office-risk-hazard__details">
|
||||||
<div>
|
<div>检查覆盖率:100%</div>
|
||||||
检查覆盖率:
|
|
||||||
{item.checkCoverRate}
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
未覆盖风险点数:
|
未覆盖风险点数:
|
||||||
{item.uncoveredRiskPointCount}
|
{item.notRiskCount}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -71,4 +58,4 @@ function RiskHazardPanel(props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Connect([NS_BI_STATISTICS], true)(RiskHazardPanel);
|
export default RiskHazardPanel;
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,11 @@ const headerAnimation = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function Header() {
|
function Header() {
|
||||||
const { currentPort, currentBranchOffice, mapMethods, portArea, headerTitle, actions, closePopup } = useContext(Context);
|
const { currentPort, currentBranchOffice, mapMethods, portArea, headerTitle, actions } = useContext(Context);
|
||||||
|
|
||||||
const isPortTitle = headerTitle === "秦港股份安全监管平台";
|
const isPortTitle = headerTitle === "秦港股份安全监管平台";
|
||||||
|
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
closePopup();
|
|
||||||
sessionStorage.removeItem("mapCurrentBranchOfficeId");
|
sessionStorage.removeItem("mapCurrentBranchOfficeId");
|
||||||
if (!currentPort) {
|
if (!currentPort) {
|
||||||
window.close();
|
window.close();
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ const BranchOffice = ({ info, close, enter }) => {
|
||||||
<div className="data-label textColor">地址:</div>
|
<div className="data-label textColor">地址:</div>
|
||||||
<div className="data-value">
|
<div className="data-value">
|
||||||
<span className="label-num textColor line-3">
|
<span className="label-num textColor line-3">
|
||||||
{info?.addressBusiness}
|
{info?.address}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import "./index.less";
|
||||||
|
|
||||||
function Map(props) {
|
function Map(props) {
|
||||||
const query = useGetUrlQuery();
|
const query = useGetUrlQuery();
|
||||||
const { viewer, mapMethods, initMap, externalEntryPort, closePopup } = useInitMap({
|
const { viewer, mapMethods, initMap, externalEntryPort } = useInitMap({
|
||||||
request: {
|
request: {
|
||||||
getCorpInfoListAll: props.getCorpInfoListAll,
|
getCorpInfoListAll: props.getCorpInfoListAll,
|
||||||
},
|
},
|
||||||
|
|
@ -108,8 +108,8 @@ function Map(props) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const providerValues = useMemo(
|
const providerValues = useMemo(
|
||||||
() => ({ viewer, mapMethods, closePopup, ...state, actions }),
|
() => ({ viewer, mapMethods, ...state, actions }),
|
||||||
[viewer, mapMethods, closePopup, state, actions],
|
[viewer, mapMethods, state, actions],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ export default function useInitMap(options) {
|
||||||
mapMethods.current = mapMethodsValue;
|
mapMethods.current = mapMethodsValue;
|
||||||
// 点位点击处理集合:替代原 PointClickEvent class 实例,负责弹窗和层级进入。
|
// 点位点击处理集合:替代原 PointClickEvent class 实例,负责弹窗和层级进入。
|
||||||
const pointClickEvent = usePointClickEvent(viewer, mapMethodsValue);
|
const pointClickEvent = usePointClickEvent(viewer, mapMethodsValue);
|
||||||
// Cesium 点击事件只在初始化时注册,必须始终使用首次创建的处理器,才能关闭其维护的 Popup 实例。
|
|
||||||
const pointClickEventRef = useRef(pointClickEvent);
|
|
||||||
|
|
||||||
// 获取当前 Cesium 实例,减少内部方法对 ref 结构的重复感知。
|
// 获取当前 Cesium 实例,减少内部方法对 ref 结构的重复感知。
|
||||||
const getViewer = () => viewer.current;
|
const getViewer = () => viewer.current;
|
||||||
|
|
@ -58,10 +56,10 @@ export default function useInitMap(options) {
|
||||||
screenSpaceEventHandler.setInputAction((movement) => {
|
screenSpaceEventHandler.setInputAction((movement) => {
|
||||||
const pick = getViewer().scene.pick(movement.position);
|
const pick = getViewer().scene.pick(movement.position);
|
||||||
if (Cesium.defined(pick) && pick.id?.id) {
|
if (Cesium.defined(pick) && pick.id?.id) {
|
||||||
pointClickEventRef.current.pointClickEvent(pick.id);
|
pointClickEvent.pointClickEvent(pick.id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pointClickEventRef.current.closePopup();
|
pointClickEvent.closePopup();
|
||||||
}
|
}
|
||||||
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
||||||
};
|
};
|
||||||
|
|
@ -145,7 +143,7 @@ export default function useInitMap(options) {
|
||||||
if (!id || !name || !hasValidPosition)
|
if (!id || !name || !hasValidPosition)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
pointClickEventRef.current.pointClickEvent({
|
pointClickEvent.pointClickEvent({
|
||||||
monitorItems: {
|
monitorItems: {
|
||||||
data: {
|
data: {
|
||||||
...data,
|
...data,
|
||||||
|
|
@ -166,6 +164,5 @@ export default function useInitMap(options) {
|
||||||
mapMethods,
|
mapMethods,
|
||||||
initMap,
|
initMap,
|
||||||
externalEntryPort,
|
externalEntryPort,
|
||||||
closePopup: () => pointClickEventRef.current.closePopup(),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue