feat(biStatistics): 新增人员与车辆出入统计接口并优化入口出趋势面板
- 新增 getScreenPersonInOutStat 和 getScreenVehicleInOutStat 请求接口 - 入口出趋势面板根据选中索引动态加载人员或车辆出入数据 - 替换旧接口调用,支持人员和车辆出入数据的异步请求 - 优化加载状态显示,使用人员及车辆出入统计的加载状态控制Spin组件 - 调整数据加载参数及销毁图表逻辑,提升组件复用性和性能master
parent
6c3cac4dc1
commit
9d93b4076d
|
|
@ -216,3 +216,11 @@ export const getScreenPortPersonVehicleStat = declareRequest(
|
|||
"getScreenPortPersonVehicleStatLoading",
|
||||
"Get > /personnelPosition/bi/personLocation/portPersonVehicleStat",
|
||||
);
|
||||
export const getScreenPersonInOutStat = declareRequest(
|
||||
"getScreenPersonInOutStatLoading",
|
||||
"Post > @/primeport/closedArea/personInOutStat",
|
||||
);
|
||||
export const getScreenVehicleInOutStat = declareRequest(
|
||||
"getScreenVehicleInOutStatLoading",
|
||||
"Post > @/primeport/closedArea/vehicleInOutStat",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -161,18 +161,16 @@ function EntryExitTrendPanel(props) {
|
|||
|
||||
chartInstance.current.setOption(option);
|
||||
};
|
||||
const loadData = async (mkmjType) => {
|
||||
const { data } = await props.getScreenMkmjRecord({
|
||||
const loadData = async (index) => {
|
||||
const { data } = await props[index === 0 ? "getScreenPersonInOutStat" : "getScreenVehicleInOutStat"]({
|
||||
portArea,
|
||||
corpinfoId: currentBranchOffice,
|
||||
mkmjLevel: "2",
|
||||
mkmjType,
|
||||
});
|
||||
initEcharts(data || []);
|
||||
};
|
||||
|
||||
useMount(() => {
|
||||
loadData("1");
|
||||
loadData(activeIndex);
|
||||
|
||||
return () => {
|
||||
disposeChart();
|
||||
|
|
@ -185,7 +183,7 @@ function EntryExitTrendPanel(props) {
|
|||
|
||||
disposeChart();
|
||||
setActiveIndex(index);
|
||||
loadData(index === 0 ? "1" : "2");
|
||||
loadData(index);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -207,7 +205,7 @@ function EntryExitTrendPanel(props) {
|
|||
)}
|
||||
>
|
||||
<div className={styles.branchOfficeGateTrend__content}>
|
||||
<Spin spinning={props.biStatistics.getScreenMkmjRecordLoading}>
|
||||
<Spin spinning={props.biStatistics.getScreenPersonInOutStatLoading || props.biStatistics.getScreenVehicleInOutStatLoading}>
|
||||
<div ref={chartRef} className={styles.branchOfficeGateTrend__chart} />
|
||||
</Spin>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue