refactor(map): branchOffice IndexLeft RiskHazardPanel 对接
parent
297714ce08
commit
f4427ab0e3
|
|
@ -132,3 +132,7 @@ export const getPrimeportClosedAreaPersonApplyScreenList = declareRequest(
|
||||||
"getPrimeportClosedAreaPersonApplyScreenListLoading",
|
"getPrimeportClosedAreaPersonApplyScreenListLoading",
|
||||||
"Post > @/primeport/closedAreaPersonApply/screenList",
|
"Post > @/primeport/closedAreaPersonApply/screenList",
|
||||||
);
|
);
|
||||||
|
export const getRiskPointHidden = declareRequest(
|
||||||
|
"getRiskPointHiddenLoading",
|
||||||
|
"Post > @/risk/listManager/riskPointHidden",
|
||||||
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,37 @@
|
||||||
|
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 = {
|
||||||
重大风险: "#ff0000",
|
levelA: "#ff0000",
|
||||||
较大风险: "#ff3c00",
|
levelB: "#ff3c00",
|
||||||
一般风险: "#e5e72f",
|
levelC: "#e5e72f",
|
||||||
低风险: "#0e7dfa",
|
levelD: "#0e7dfa",
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 负责展示不同风险等级的风险点与隐患覆盖情况。 */
|
/** 负责展示不同风险等级的风险点与隐患覆盖情况。 */
|
||||||
function RiskHazardPanel() {
|
function RiskHazardPanel(props) {
|
||||||
|
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">
|
||||||
{records.map((item) => {
|
{data.map((item) => {
|
||||||
const color = levelColor[item.levelName];
|
const color = levelColor[item.level];
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="branch-office-risk-hazard__item"
|
className="branch-office-risk-hazard__item"
|
||||||
|
|
@ -40,13 +50,16 @@ function RiskHazardPanel() {
|
||||||
<div className="branch-office-risk-hazard__info">
|
<div className="branch-office-risk-hazard__info">
|
||||||
<div>
|
<div>
|
||||||
风险点数:
|
风险点数:
|
||||||
{item.riskCount}
|
{item.riskPointCount}
|
||||||
</div>
|
</div>
|
||||||
<div className="branch-office-risk-hazard__details">
|
<div className="branch-office-risk-hazard__details">
|
||||||
<div>检查覆盖率:100%</div>
|
<div>
|
||||||
|
检查覆盖率:
|
||||||
|
{item.checkCoverRate}
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
未覆盖风险点数:
|
未覆盖风险点数:
|
||||||
{item.notRiskCount}
|
{item.uncoveredRiskPointCount}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -58,4 +71,4 @@ function RiskHazardPanel() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default RiskHazardPanel;
|
export default Connect([NS_BI_STATISTICS], true)(RiskHazardPanel);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue