From 885c69d4d629e4c1d4b1b43e8f249abf1ec0e258 Mon Sep 17 00:00:00 2001 From: wenlele Date: Thu, 30 Jun 2022 14:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/sideSheet.jsx | 226 +++++++++--------- 1 file changed, 116 insertions(+), 110 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx index 3fe6226..82815b2 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx @@ -24,9 +24,7 @@ function SideSheets (props) { const { equipmentWarehouse } = actions; const [clickStyle, setclickStyle] = useState(); const [nvrDetails, setNvrDetails] = useState({ station: [] }); - const [highStandard, setHighStandard] = useState(true); - const [solid, setSolid] = useState("solid"); - const [light, setLight] = useState("light"); + const [highStandard, setHighStandard] = useState(false); const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"]; const information = { nvr: [ @@ -141,7 +139,6 @@ function SideSheets (props) { ) ).then((res) => { setNvrDetails(res.payload.data); - console.log(res.payload.data); projectScrollbar = new PerfectScrollbar("#project_information", { suppressScrollX: true, }); @@ -265,6 +262,7 @@ function SideSheets (props) { ? (cameraSetup ? information.camera : information.nvr).map( (item, index) => { let str = []; + let high = nvrDetails.gbCamera ? nvrDetails.gbCamera.playUrl ? nvrDetails.gbCamera.playUrl.liveUrl ? nvrDetails.gbCamera.playUrl.liveUrl.hd : "" : "" : "" if (index > 0) { str.push( {item.name} {cameraSetup ? ( - index == 1 ? ( + index == 1 && high ? (
- -
) : ( @@ -393,107 +387,109 @@ function SideSheets (props) { }); } //接入信息/复制直播地址 - let broadcast=nvrDetails.gbCamera?nvrDetails.gbCamera.playUrl?nvrDetails.gbCamera.playUrl.liveUrl:"":"" - console.log(broadcast) + let broadcast = nvrDetails.gbCamera ? nvrDetails.gbCamera.playUrl ? nvrDetails.gbCamera.playUrl.liveUrl ? nvrDetails.gbCamera.playUrl.liveUrl[highStandard ? "hd" : "sd"] : "" : "" : "" if (index == 1) { - (cameraSetup ? item.liveBroadcast : item.access).map( - (item, index) => { - if (cameraSetup) { - nvrDetails.videoUrl ? nvrDetails.videoUrl.liveUrl ? - str.push( -
{ - if (highStandard) { - copy(nvrDetails.videoUrl.liveUrl.hd[item.key]); - } else { - copy(nvrDetails.videoUrl.liveUrl.sd[item.key]); - } - - setclickStyle(item.name); - }} - > - -
- {item.name} - -
-
- ) : "" : ""; - } else { + if (cameraSetup) { + if (broadcast) { + for (let key in broadcast) { str.push(
{ + copy(broadcast[key] ? broadcast[key] : "无相关地址"); + setclickStyle(key); }} > - - {item.name} - - - {item.difference == "difference" ? nvrDetails[item.key] : nvrDetails.accessInfo ? nvrDetails.accessInfo[item.key] : ""} - + +
+ {key} + +
- ); + ) + } - return str; + } else { + + str.push(
无相关信息
) } - ); + + + } else { + item.access.map((item, index) => { + str.push( +
+ + {item.name} + + + {item.difference == "difference" ? nvrDetails[item.key] : nvrDetails.accessInfo ? nvrDetails.accessInfo[item.key] : ""} + +
+ ); + return str; + }) + + } } //摄像头信息/复制回收地址 + let recovery = nvrDetails.gbCamera ? nvrDetails.gbCamera.playUrl ? nvrDetails.gbCamera.playUrl.replayUrl : "" : "" if (index == 2) { - (cameraSetup ? item.recovery : nvrDetails.camera ? nvrDetails.camera : []).map( - (item, index) => { - if (cameraSetup) { - nvrDetails.videoUrl?nvrDetails.videoUrl.replayUrl? + if (cameraSetup) { + if (recovery) { + for (let key in recovery) { str.push(
{ - copy(nvrDetails.videoUrl.replayUrl[item.key]); + copy(recovery[key] ? recovery[key] : "无相关地址"); // alert("复制成功"); - setclickStyle(item.name); + setclickStyle(key); }} >
- {item.name} + {`${key}`}
- ):"":""; - } else { + ) + } + } else { + str.push(
无相关信息
) + } + + + } else { + let nvrCamera = nvrDetails.camera ? nvrDetails.camera : [] + if (nvrCamera.length > 0) { + nvrCamera.map((item, index) => { str.push(
); - } - return str; + return str; + }) + } else { + str.push(
无相关信息
) } - ); + } } - return str; } )