Browse Source

查询信息修改完毕

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

226
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(
<img
@ -290,7 +288,7 @@ function SideSheets (props) {
>
{item.name}
{cameraSetup ? (
index == 1 ? (
index == 1 && high ? (
<div
style={{
display: "inline-block",
@ -298,17 +296,13 @@ function SideSheets (props) {
marginRight: 20,
}}
>
<Button style={{ marginRight: 20 }} theme={solid} onClick={() => {
<Button style={{ marginRight: 20 }} theme={highStandard ? "solid" : "light"} onClick={() => {
setHighStandard(true)
setSolid("solid")
setLight("light")
}}>
高清
</Button>
<Button theme={light} onClick={() => {
<Button theme={highStandard ? "light" : "solid"} onClick={() => {
setHighStandard(false)
setSolid("light")
setLight("solid")
}}>标清</Button>
</div>
) : (
@ -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(
<div
key={"liveBroadcast" + index}
style={{
width: 120,
height: 130,
display: "inline-block",
borderRadius: 4,
border: "1px solid #D9D9D9",
margin: "20px 0 0 40px",
textAlign: "center",
color: clickStyle == item.name ? "white" : "",
background:
clickStyle == item.name ? "#1859C1" : "",
}}
onClick={() => {
if (highStandard) {
copy(nvrDetails.videoUrl.liveUrl.hd[item.key]);
} else {
copy(nvrDetails.videoUrl.liveUrl.sd[item.key]);
}
setclickStyle(item.name);
}}
>
<img
src={`/assets/images/background/${clickStyle == item.name
? "sewage_camera2"
: "sewage_camera1"
}.png`}
style={{ margin: "20px 0 8px 0" }}
/>
<div>
{item.name}
<img
src={`/assets/images/background/${clickStyle == item.name
? "copy2"
: "copy1"
}.png`}
style={{
paddingBottom: 10,
display: "inline-block",
width: 10,
height: 20,
}}
/>
</div>
</div>
) : "" : "";
} else {
if (cameraSetup) {
if (broadcast) {
for (let key in broadcast) {
str.push(
<div
key={"access" + index}
key={key}
style={{
width: "50%",
width: 120,
height: 130,
display: "inline-block",
marginTop: 20,
borderRadius: 4,
border: "1px solid #D9D9D9",
margin: "20px 0 0 40px",
textAlign: "center",
color: clickStyle == key ? "white" : "",
background:
clickStyle == key ? "#1859C1" : "",
}}
onClick={() => {
copy(broadcast[key] ? broadcast[key] : "无相关地址");
setclickStyle(key);
}}
>
<span
style={{
width: 150,
display: "inline-block",
textAlign: "right",
fontWeight: "400",
color: "rgba(0, 0, 0, 0.45)",
}}
>
{item.name}
</span>
<span
style={{
fontWeight: "400",
color: " #34383E",
}}
>
{item.difference == "difference" ? nvrDetails[item.key] : nvrDetails.accessInfo ? nvrDetails.accessInfo[item.key] : ""}
</span>
<img
src={`/assets/images/background/${clickStyle == key
? "sewage_camera2"
: "sewage_camera1"
}.png`}
style={{ margin: "20px 0 8px 0" }}
/>
<div>
{key}
<img
src={`/assets/images/background/${clickStyle == key
? "copy2"
: "copy1"
}.png`}
style={{
paddingBottom: 10,
display: "inline-block",
width: 10,
height: 20,
}}
/>
</div>
</div>
);
)
}
return str;
} 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(
<div
key={"access" + index}
style={{
width: "50%",
display: "inline-block",
marginTop: 20,
}}
>
<span
style={{
width: 150,
display: "inline-block",
textAlign: "right",
fontWeight: "400",
color: "rgba(0, 0, 0, 0.45)",
}}
>
{item.name}
</span>
<span
style={{
fontWeight: "400",
color: " #34383E",
}}
>
{item.difference == "difference" ? nvrDetails[item.key] : nvrDetails.accessInfo ? nvrDetails.accessInfo[item.key] : ""}
</span>
</div>
);
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(
<div
key={"liveBroadcast" + index}
key={key}
style={{
width: 120,
height: 130,
@ -502,27 +498,27 @@ function SideSheets (props) {
border: "1px solid #D9D9D9",
margin: "20px 0 0 40px",
textAlign: "center",
color: clickStyle == item.name ? "white" : "",
color: clickStyle == key ? "white" : "",
background:
clickStyle == item.name ? "#1859C1" : "",
clickStyle == key ? "#1859C1" : "",
}}
onClick={() => {
copy(nvrDetails.videoUrl.replayUrl[item.key]);
copy(recovery[key] ? recovery[key] : "无相关地址");
// alert("");
setclickStyle(item.name);
setclickStyle(key);
}}
>
<img
src={`/assets/images/background/${clickStyle == item.name
src={`/assets/images/background/${clickStyle == key
? "store2"
: "store1"
}.png`}
style={{ margin: "20px 0 8px 0" }}
/>
<div>
{item.name}
{`${key}`}
<img
src={`/assets/images/background/${clickStyle == item.name
src={`/assets/images/background/${clickStyle == key
? "copy2"
: "copy1"
}.png`}
@ -535,8 +531,17 @@ function SideSheets (props) {
/>
</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(
<div
key={"access" + index}
@ -577,12 +582,13 @@ function SideSheets (props) {
</p>
</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;
}
)

Loading…
Cancel
Save