bug:19956

master
LiuJiaNan 2026-08-06 11:45:09 +08:00
parent 6cb130a75d
commit 6e23381055
4 changed files with 32 additions and 34 deletions

View File

@ -96,10 +96,6 @@ export const getEightWorkInfoScreenDepartmentStatistics = declareRequest(
"getEightWorkInfoScreenDepartmentStatisticsLoading", "getEightWorkInfoScreenDepartmentStatisticsLoading",
"Post > @/eightwork/eightworkInfo/screenDepartmentStatistics", "Post > @/eightwork/eightworkInfo/screenDepartmentStatistics",
); );
export const getProjectVisualProjectStatistics = declareRequest(
"getProjectVisualProjectStatisticsLoading",
"Get > /xgfManager/project/visualProjectStatistics",
);
export const getKeyProjectLargeScreenProjectProgress = declareRequest( export const getKeyProjectLargeScreenProjectProgress = declareRequest(
"getKeyProjectLargeScreenProjectProgressLoading", "getKeyProjectLargeScreenProjectProgressLoading",
"Post > @/keyProject/keyProject/largeScreenProjectProgress", "Post > @/keyProject/keyProject/largeScreenProjectProgress",
@ -108,9 +104,13 @@ export const getFixedCameraVideoInfoPage = declareRequest(
"getFixedCameraVideoInfoPageLoading", "getFixedCameraVideoInfoPageLoading",
"Post > @/videopatrol/fixedCamera/getVideoInfoPage", "Post > @/videopatrol/fixedCamera/getVideoInfoPage",
); );
export const getProjectContractProjectStatistics = declareRequest( export const getKeyProjectLargeScreenContractorStatistics = declareRequest(
"getProjectContractProjectStatisticsLoading", "getKeyProjectLargeScreenContractorStatisticsLoading",
"Post > @/xgfManager/project/contractProjectStatistics", "Post > @/keyProject/keyProject/largeScreenContractorStatistics",
);
export const getKeyProjectLargeScreenMobileMonitoring = declareRequest(
"getKeyProjectLargeScreenMobileMonitoringLoading",
"Post > @/keyProject/keyProject/largeScreenMobileMonitoring",
); );
export const getSensorDeviceFireSituation = declareRequest( export const getSensorDeviceFireSituation = declareRequest(
"getSensorDeviceFireSituationLoading", "getSensorDeviceFireSituationLoading",

View File

@ -18,12 +18,12 @@ function ContractProjectPanel(props) {
chartInstance.current = echarts.init(chartRef.current); chartInstance.current = echarts.init(chartRef.current);
const waitStartData = data.map(item => const waitStartData = data.map(item =>
Number.parseInt(item.pendingProjectCount), Number.parseInt(item.waitStartCount),
); );
const inProgressData = data.map(item => const inProgressData = data.map(item =>
Number.parseInt(item.executingProjectCount), Number.parseInt(item.doingCount),
); );
const names = data.map(item => item.corpinfoName); const names = data.map(item => item.contractorName);
const option = { const option = {
tooltip: { tooltip: {
@ -159,7 +159,7 @@ function ContractProjectPanel(props) {
useMount(() => { useMount(() => {
const loadData = async () => { const loadData = async () => {
const { data } = await props.getProjectContractProjectStatistics({ const { data } = await props.getKeyProjectLargeScreenContractorStatistics({
portArea, portArea,
corpinfoId: currentBranchOffice, corpinfoId: currentBranchOffice,
pageIndex: 1, pageIndex: 1,
@ -179,7 +179,7 @@ function ContractProjectPanel(props) {
return ( return (
<Panel title="承包项目情况" className={styles.branchOfficeKeyProject__contract}> <Panel title="承包项目情况" className={styles.branchOfficeKeyProject__contract}>
<Spin spinning={props.biStatistics.getProjectContractProjectStatisticsLoading}> <Spin spinning={props.biStatistics.getKeyProjectLargeScreenContractorStatisticsLoading}>
<div className={styles.branchOfficeContractProject__content}> <div className={styles.branchOfficeContractProject__content}>
<div <div
ref={chartRef} ref={chartRef}

View File

@ -1,7 +1,7 @@
/* eslint-disable react-dom/no-missing-iframe-sandbox -- 该视频播放页添加 sandbox 后无法正常播放,需要保留完整的运行权限。 */
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Spin } from "antd"; import { Spin } from "antd";
import { useContext, useEffect, useState } from "react"; import { useContext, useEffect, useState } from "react";
import AliPlayer from "zy-react-library/components/Video/AliPlayer";
import { randoms } from "zy-react-library/utils"; import { randoms } from "zy-react-library/utils";
import { NS_BI_STATISTICS } from "~/enumerate/namespace"; import { NS_BI_STATISTICS } from "~/enumerate/namespace";
import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel"; import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel";
@ -14,24 +14,17 @@ function MobileMonitoringPanel(props) {
const [playUrl, setPlayUrl] = useState(""); const [playUrl, setPlayUrl] = useState("");
useEffect(() => { useEffect(() => {
const loadPlayUrl = async (cameraNumber) => {
const { data, success } = await props.getFixedCameraPlayUrl({
indexCode: cameraNumber,
});
if (success && data) {
setPlayUrl(data?.url || "");
}
};
const loadCamera = async () => { const loadCamera = async () => {
const { data } = await props.getFixedCameraVideoInfoPage({ const { data } = await props.getKeyProjectLargeScreenMobileMonitoring({
portArea, portArea,
corpinfoId: currentBranchOffice, corpinfoId: currentBranchOffice,
pageIndex: 1, pageIndex: 1,
pageSize: 99, pageSize: 99,
cameraType: 2,
}); });
if (data?.length) { const cameras = (data || []).filter(item => item.videoAddress?.includes(".html"));
loadPlayUrl(data[Math.floor(randoms(0, data.length - 1))].cameraNumber); const camera = cameras.length ? cameras[Math.floor(randoms(0, cameras.length - 1))] : null;
} setPlayUrl(camera ? `${camera.videoAddress}&aspect=fullscreen&stretch=yes` : "");
}; };
loadCamera(); loadCamera();
}, []); }, []);
@ -42,15 +35,20 @@ function MobileMonitoringPanel(props) {
className={styles.branchOfficeKeyProject__monitoring} className={styles.branchOfficeKeyProject__monitoring}
> >
<Spin <Spin
spinning={ spinning={props.biStatistics.getKeyProjectLargeScreenMobileMonitoringLoading}
props.biStatistics.getFixedCameraVideoInfoPageLoading
|| props.biStatistics.getFixedCameraPlayUrlLoading
}
> >
<div className={styles.branchOfficeMobileMonitoring__content}> <div className={styles.branchOfficeMobileMonitoring__content}>
{playUrl {playUrl
? ( ? (
<AliPlayer source={playUrl} height="150px" isLive /> <iframe
src={playUrl}
title="移动监控视频"
width="100%"
height="150"
frameBorder="0"
allow="autoplay; fullscreen; microphone"
allowFullScreen
/>
) )
: ( : (
<div className={styles.indexInfoVideoPatrol__empty}>暂无视频</div> <div className={styles.indexInfoVideoPatrol__empty}>暂无视频</div>

View File

@ -21,14 +21,14 @@ function ProjectStatsPanel(props) {
useEffect(() => { useEffect(() => {
const loadData = async () => { const loadData = async () => {
const { data } = await props.getProjectVisualProjectStatistics({ const { data } = await props.getKeyProjectLargeScreenProjectStatistics({
portArea, portArea,
corpinfoId: currentBranchOffice, corpinfoId: currentBranchOffice,
}); });
setData([ setData([
{ ...defaultStatistics[0], value: data?.totalProjectCount }, { ...defaultStatistics[0], value: data?.totalProjectCount },
{ ...defaultStatistics[1], value: data?.pendingProjectCount }, { ...defaultStatistics[1], value: data?.waitStartCount },
{ ...defaultStatistics[2], value: data?.executingProjectCount }, { ...defaultStatistics[2], value: data?.startCount },
]); ]);
}; };
loadData(); loadData();
@ -36,7 +36,7 @@ function ProjectStatsPanel(props) {
return ( return (
<Panel title="项目统计"> <Panel title="项目统计">
<Spin spinning={props.biStatistics.getProjectVisualProjectStatisticsLoading}> <Spin spinning={props.biStatistics.getKeyProjectLargeScreenProjectStatisticsLoading}>
<div className={styles.branchOfficeProjectStats__content}> <div className={styles.branchOfficeProjectStats__content}>
<div className={styles.branchOfficeProjectStats__list}> <div className={styles.branchOfficeProjectStats__list}>
{data.map((item, index) => ( {data.map((item, index) => (