|
|
@ -16,7 +16,6 @@ function SideSheets (props) { |
|
|
|
loading, |
|
|
|
visible, |
|
|
|
close, |
|
|
|
SETUPS, |
|
|
|
cameraSetup, |
|
|
|
rowId, |
|
|
|
venderList, |
|
|
@ -24,7 +23,7 @@ function SideSheets (props) { |
|
|
|
} = props; |
|
|
|
const { equipmentWarehouse } = actions; |
|
|
|
const [clickStyle, setclickStyle] = useState(); |
|
|
|
const [nvrDetails, setNvrDetails] = useState(""); |
|
|
|
const [nvrDetails, setNvrDetails] = useState({ station: [] }); |
|
|
|
const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"]; |
|
|
|
const information = { |
|
|
|
nvr: [ |
|
|
@ -131,6 +130,7 @@ function SideSheets (props) { |
|
|
|
zIndex: 5, |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
dispatch( |
|
|
|
equipmentWarehouse[cameraSetup ? "getCameraDetails" : "getNvrDetails"]( |
|
|
@ -160,10 +160,28 @@ function SideSheets (props) { |
|
|
|
equipmentScrollbar.update(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const statusNvr = nvrDetails.gbNvr |
|
|
|
const statusCamera = nvrDetails.gbCamera |
|
|
|
function colorStatus (data) { |
|
|
|
switch (data) { |
|
|
|
case "ON": |
|
|
|
return "green" |
|
|
|
case "ONLINE": |
|
|
|
return "green" |
|
|
|
case "OFF": |
|
|
|
return "grey" |
|
|
|
default: |
|
|
|
return "blue" |
|
|
|
} |
|
|
|
} |
|
|
|
return ( |
|
|
|
<SideSheet |
|
|
|
visible={visible} |
|
|
|
title={cameraSetup ? "污水管理出出口" : "智慧设备NVR"} |
|
|
|
title={cameraSetup ? |
|
|
|
<><img src={`/assets/images/background/${nvrDetails.forbidden ? "red" : colorStatus(statusNvr ? statusNvr.online : "")}.png`} style={{ marginRight: "10px" }} />污水管理出出口</> |
|
|
|
: <><img src={`/assets/images/background/${colorStatus(statusCamera ? statusCamera.online : "")}.png`} style={{ marginRight: "10px" }} />智慧设备NVR</> |
|
|
|
} |
|
|
|
style={{ background: "#F9FBFF" }} |
|
|
|
size="large" |
|
|
|
onCancel={() => { |
|
|
@ -209,24 +227,26 @@ function SideSheets (props) { |
|
|
|
}} |
|
|
|
> |
|
|
|
{nvrDetails |
|
|
|
? nvrDetails.station.map((item, index) => { |
|
|
|
return item.structure.projects.map((v, i) => { |
|
|
|
return ( |
|
|
|
<div |
|
|
|
key={v.name} |
|
|
|
style={{ |
|
|
|
display: "flex", |
|
|
|
justifyContent: "space-evenly", |
|
|
|
}} |
|
|
|
> |
|
|
|
<div style={styles}>{v.name}</div> |
|
|
|
<div style={styles}>{item.structure.name}</div> |
|
|
|
<div style={styles}>{item.name}</div> |
|
|
|
<div style={styles}>{item.factor.name}</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
}); |
|
|
|
}) |
|
|
|
? nvrDetails.station.length == 0 |
|
|
|
? "" |
|
|
|
: nvrDetails.station.map((item, index) => { |
|
|
|
return item.structure.projects.map((v, i) => { |
|
|
|
return ( |
|
|
|
<div |
|
|
|
key={v.name} |
|
|
|
style={{ |
|
|
|
display: "flex", |
|
|
|
justifyContent: "space-evenly", |
|
|
|
}} |
|
|
|
> |
|
|
|
<div style={styles}>{v.name}</div> |
|
|
|
<div style={styles}>{item.structure.name}</div> |
|
|
|
<div style={styles}>{item.name}</div> |
|
|
|
<div style={styles}>{item.factor.name}</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
}); |
|
|
|
}) |
|
|
|
: ""} |
|
|
|
</div> |
|
|
|
</TabPane> |
|
|
@ -311,7 +331,7 @@ function SideSheets (props) { |
|
|
|
<span |
|
|
|
style={{ fontWeight: "400", color: " #34383E" }} |
|
|
|
> |
|
|
|
{`${nvrDetails[item.key]},${nvrDetails.longitude}`} |
|
|
|
{nvrDetails.latitude ? `${nvrDetails[item.key]},${nvrDetails.longitude}` : "未知"} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
); |
|
|
@ -340,17 +360,15 @@ function SideSheets (props) { |
|
|
|
style={{ fontWeight: "400", color: " #34383E" }} |
|
|
|
> |
|
|
|
{item.key == "type" |
|
|
|
? accessType.find( |
|
|
|
? nvrDetails.type ? accessType.find( |
|
|
|
(v) => v.key == nvrDetails.type |
|
|
|
).name |
|
|
|
).name : "" |
|
|
|
: item.key == "venderId" |
|
|
|
? nvrDetails.venderId |
|
|
|
? venderList.find( |
|
|
|
(v) => v.id == nvrDetails.venderId |
|
|
|
).name |
|
|
|
: "" |
|
|
|
? nvrDetails.venderId ? venderList.find( |
|
|
|
(v) => v.id == nvrDetails.venderId |
|
|
|
).name : "未知" |
|
|
|
: item.key == "createUser" |
|
|
|
? nvrDetails.createUser.namePresent |
|
|
|
? nvrDetails.createUser ? nvrDetails.createUser.namePresent : "" |
|
|
|
: item.key == "createTime" |
|
|
|
? moment(nvrDetails.createTime).format( |
|
|
|
"YYYY-MM-DD HH:MM:SS" |
|
|
@ -385,7 +403,6 @@ function SideSheets (props) { |
|
|
|
}} |
|
|
|
onClick={() => { |
|
|
|
copy(item.name); |
|
|
|
// alert("复制成功"); |
|
|
|
setclickStyle(item.name); |
|
|
|
}} |
|
|
|
> |
|
|
@ -440,7 +457,7 @@ function SideSheets (props) { |
|
|
|
color: " #34383E", |
|
|
|
}} |
|
|
|
> |
|
|
|
{item.difference == "difference" ? nvrDetails[item.key] : nvrDetails.accessInfo[item.key]} |
|
|
|
{item.difference == "difference" ? nvrDetails[item.key] : nvrDetails.accessInfo ? nvrDetails.accessInfo[item.key] : ""} |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
); |
|
|
@ -451,7 +468,7 @@ function SideSheets (props) { |
|
|
|
} |
|
|
|
//摄像头信息/复制回收地址 |
|
|
|
if (index == 2) { |
|
|
|
(cameraSetup ? item.recovery : nvrDetails.camera).map( |
|
|
|
(cameraSetup ? item.recovery : nvrDetails.camera ? nvrDetails.camera : []).map( |
|
|
|
(item, index) => { |
|
|
|
if (cameraSetup) { |
|
|
|
str.push( |
|
|
|