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

View File

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

View File

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

View File

@ -27,7 +27,7 @@ function RectificationPanel(props) {
title="当前各公司隐患整改情况" title="当前各公司隐患整改情况"
className="index-info-left-panel__rectification" 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__table">
<div <div
className="index-info-rectification__header" className="index-info-rectification__header"

View File

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

View File

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

View File

@ -21,7 +21,7 @@ function AlarmPanel(props) {
}, []); }, []);
return ( return (
<Panel title="物联网设备报警情况" className="index-info-right-panel__alarm"> <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__table">
<div <div
className="index-info-alarm__header" className="index-info-alarm__header"

View File

@ -24,7 +24,7 @@ function PartnerPanel(props) {
title="相关方单位情况统计" title="相关方单位情况统计"
className="index-info-right-panel__partner" 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__table">
<div <div
className="index-info-partner__header" className="index-info-partner__header"

View File

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

View File

@ -44,7 +44,7 @@ function BasicInfoPanel(props) {
return ( return (
<Panel title="单位基础信息" className="port-index__basic-info"> <Panel title="单位基础信息" className="port-index__basic-info">
<Spin spinning={props.biStatistics.portIndexBasicInfoSummaryLoading}> <Spin spinning={props.biStatistics.getCorpInfoCorpUserSummaryLoading}>
<div className="port-basic-info__options"> <div className="port-basic-info__options">
{statistics.map(item => ( {statistics.map(item => (
<div key={item.label} className="port-basic-info__option"> <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 className="port-personnel-stats__cell">人员数</div>
</div> </div>
<div className="port-personnel-stats__table-body"> <div className="port-personnel-stats__table-body">
<Spin spinning={props.biStatistics.portIndexBasicInfoStatisticPageLoading}> <Spin spinning={props.biStatistics.getCorpInfoCorpUserStatisticPageLoading}>
{isVisible && ( {isVisible && (
<SeamlessScroll list={statistics} step={0.5}> <SeamlessScroll list={statistics} step={0.5}>
{statistics.map((item, index) => ( {statistics.map((item, index) => (

View File

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

View File

@ -1,4 +1,5 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Spin } from "antd";
import { useContext, useEffect, useState } from "react"; import { useContext, useEffect, useState } from "react";
import SeamlessScroll from "zy-react-library/components/SeamlessScroll"; import SeamlessScroll from "zy-react-library/components/SeamlessScroll";
import { NS_BI_STATISTICS } from "~/enumerate/namespace"; import { NS_BI_STATISTICS } from "~/enumerate/namespace";
@ -37,6 +38,7 @@ function WorkRecordPanel(props) {
<div className="port-danger-work-record__cell">下一步操作人</div> <div className="port-danger-work-record__cell">下一步操作人</div>
</div> </div>
<div className="port-danger-work-record__table-body"> <div className="port-danger-work-record__table-body">
<Spin spinning={props.biStatistics.getEightWorkInfoScreenWorkRecordLoading}>
<SeamlessScroll list={records} step={0.5}> <SeamlessScroll list={records} step={0.5}>
{records.map((item, index) => ( {records.map((item, index) => (
<div key={index} className="port-danger-work-record__row"> <div key={index} className="port-danger-work-record__row">
@ -59,6 +61,7 @@ function WorkRecordPanel(props) {
</div> </div>
))} ))}
</SeamlessScroll> </SeamlessScroll>
</Spin>
</div> </div>
</div> </div>
</div> </div>

View File

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

View File

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

View File

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

View File

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

View File

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