Browse Source

查询信息修改完毕

release_0.0.2
wenlele 3 years ago
parent
commit
885c69d4d6
  1. 100
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx

100
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx

@ -24,9 +24,7 @@ function SideSheets (props) {
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const [clickStyle, setclickStyle] = useState(); const [clickStyle, setclickStyle] = useState();
const [nvrDetails, setNvrDetails] = useState({ station: [] }); const [nvrDetails, setNvrDetails] = useState({ station: [] });
const [highStandard, setHighStandard] = useState(true); const [highStandard, setHighStandard] = useState(false);
const [solid, setSolid] = useState("solid");
const [light, setLight] = useState("light");
const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"]; const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"];
const information = { const information = {
nvr: [ nvr: [
@ -141,7 +139,6 @@ function SideSheets (props) {
) )
).then((res) => { ).then((res) => {
setNvrDetails(res.payload.data); setNvrDetails(res.payload.data);
console.log(res.payload.data);
projectScrollbar = new PerfectScrollbar("#project_information", { projectScrollbar = new PerfectScrollbar("#project_information", {
suppressScrollX: true, suppressScrollX: true,
}); });
@ -265,6 +262,7 @@ function SideSheets (props) {
? (cameraSetup ? information.camera : information.nvr).map( ? (cameraSetup ? information.camera : information.nvr).map(
(item, index) => { (item, index) => {
let str = []; let str = [];
let high = nvrDetails.gbCamera ? nvrDetails.gbCamera.playUrl ? nvrDetails.gbCamera.playUrl.liveUrl ? nvrDetails.gbCamera.playUrl.liveUrl.hd : "" : "" : ""
if (index > 0) { if (index > 0) {
str.push( str.push(
<img <img
@ -290,7 +288,7 @@ function SideSheets (props) {
> >
{item.name} {item.name}
{cameraSetup ? ( {cameraSetup ? (
index == 1 ? ( index == 1 && high ? (
<div <div
style={{ style={{
display: "inline-block", display: "inline-block",
@ -298,17 +296,13 @@ function SideSheets (props) {
marginRight: 20, marginRight: 20,
}} }}
> >
<Button style={{ marginRight: 20 }} theme={solid} onClick={() => { <Button style={{ marginRight: 20 }} theme={highStandard ? "solid" : "light"} onClick={() => {
setHighStandard(true) setHighStandard(true)
setSolid("solid")
setLight("light")
}}> }}>
高清 高清
</Button> </Button>
<Button theme={light} onClick={() => { <Button theme={highStandard ? "light" : "solid"} onClick={() => {
setHighStandard(false) setHighStandard(false)
setSolid("light")
setLight("solid")
}}>标清</Button> }}>标清</Button>
</div> </div>
) : ( ) : (
@ -393,16 +387,14 @@ function SideSheets (props) {
}); });
} }
/// ///
let broadcast=nvrDetails.gbCamera?nvrDetails.gbCamera.playUrl?nvrDetails.gbCamera.playUrl.liveUrl:"":"" let broadcast = nvrDetails.gbCamera ? nvrDetails.gbCamera.playUrl ? nvrDetails.gbCamera.playUrl.liveUrl ? nvrDetails.gbCamera.playUrl.liveUrl[highStandard ? "hd" : "sd"] : "" : "" : ""
console.log(broadcast)
if (index == 1) { if (index == 1) {
(cameraSetup ? item.liveBroadcast : item.access).map(
(item, index) => {
if (cameraSetup) { if (cameraSetup) {
nvrDetails.videoUrl ? nvrDetails.videoUrl.liveUrl ? if (broadcast) {
for (let key in broadcast) {
str.push( str.push(
<div <div
key={"liveBroadcast" + index} key={key}
style={{ style={{
width: 120, width: 120,
height: 130, height: 130,
@ -411,31 +403,26 @@ function SideSheets (props) {
border: "1px solid #D9D9D9", border: "1px solid #D9D9D9",
margin: "20px 0 0 40px", margin: "20px 0 0 40px",
textAlign: "center", textAlign: "center",
color: clickStyle == item.name ? "white" : "", color: clickStyle == key ? "white" : "",
background: background:
clickStyle == item.name ? "#1859C1" : "", clickStyle == key ? "#1859C1" : "",
}} }}
onClick={() => { onClick={() => {
if (highStandard) { copy(broadcast[key] ? broadcast[key] : "无相关地址");
copy(nvrDetails.videoUrl.liveUrl.hd[item.key]); setclickStyle(key);
} else {
copy(nvrDetails.videoUrl.liveUrl.sd[item.key]);
}
setclickStyle(item.name);
}} }}
> >
<img <img
src={`/assets/images/background/${clickStyle == item.name src={`/assets/images/background/${clickStyle == key
? "sewage_camera2" ? "sewage_camera2"
: "sewage_camera1" : "sewage_camera1"
}.png`} }.png`}
style={{ margin: "20px 0 8px 0" }} style={{ margin: "20px 0 8px 0" }}
/> />
<div> <div>
{item.name} {key}
<img <img
src={`/assets/images/background/${clickStyle == item.name src={`/assets/images/background/${clickStyle == key
? "copy2" ? "copy2"
: "copy1" : "copy1"
}.png`} }.png`}
@ -448,8 +435,17 @@ function SideSheets (props) {
/> />
</div> </div>
</div> </div>
) : "" : ""; )
}
} else { } else {
str.push(<div style={{ width: "100%", lineHeight: "120px", textAlign: "center", color: "rgba(151, 151, 151, .5)" }}>无相关信息</div>)
}
} else {
item.access.map((item, index) => {
str.push( str.push(
<div <div
key={"access" + index} key={"access" + index}
@ -480,20 +476,20 @@ function SideSheets (props) {
</span> </span>
</div> </div>
); );
}
return str; return str;
})
} }
);
} }
/// ///
let recovery = nvrDetails.gbCamera ? nvrDetails.gbCamera.playUrl ? nvrDetails.gbCamera.playUrl.replayUrl : "" : ""
if (index == 2) { if (index == 2) {
(cameraSetup ? item.recovery : nvrDetails.camera ? nvrDetails.camera : []).map(
(item, index) => {
if (cameraSetup) { if (cameraSetup) {
nvrDetails.videoUrl?nvrDetails.videoUrl.replayUrl? if (recovery) {
for (let key in recovery) {
str.push( str.push(
<div <div
key={"liveBroadcast" + index} key={key}
style={{ style={{
width: 120, width: 120,
height: 130, height: 130,
@ -502,27 +498,27 @@ function SideSheets (props) {
border: "1px solid #D9D9D9", border: "1px solid #D9D9D9",
margin: "20px 0 0 40px", margin: "20px 0 0 40px",
textAlign: "center", textAlign: "center",
color: clickStyle == item.name ? "white" : "", color: clickStyle == key ? "white" : "",
background: background:
clickStyle == item.name ? "#1859C1" : "", clickStyle == key ? "#1859C1" : "",
}} }}
onClick={() => { onClick={() => {
copy(nvrDetails.videoUrl.replayUrl[item.key]); copy(recovery[key] ? recovery[key] : "无相关地址");
// alert(""); // alert("");
setclickStyle(item.name); setclickStyle(key);
}} }}
> >
<img <img
src={`/assets/images/background/${clickStyle == item.name src={`/assets/images/background/${clickStyle == key
? "store2" ? "store2"
: "store1" : "store1"
}.png`} }.png`}
style={{ margin: "20px 0 8px 0" }} style={{ margin: "20px 0 8px 0" }}
/> />
<div> <div>
{item.name} {`${key}`}
<img <img
src={`/assets/images/background/${clickStyle == item.name src={`/assets/images/background/${clickStyle == key
? "copy2" ? "copy2"
: "copy1" : "copy1"
}.png`} }.png`}
@ -535,8 +531,17 @@ function SideSheets (props) {
/> />
</div> </div>
</div> </div>
):"":""; )
}
} else { } else {
str.push(<div style={{ width: "100%", lineHeight: "120px", textAlign: "center", color: "rgba(151, 151, 151, .5)" }}>无相关信息</div>)
}
} else {
let nvrCamera = nvrDetails.camera ? nvrDetails.camera : []
if (nvrCamera.length > 0) {
nvrCamera.map((item, index) => {
str.push( str.push(
<div <div
key={"access" + index} key={"access" + index}
@ -577,12 +582,13 @@ function SideSheets (props) {
</p> </p>
</div> </div>
); );
}
return str; return str;
})
} else {
str.push(<div style={{ width: "100%", lineHeight: "120px", textAlign: "center", color: "rgba(151, 151, 151, .5)" }}>无相关信息</div>)
}
} }
);
} }
return str; return str;
} }
) )

Loading…
Cancel
Save