bug:19956
parent
6cb130a75d
commit
6e23381055
|
|
@ -96,10 +96,6 @@ export const getEightWorkInfoScreenDepartmentStatistics = declareRequest(
|
|||
"getEightWorkInfoScreenDepartmentStatisticsLoading",
|
||||
"Post > @/eightwork/eightworkInfo/screenDepartmentStatistics",
|
||||
);
|
||||
export const getProjectVisualProjectStatistics = declareRequest(
|
||||
"getProjectVisualProjectStatisticsLoading",
|
||||
"Get > /xgfManager/project/visualProjectStatistics",
|
||||
);
|
||||
export const getKeyProjectLargeScreenProjectProgress = declareRequest(
|
||||
"getKeyProjectLargeScreenProjectProgressLoading",
|
||||
"Post > @/keyProject/keyProject/largeScreenProjectProgress",
|
||||
|
|
@ -108,9 +104,13 @@ export const getFixedCameraVideoInfoPage = declareRequest(
|
|||
"getFixedCameraVideoInfoPageLoading",
|
||||
"Post > @/videopatrol/fixedCamera/getVideoInfoPage",
|
||||
);
|
||||
export const getProjectContractProjectStatistics = declareRequest(
|
||||
"getProjectContractProjectStatisticsLoading",
|
||||
"Post > @/xgfManager/project/contractProjectStatistics",
|
||||
export const getKeyProjectLargeScreenContractorStatistics = declareRequest(
|
||||
"getKeyProjectLargeScreenContractorStatisticsLoading",
|
||||
"Post > @/keyProject/keyProject/largeScreenContractorStatistics",
|
||||
);
|
||||
export const getKeyProjectLargeScreenMobileMonitoring = declareRequest(
|
||||
"getKeyProjectLargeScreenMobileMonitoringLoading",
|
||||
"Post > @/keyProject/keyProject/largeScreenMobileMonitoring",
|
||||
);
|
||||
export const getSensorDeviceFireSituation = declareRequest(
|
||||
"getSensorDeviceFireSituationLoading",
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ function ContractProjectPanel(props) {
|
|||
chartInstance.current = echarts.init(chartRef.current);
|
||||
|
||||
const waitStartData = data.map(item =>
|
||||
Number.parseInt(item.pendingProjectCount),
|
||||
Number.parseInt(item.waitStartCount),
|
||||
);
|
||||
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 = {
|
||||
tooltip: {
|
||||
|
|
@ -159,7 +159,7 @@ function ContractProjectPanel(props) {
|
|||
|
||||
useMount(() => {
|
||||
const loadData = async () => {
|
||||
const { data } = await props.getProjectContractProjectStatistics({
|
||||
const { data } = await props.getKeyProjectLargeScreenContractorStatistics({
|
||||
portArea,
|
||||
corpinfoId: currentBranchOffice,
|
||||
pageIndex: 1,
|
||||
|
|
@ -179,7 +179,7 @@ function ContractProjectPanel(props) {
|
|||
|
||||
return (
|
||||
<Panel title="承包项目情况" className={styles.branchOfficeKeyProject__contract}>
|
||||
<Spin spinning={props.biStatistics.getProjectContractProjectStatisticsLoading}>
|
||||
<Spin spinning={props.biStatistics.getKeyProjectLargeScreenContractorStatisticsLoading}>
|
||||
<div className={styles.branchOfficeContractProject__content}>
|
||||
<div
|
||||
ref={chartRef}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable react-dom/no-missing-iframe-sandbox -- 该视频播放页添加 sandbox 后无法正常播放,需要保留完整的运行权限。 */
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Spin } from "antd";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import AliPlayer from "zy-react-library/components/Video/AliPlayer";
|
||||
import { randoms } from "zy-react-library/utils";
|
||||
import { NS_BI_STATISTICS } from "~/enumerate/namespace";
|
||||
import Panel from "~/pages/Container/Map/components/Content/branchOffice/Panel";
|
||||
|
|
@ -14,24 +14,17 @@ function MobileMonitoringPanel(props) {
|
|||
const [playUrl, setPlayUrl] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
const loadPlayUrl = async (cameraNumber) => {
|
||||
const { data, success } = await props.getFixedCameraPlayUrl({
|
||||
indexCode: cameraNumber,
|
||||
});
|
||||
if (success && data) {
|
||||
setPlayUrl(data?.url || "");
|
||||
}
|
||||
};
|
||||
const loadCamera = async () => {
|
||||
const { data } = await props.getFixedCameraVideoInfoPage({
|
||||
const { data } = await props.getKeyProjectLargeScreenMobileMonitoring({
|
||||
portArea,
|
||||
corpinfoId: currentBranchOffice,
|
||||
pageIndex: 1,
|
||||
pageSize: 99,
|
||||
cameraType: 2,
|
||||
});
|
||||
if (data?.length) {
|
||||
loadPlayUrl(data[Math.floor(randoms(0, data.length - 1))].cameraNumber);
|
||||
}
|
||||
const cameras = (data || []).filter(item => item.videoAddress?.includes(".html"));
|
||||
const camera = cameras.length ? cameras[Math.floor(randoms(0, cameras.length - 1))] : null;
|
||||
setPlayUrl(camera ? `${camera.videoAddress}&aspect=fullscreen&stretch=yes` : "");
|
||||
};
|
||||
loadCamera();
|
||||
}, []);
|
||||
|
|
@ -42,15 +35,20 @@ function MobileMonitoringPanel(props) {
|
|||
className={styles.branchOfficeKeyProject__monitoring}
|
||||
>
|
||||
<Spin
|
||||
spinning={
|
||||
props.biStatistics.getFixedCameraVideoInfoPageLoading
|
||||
|| props.biStatistics.getFixedCameraPlayUrlLoading
|
||||
}
|
||||
spinning={props.biStatistics.getKeyProjectLargeScreenMobileMonitoringLoading}
|
||||
>
|
||||
<div className={styles.branchOfficeMobileMonitoring__content}>
|
||||
{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>
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@ function ProjectStatsPanel(props) {
|
|||
|
||||
useEffect(() => {
|
||||
const loadData = async () => {
|
||||
const { data } = await props.getProjectVisualProjectStatistics({
|
||||
const { data } = await props.getKeyProjectLargeScreenProjectStatistics({
|
||||
portArea,
|
||||
corpinfoId: currentBranchOffice,
|
||||
});
|
||||
setData([
|
||||
{ ...defaultStatistics[0], value: data?.totalProjectCount },
|
||||
{ ...defaultStatistics[1], value: data?.pendingProjectCount },
|
||||
{ ...defaultStatistics[2], value: data?.executingProjectCount },
|
||||
{ ...defaultStatistics[1], value: data?.waitStartCount },
|
||||
{ ...defaultStatistics[2], value: data?.startCount },
|
||||
]);
|
||||
};
|
||||
loadData();
|
||||
|
|
@ -36,7 +36,7 @@ function ProjectStatsPanel(props) {
|
|||
|
||||
return (
|
||||
<Panel title="项目统计">
|
||||
<Spin spinning={props.biStatistics.getProjectVisualProjectStatisticsLoading}>
|
||||
<Spin spinning={props.biStatistics.getKeyProjectLargeScreenProjectStatisticsLoading}>
|
||||
<div className={styles.branchOfficeProjectStats__content}>
|
||||
<div className={styles.branchOfficeProjectStats__list}>
|
||||
{data.map((item, index) => (
|
||||
|
|
|
|||
Loading…
Reference in New Issue