diff --git a/src/api/biStatistics/index.js b/src/api/biStatistics/index.js index 42a0f7e..f698638 100644 --- a/src/api/biStatistics/index.js +++ b/src/api/biStatistics/index.js @@ -12,9 +12,9 @@ export const getProjectTaskScoreCount = declareRequest( "getProjectTaskScoreCountLoading", "Get > /domain/projectTask/scoreCount", ); -export const getHiddenStatisticsByCorp = declareRequest( - "getHiddenStatisticsByCorpLoading", - "Post > @/hidden/hidden/statisticsByCorp", +export const getHiddenStatisticsByPortArea = declareRequest( + "getHiddenStatisticsByPortAreaLoading", + "Post > @/hidden/hidden/statisticsByPortArea", ); export const getXgfStatisticsListCorpStatistics = declareRequest( "getXgfStatisticsListCorpStatisticsLoading", @@ -120,3 +120,15 @@ export const getPrimeportMkmjStatistics = declareRequest( "getPrimeportMkmjStatisticsLoading", "Get > /primeport/mkmj/statistics", ); +export const getPrimeportClosedAreaCorpStat = declareRequest( + "getPrimeportClosedAreaCorpStatLoading", + "Post > @/primeport/closedArea/corpStat", +); +export const getPrimeportClosedAreaCarApplyScreenList = declareRequest( + "getPrimeportClosedAreaCarApplyScreenListLoading", + "Post > @/primeport/closedAreaCarApply/screenList", +); +export const getPrimeportClosedAreaPersonApplyScreenList = declareRequest( + "getPrimeportClosedAreaPersonApplyScreenListLoading", + "Post > @/primeport/closedAreaPersonApply/screenList", +); diff --git a/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/RectificationPanel/index.js b/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/RectificationPanel/index.js index 890b22d..3770be3 100644 --- a/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/RectificationPanel/index.js +++ b/src/pages/Container/Map/components/Content/IndexInfo/LeftPanel/RectificationPanel/index.js @@ -13,7 +13,7 @@ function RectificationPanel(props) { const [data, setData] = useState([]); useEffect(() => { const loadData = async () => { - const { data = [] } = await props.getHiddenStatisticsByCorp({ + const { data = [] } = await props.getHiddenStatisticsByPortArea({ pageIndex: 1, pageSize: 9999, }); @@ -27,7 +27,7 @@ function RectificationPanel(props) { title="当前各公司隐患整改情况" className="index-info-left-panel__rectification" > - +
{ + const loadData = async () => { + const { data = {} } = await props.getPrimeportClosedAreaCorpStat({ portArea, corpinfoId: currentBranchOffice }); + + setData(statistics.map(item => ({ + ...item, + count: item.field ? data[item.field] || 0 : item.count, + }))); + }; + + loadData(); + }, []); + return ( -
- {records.map(item => ( -
-
- -
-
-
- {item.label} + +
+ {data.map(item => ( +
+
+
-
- +
+
+ {item.label} +
+
+ +
+ + + +
- - - - -
- ))} -
+ ))} +
+ ); } @@ -52,4 +76,4 @@ function Corner({ className }) { ); } -export default ClosedAreaStatsPanel; +export default Connect([NS_BI_STATISTICS], true)(ClosedAreaStatsPanel); diff --git a/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js b/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js index a8bcfc2..7e59c83 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js +++ b/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.js @@ -1,75 +1,45 @@ -import { useState } from "react"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Spin } from "antd"; +import { useContext, useEffect, useState } from "react"; import SeamlessScroll from "zy-react-library/components/SeamlessScroll"; +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 tabs = ["人员", "车辆"]; -const records = [ - { - permissionRange: "A区", - status: "1", - applicant: "张三", - approver: "李主管", - }, - { - permissionRange: "B区", - status: "1", - applicant: "李四", - approver: "王经理", - }, - { - permissionRange: "C区", - status: "1", - applicant: "王五", - approver: "赵主任", - }, - { - permissionRange: "D区", - status: "0", - applicant: "赵六", - approver: "钱总监", - }, - { - permissionRange: "E区", - status: "0", - applicant: "钱七", - approver: "孙部长", - }, - { - permissionRange: "F区", - status: "0", - applicant: "孙八", - approver: "周经理", - }, - { - permissionRange: "G区", - status: "0", - applicant: "周九", - approver: "吴主任", - }, - { - permissionRange: "H区", - status: "1", - applicant: "吴十", - approver: "郑主管", - }, - { - permissionRange: "I区", - status: "0", - applicant: "郑一", - approver: "王总监", - }, - { - permissionRange: "J区", - status: "1", - applicant: "王二", - approver: "张部长", - }, -]; /** 负责展示口门申请记录及人员、车辆分类标签状态。 */ -function GateApplicationPanel() { +function GateApplicationPanel(props) { + const { portArea, currentBranchOffice } = useContext(Context); + const [activeIndex, setActiveIndex] = useState(0); + const [data, setData] = useState([]); + const [isVisible, setIsVisible] = useState(false); + + const loadData = async (activeIndex) => { + setIsVisible(false); + const { data = [] } = await props[activeIndex === 1 ? "getPrimeportClosedAreaCarApplyScreenList" : "getPrimeportClosedAreaPersonApplyScreenList"]({ + pageIndex: 1, + pageSize: 9999, + portArea, + corpinfoId: currentBranchOffice, + }); + setData(data); + setIsVisible(true); + }; + + const handleTabClick = (index) => { + if (index === activeIndex) + return; + + setActiveIndex(index); + loadData(index); + }; + + useEffect(() => { + loadData(activeIndex); + }, []); return ( setActiveIndex(index)} + onClick={() => handleTabClick(index)} > {item}
@@ -92,29 +62,29 @@ function GateApplicationPanel() {
-
权限范围
-
申请类型
申请人
-
审批人
+
申请口门
+
开始时间
+
结束时间
- - {records.map((item, index) => ( -
-
{item.permissionRange}
-
- {item.status === "1" ? "临时" : "长期"} -
-
{item.applicant}
-
{item.approver}
-
- ))} -
+ + {isVisible && ( + + {data.map((item, index) => ( +
+
{item.applyUserName}
+
{item.levelOneMkmjName}
+
{item.visitStartTime}
+
{item.visitEndTime}
+
+ ))} +
+ )} +
@@ -122,4 +92,4 @@ function GateApplicationPanel() { ); } -export default GateApplicationPanel; +export default Connect([NS_BI_STATISTICS], true)(GateApplicationPanel); diff --git a/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.less b/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.less index 622ee7b..9ba99c0 100644 --- a/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.less +++ b/src/pages/Container/Map/components/Content/branchOffice/MenJin/GateApplicationPanel/index.less @@ -36,7 +36,7 @@ background-color: rgba(42, 86, 158, 0.53); } -.branch-office-gate-application__body +.branch-office-gate-application__body, .branch-office-gate-application__row:nth-child(odd) { background-color: transparent; } @@ -47,7 +47,3 @@ font-size: 12px; text-align: center; } - -.branch-office-gate-application__row .branch-office-gate-application__type--1 { - color: #fc6b13; -} diff --git a/src/pages/Container/Map/components/Content/port/MenJin/GateStatsPanel/index.js b/src/pages/Container/Map/components/Content/port/MenJin/GateStatsPanel/index.js index 1ecd6f8..98ddf61 100644 --- a/src/pages/Container/Map/components/Content/port/MenJin/GateStatsPanel/index.js +++ b/src/pages/Container/Map/components/Content/port/MenJin/GateStatsPanel/index.js @@ -1,4 +1,5 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Spin } from "antd"; import { useContext, useEffect, useState } from "react"; import gateIcon from "~/assets/images/map_bi/content/img7.png"; import barrierIcon from "~/assets/images/map_bi/content/img8.png"; @@ -40,27 +41,29 @@ function GateStatsPanel(props) { return ( -
- {data.map((item, index) => ( -
- -
-
- 口门数: - {item.gateCount} -
-
- 车闸机数: - {item.vehicleGateCount} -
-
- 人闸机数: - {item.peopleGateCount} + +
+ {data.map((item, index) => ( +
+ +
+
+ 口门数: + {item.gateCount} +
+
+ 车闸机数: + {item.vehicleGateCount} +
+
+ 人闸机数: + {item.peopleGateCount} +
-
- ))} -
+ ))} +
+ ); }