refactor(map): branchOffice IndexLeft RiskHazardPanel 对接
parent
297714ce08
commit
f4427ab0e3
|
|
@ -132,3 +132,7 @@ export const getPrimeportClosedAreaPersonApplyScreenList = declareRequest(
|
|||
"getPrimeportClosedAreaPersonApplyScreenListLoading",
|
||||
"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 { Context } from "~/pages/Container/Map/js/context";
|
||||
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 = {
|
||||
重大风险: "#ff0000",
|
||||
较大风险: "#ff3c00",
|
||||
一般风险: "#e5e72f",
|
||||
低风险: "#0e7dfa",
|
||||
levelA: "#ff0000",
|
||||
levelB: "#ff3c00",
|
||||
levelC: "#e5e72f",
|
||||
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 (
|
||||
<Panel title="风险点隐患" className="branch-office-index-left__risk-hazard">
|
||||
<div className="branch-office-risk-hazard__content">
|
||||
{records.map((item) => {
|
||||
const color = levelColor[item.levelName];
|
||||
{data.map((item) => {
|
||||
const color = levelColor[item.level];
|
||||
return (
|
||||
<div
|
||||
className="branch-office-risk-hazard__item"
|
||||
|
|
@ -40,13 +50,16 @@ function RiskHazardPanel() {
|
|||
<div className="branch-office-risk-hazard__info">
|
||||
<div>
|
||||
风险点数:
|
||||
{item.riskCount}
|
||||
{item.riskPointCount}
|
||||
</div>
|
||||
<div className="branch-office-risk-hazard__details">
|
||||
<div>检查覆盖率:100%</div>
|
||||
<div>
|
||||
检查覆盖率:
|
||||
{item.checkCoverRate}
|
||||
</div>
|
||||
<div>
|
||||
未覆盖风险点数:
|
||||
{item.notRiskCount}
|
||||
{item.uncoveredRiskPointCount}
|
||||
</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