refactor(biStatistics): 统一更新biStatistics请求loading状态命名

master
LiuJiaNan 2026-07-22 16:13:47 +08:00
parent 405c4f74bc
commit a6b57a2473
18 changed files with 65 additions and 83 deletions

View File

@ -1,82 +1,82 @@
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
export const getWeather = declareRequest(
"indexInfoWeatherLoading",
"getWeatherLoading",
"Get > /bi/weather/info",
);
export const getEventReportListUnfinished = declareRequest(
"indexInfoEmergencyRescueLoading",
"getEventReportListUnfinishedLoading",
"Post > @/emergencyRescue/eventReport/listUnfinished",
);
export const getProjectTaskScoreCount = declareRequest(
"indexInfoDomainLoading",
"getProjectTaskScoreCountLoading",
"Get > /domain/projectTask/scoreCount",
);
export const getHiddenStatisticsByCorp = declareRequest(
"indexInfoHiddenLoading",
"getHiddenStatisticsByCorpLoading",
"Post > @/hidden/hidden/statisticsByCorp",
);
export const getXgfStatisticsListCorpStatistics = declareRequest(
"indexInfoXgfManagerLoading",
"getXgfStatisticsListCorpStatisticsLoading",
"Post > @/xgfManager/xgfStatistics/listCorpStatistics",
);
export const getAlarmRecordScreenIotDeviceAlarmPage = declareRequest(
"indexInfoIotalarmLoading",
"getAlarmRecordScreenIotDeviceAlarmPageLoading",
"Post > @/iotalarm/alarmRecord/screenIotDeviceAlarmPage",
);
export const getXgfStatisticsListRecordProjectStatistics = declareRequest(
"indexInfoXgfManagerProjectLoading",
"getXgfStatisticsListRecordProjectStatisticsLoading",
"Get > /xgfManager/xgfStatistics/listRecordProjectStatistics",
);
export const getFixedCameraVideoList = declareRequest(
"indexInfoVideoPatrolLoading",
"getFixedCameraVideoListLoading",
"Post > @/videopatrol/fixedCamera/getVideoList",
);
export const getFixedCameraPlayUrl = declareRequest(
"indexInfoVideoPatrolUrlLoading",
"getFixedCameraPlayUrlLoading",
"Get > /videopatrol/fixedCamera/getPlayUrl",
);
export const getEightWorkInfoDangerWorkStatistics = declareRequest(
"indexInfoEightWorkLoading",
"getEightWorkInfoDangerWorkStatisticsLoading",
"Post > @/eightwork/eightworkInfo/dangerWorkStatistics",
);
export const getKeyProjectLargeScreenStatistics = declareRequest(
"indexInfoKeyProjectLoading",
"getKeyProjectLargeScreenStatisticsLoading",
"Post > @/keyProject/keyProject/largeScreenStatistics",
);
export const getRiskPointCorpRiskLevel = declareRequest(
"portIndexRiskLoading",
"getRiskPointCorpRiskLevelLoading",
"Post > @/risk/riskPoint/corpRiskLevel",
);
export const getCorpInfoCorpUserSummary = declareRequest(
"portIndexBasicInfoSummaryLoading",
"getCorpInfoCorpUserSummaryLoading",
"Post > @/basicInfo/corpInfo/corpUserSummary",
);
export const getCorpInfoCorpUserStatisticPage = declareRequest(
"portIndexBasicInfoStatisticPageLoading",
"getCorpInfoCorpUserStatisticPageLoading",
"Post > @/basicInfo/corpInfo/corpUserStatisticPage",
);
export const getFirePointDeviceList = declareRequest(
"portXiaoFangFirePointDeviceListLoading",
"getFirePointDeviceListLoading",
"Post > @/fireCheck/firePoint/deviceList",
);
export const getEightWorkInfoScreenStatusStatistics = declareRequest(
"portWeiXianEightWorkInfoScreenStatusStatisticsLoading",
"getEightWorkInfoScreenStatusStatisticsLoading",
"Post > @/eightwork/eightworkInfo/screenStatusStatistics",
);
export const getEightWorkInfoScreenWorkRecord = declareRequest(
"portWeiXianEightWorkInfoScreenWorkRecordLoading",
"getEightWorkInfoScreenWorkRecordLoading",
"Post > @/eightwork/eightworkInfo/screenWorkRecord",
);
export const getEightWorkInfoScreenWorkTrend = declareRequest(
"portWeiXianEightWorkInfoScreenWorkTrendLoading",
"getEightWorkInfoScreenWorkTrendLoading",
"Post > @/eightwork/eightworkInfo/screenWorkTrend",
);
export const getKeyProjectLargeScreenProjectStatistics = declareRequest(
"portZhongDianKeyProjectLargeScreenProjectStatisticsLoading",
"getKeyProjectLargeScreenProjectStatisticsLoading",
"Post > @/keyProject/keyProject/largeScreenProjectStatistics",
);
export const getFixedCameraVideoLocationStat = declareRequest(
"portZhongDianFixedCameraVideoLocationStatLoading",
"getFixedCameraVideoLocationStatLoading",
"Post > @/videopatrol/fixedCamera/getVideoLocationStat",
);

View File

@ -23,7 +23,7 @@ function RecordStatsPanel(props) {
title="相关方单位备案与项目执行统计"
className="index-info-bottom__record-stats"
>
<Spin spinning={props.biStatistics.indexInfoXgfManagerProjectLoading}>
<Spin spinning={props.biStatistics.getXgfStatisticsListRecordProjectStatisticsLoading}>
<div
className="index-info-record-stats__table"
style={{ backgroundImage: `url(${background})` }}

View File

@ -47,7 +47,7 @@ function VideoPatrolPanel(props) {
return (
<Panel title="视频巡屏" className="index-info-bottom__video-patrol">
<div className="index-info-video-patrol__content">
<Spin spinning={props.biStatistics.indexInfoVideoPatrolLoading}>
<Spin spinning={props.biStatistics.getFixedCameraVideoListLoading}>
<div className="index-info-video-patrol__menu">
{list.map(item => (
<div
@ -64,12 +64,7 @@ function VideoPatrolPanel(props) {
className="index-info-video-patrol__screen"
style={{ backgroundImage: `url(${background})` }}
>
<Spin
spinning={
props.biStatistics.indexInfoVideoPatrolLoading
|| props.biStatistics.indexInfoVideoPatrolUrlLoading
}
>
<Spin spinning={props.biStatistics.getFixedCameraVideoListLoading || props.biStatistics.getFixedCameraPlayUrlLoading}>
{playUrl
? (
<AliPlayer source={playUrl} height="100%" isLive />

View File

@ -27,7 +27,7 @@ function RectificationPanel(props) {
title="当前各公司隐患整改情况"
className="index-info-left-panel__rectification"
>
<Spin spinning={props.biStatistics.indexInfoHiddenLoading}>
<Spin spinning={props.biStatistics.getHiddenStatisticsByCorpLoading}>
<div className="index-info-rectification__table">
<div
className="index-info-rectification__header"

View File

@ -32,7 +32,7 @@ function WeatherPanel(props) {
return (
<Panel title="天气预报情况" className="index-info-left-panel__weather">
<Spin spinning={props.biStatistics.indexInfoWeatherLoading}>
<Spin spinning={props.biStatistics.getWeatherLoading}>
<div className="index-info-weather__summary">
<div className="index-info-weather__condition">
<img src={getWeatherIcon(weather.text)} alt="" />
@ -57,7 +57,7 @@ function WeatherPanel(props) {
{weather.alertTitle || "天气数据加载失败"}
</div>
</Spin>
<Spin spinning={props.biStatistics.indexInfoEmergencyRescueLoading}>
<Spin spinning={props.biStatistics.getEventReportListUnfinishedLoading}>
<div className="index-info-weather__table">
<div
className="index-info-weather__table-header"

View File

@ -150,7 +150,7 @@ function WorkStatusPanel(props) {
title="领域工作情况统计"
className="index-info-left-panel__work-status"
>
<Spin spinning={props.biStatistics.indexInfoDomainLoading}>
<Spin spinning={props.biStatistics.getProjectTaskScoreCountLoading}>
<div ref={chartRef} className="index-info-work-status__chart" />
</Spin>
</Panel>

View File

@ -21,7 +21,7 @@ function AlarmPanel(props) {
}, []);
return (
<Panel title="物联网设备报警情况" className="index-info-right-panel__alarm">
<Spin spinning={props.biStatistics.indexInfoIotalarmLoading}>
<Spin spinning={props.biStatistics.getAlarmRecordScreenIotDeviceAlarmPageLoading}>
<div className="index-info-alarm__table">
<div
className="index-info-alarm__header"

View File

@ -24,7 +24,7 @@ function PartnerPanel(props) {
title="相关方单位情况统计"
className="index-info-right-panel__partner"
>
<Spin spinning={props.biStatistics.indexInfoXgfManagerLoading}>
<Spin spinning={props.biStatistics.getXgfStatisticsListCorpStatisticsLoading}>
<div className="index-info-partner__table">
<div
className="index-info-partner__header"

View File

@ -52,7 +52,7 @@ function WorkPanel(props) {
}, []);
return (
<Panel title="重点作业管理统计" className="index-info-right-panel__work">
<Spin spinning={props.biStatistics.indexInfoEightWorkLoading || props.biStatistics.indexInfoKeyProjectLoading}>
<Spin spinning={props.biStatistics.getEightWorkInfoDangerWorkStatisticsLoading || props.biStatistics.getKeyProjectLargeScreenStatisticsLoading}>
<div className="index-info-work__list">
{list.map(item => (
<div className="index-info-work__item" key={item.name}>

View File

@ -44,7 +44,7 @@ function BasicInfoPanel(props) {
return (
<Panel title="单位基础信息" className="port-index__basic-info">
<Spin spinning={props.biStatistics.portIndexBasicInfoSummaryLoading}>
<Spin spinning={props.biStatistics.getCorpInfoCorpUserSummaryLoading}>
<div className="port-basic-info__options">
{statistics.map(item => (
<div key={item.label} className="port-basic-info__option">

View File

@ -64,7 +64,7 @@ function PersonnelStatsPanel(props) {
<div className="port-personnel-stats__cell">人员数</div>
</div>
<div className="port-personnel-stats__table-body">
<Spin spinning={props.biStatistics.portIndexBasicInfoStatisticPageLoading}>
<Spin spinning={props.biStatistics.getCorpInfoCorpUserStatisticPageLoading}>
{isVisible && (
<SeamlessScroll list={statistics} step={0.5}>
{statistics.map((item, index) => (

View File

@ -69,7 +69,7 @@ function RiskStatsPanel(props) {
return (
<Panel title="风险区域统计" className="port-index__risk-stats">
<Spin spinning={props.biStatistics.portIndexRiskLoading}>
<Spin spinning={props.biStatistics.getRiskPointCorpRiskLevelLoading}>
<div className="port-risk-stats__options">
{statistics.map(item => (
<div key={item.level} className="port-risk-stats__option">

View File

@ -1,4 +1,5 @@
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";
@ -37,6 +38,7 @@ function WorkRecordPanel(props) {
<div className="port-danger-work-record__cell">下一步操作人</div>
</div>
<div className="port-danger-work-record__table-body">
<Spin spinning={props.biStatistics.getEightWorkInfoScreenWorkRecordLoading}>
<SeamlessScroll list={records} step={0.5}>
{records.map((item, index) => (
<div key={index} className="port-danger-work-record__row">
@ -59,6 +61,7 @@ function WorkRecordPanel(props) {
</div>
))}
</SeamlessScroll>
</Spin>
</div>
</div>
</div>

View File

@ -46,14 +46,9 @@ function WorkStatusPanel(props) {
return (
<Panel title="安全作业状态统计" className="port-danger-work__status">
<Spin
spinning={
props.biStatistics
.portWeiXianEightWorkInfoScreenStatusStatisticsLoading
}
>
<Spin spinning={props.biStatistics.getEightWorkInfoScreenStatusStatisticsLoading}>
<div className="port-danger-work-status__options">
{statistics.map((item) => (
{statistics.map(item => (
<div key={item.label} className="port-danger-work-status__option">
<div
className="port-danger-work-status__icon"
@ -65,7 +60,9 @@ function WorkStatusPanel(props) {
className="port-danger-work-status__label"
style={{ backgroundImage: `url(${labelBackground})` }}
>
{item.label}<CountUp end={+item.count} />
{item.label}
<CountUp end={+item.count} />
</div>
</div>
))}

View File

@ -128,11 +128,7 @@ function WorkTrendPanel(props) {
return (
<Panel title="安全作业情况统计" className="port-danger-work__trend">
<div className="port-danger-work-trend__content">
<Spin
spinning={
props.biStatistics.portWeiXianEightWorkInfoScreenWorkTrendLoading
}
>
<Spin spinning={props.biStatistics.getEightWorkInfoScreenWorkTrendLoading}>
<div ref={chartRef} className="port-danger-work-trend__chart" />
</Spin>
</div>

View File

@ -40,7 +40,7 @@ function FireDeviceListPanel(props) {
<div className="port-fire-device-list__cell">数量</div>
</div>
<div className="port-fire-device-list__table-body">
<Spin spinning={props.biStatistics.portXiaoFangFirePointDeviceListLoading}>
<Spin spinning={props.biStatistics.getFirePointDeviceListLoading}>
{isVisible && (
<SeamlessScroll list={deviceList} step={0.5}>
{deviceList.map((item, index) => (

View File

@ -40,12 +40,7 @@ function KeyProjectPanel(props) {
return (
<Panel title="重点工程" className="port-key-supervision__project">
<Spin
spinning={
props.biStatistics
.portZhongDianKeyProjectLargeScreenProjectStatisticsLoading
}
>
<Spin spinning={props.biStatistics.getKeyProjectLargeScreenProjectStatisticsLoading}>
<div className="port-key-project__options">
{statistics.map(item => (
<div key={item.label} className="port-key-project__option">

View File

@ -38,11 +38,7 @@ function VideoLocationPanel(props) {
return (
<Panel title="视频定位" className="port-key-supervision__video-location">
<Spin
spinning={
props.biStatistics.portZhongDianFixedCameraVideoLocationStatLoading
}
>
<Spin spinning={props.biStatistics.getFixedCameraVideoLocationStatLoading}>
<div className="port-video-location__options">
<div className="port-video-location__option">
<div