Browse Source

从安心云四个摄像头的添加跳转到视频平台对应的摄像头添加 50%

release_0.0.2
wenlele 3 years ago
parent
commit
9958510f5c
  1. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/blue.png
  2. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/green.png
  3. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/grey.png
  4. BIN
      code/VideoAccess-VCMP/web/client/assets/images/background/red.png
  5. 6
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx
  6. 5
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
  7. 83
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  8. 84
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  9. 50
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
  10. 1
      code/VideoAccess-VCMP/web/package.json

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/blue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/green.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/grey.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
code/VideoAccess-VCMP/web/client/assets/images/background/red.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

6
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx

@ -23,7 +23,8 @@ function cameraModal (props) {
modify, modify,
parentCamera, parentCamera,
addNvr, addNvr,
nvrNumber nvrNumber,
axyData,
} = props; } = props;
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const fluoriteRef = useRef(); const fluoriteRef = useRef();
@ -51,6 +52,9 @@ function cameraModal (props) {
dispatch(equipmentWarehouse.getCameraKind()); dispatch(equipmentWarehouse.getCameraKind());
dispatch(equipmentWarehouse.getAbility()); dispatch(equipmentWarehouse.getAbility());
cameraData.type == "nvr" || addNvr ? setcameraList(cameraList.slice(1, 4)) : ""; cameraData.type == "nvr" || addNvr ? setcameraList(cameraList.slice(1, 4)) : "";
// if(){
// }
}, []); }, []);
const cameraList = [ const cameraList = [
// //

5
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx

@ -52,6 +52,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
streamId: cameraDataNvr.serialNo, streamId: cameraDataNvr.serialNo,
}) })
).then((res) => { ).then((res) => {
console.log(res)
let oneData = res.payload.data[0]; let oneData = res.payload.data[0];
let modifyData = res.payload.data.find( let modifyData = res.payload.data.find(
(item) => item.camera == null ? false : item.camera.name == cameraData.name (item) => item.camera == null ? false : item.camera.name == cameraData.name
@ -67,8 +68,8 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
) { ) {
item = oneData; item = oneData;
} }
item.change = false; // item.change = false;
item.support = false; // item.support = false;
if (item.camera) { if (item.camera) {
item.name = item.camera.name; item.name = item.camera.name;
} }

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

@ -16,7 +16,6 @@ function SideSheets (props) {
loading, loading,
visible, visible,
close, close,
SETUPS,
cameraSetup, cameraSetup,
rowId, rowId,
venderList, venderList,
@ -24,7 +23,7 @@ function SideSheets (props) {
} = props; } = props;
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const [clickStyle, setclickStyle] = useState(); const [clickStyle, setclickStyle] = useState();
const [nvrDetails, setNvrDetails] = useState(""); const [nvrDetails, setNvrDetails] = useState({ station: [] });
const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"]; const list = ["项目名称", "关联结构物", "关联测点", "关联监测因素"];
const information = { const information = {
nvr: [ nvr: [
@ -131,6 +130,7 @@ function SideSheets (props) {
zIndex: 5, zIndex: 5,
}; };
useEffect(() => { useEffect(() => {
dispatch( dispatch(
equipmentWarehouse[cameraSetup ? "getCameraDetails" : "getNvrDetails"]( equipmentWarehouse[cameraSetup ? "getCameraDetails" : "getNvrDetails"](
@ -160,10 +160,28 @@ function SideSheets (props) {
equipmentScrollbar.update(); 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 ( return (
<SideSheet <SideSheet
visible={visible} 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" }} style={{ background: "#F9FBFF" }}
size="large" size="large"
onCancel={() => { onCancel={() => {
@ -209,24 +227,26 @@ function SideSheets (props) {
}} }}
> >
{nvrDetails {nvrDetails
? nvrDetails.station.map((item, index) => { ? nvrDetails.station.length == 0
return item.structure.projects.map((v, i) => { ? ""
return ( : nvrDetails.station.map((item, index) => {
<div return item.structure.projects.map((v, i) => {
key={v.name} return (
style={{ <div
display: "flex", key={v.name}
justifyContent: "space-evenly", 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}>{v.name}</div>
<div style={styles}>{item.factor.name}</div> <div style={styles}>{item.structure.name}</div>
</div> <div style={styles}>{item.name}</div>
); <div style={styles}>{item.factor.name}</div>
}); </div>
}) );
});
})
: ""} : ""}
</div> </div>
</TabPane> </TabPane>
@ -311,7 +331,7 @@ function SideSheets (props) {
<span <span
style={{ fontWeight: "400", color: " #34383E" }} style={{ fontWeight: "400", color: " #34383E" }}
> >
{`${nvrDetails[item.key]},${nvrDetails.longitude}`} {nvrDetails.latitude ? `${nvrDetails[item.key]},${nvrDetails.longitude}` : "未知"}
</span> </span>
</div> </div>
); );
@ -340,17 +360,15 @@ function SideSheets (props) {
style={{ fontWeight: "400", color: " #34383E" }} style={{ fontWeight: "400", color: " #34383E" }}
> >
{item.key == "type" {item.key == "type"
? accessType.find( ? nvrDetails.type ? accessType.find(
(v) => v.key == nvrDetails.type (v) => v.key == nvrDetails.type
).name ).name : ""
: item.key == "venderId" : item.key == "venderId"
? nvrDetails.venderId ? nvrDetails.venderId ? venderList.find(
? venderList.find( (v) => v.id == nvrDetails.venderId
(v) => v.id == nvrDetails.venderId ).name : "未知"
).name
: ""
: item.key == "createUser" : item.key == "createUser"
? nvrDetails.createUser.namePresent ? nvrDetails.createUser ? nvrDetails.createUser.namePresent : ""
: item.key == "createTime" : item.key == "createTime"
? moment(nvrDetails.createTime).format( ? moment(nvrDetails.createTime).format(
"YYYY-MM-DD HH:MM:SS" "YYYY-MM-DD HH:MM:SS"
@ -385,7 +403,6 @@ function SideSheets (props) {
}} }}
onClick={() => { onClick={() => {
copy(item.name); copy(item.name);
// alert("");
setclickStyle(item.name); setclickStyle(item.name);
}} }}
> >
@ -440,7 +457,7 @@ function SideSheets (props) {
color: " #34383E", 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> </span>
</div> </div>
); );
@ -451,7 +468,7 @@ function SideSheets (props) {
} }
/// ///
if (index == 2) { if (index == 2) {
(cameraSetup ? item.recovery : nvrDetails.camera).map( (cameraSetup ? item.recovery : nvrDetails.camera ? nvrDetails.camera : []).map(
(item, index) => { (item, index) => {
if (cameraSetup) { if (cameraSetup) {
str.push( str.push(

84
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -1,6 +1,7 @@
import React, { useState, useEffect, useRef } from "react"; import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import moment from "moment"; import moment from "moment";
import qs from "qs";
import { import {
Button, Button,
Form, Form,
@ -25,6 +26,7 @@ import { accessType } from "./nvr";
const CameraHeader = (props) => { const CameraHeader = (props) => {
const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props; const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props;
const [cameraModal, setCameraModal] = useState(false); const [cameraModal, setCameraModal] = useState(false);
const [videoPlay, setVideoPlay] = useState(false);
const [modalName, setModalName] = useState(""); const [modalName, setModalName] = useState("");
const [setup, setSetup] = useState(false); const [setup, setSetup] = useState(false);
const [sideSheet, setSideSheet] = useState(false); const [sideSheet, setSideSheet] = useState(false);
@ -39,6 +41,7 @@ const CameraHeader = (props) => {
const [parentCamera, setParentCamera] = useState(""); // const [parentCamera, setParentCamera] = useState(""); //
const [addNvr, setAddNvr] = useState(false); //nvrNVR const [addNvr, setAddNvr] = useState(false); //nvrNVR
const [nvrNumber, setNvrNumber] = useState(); const [nvrNumber, setNvrNumber] = useState();
const [axyData, setAxyData] = useState();
const { equipmentWarehouse } = actions; const { equipmentWarehouse } = actions;
const api = useRef(); const api = useRef();
const searchb = useRef(search) const searchb = useRef(search)
@ -47,13 +50,19 @@ const CameraHeader = (props) => {
useEffect(() => { useEffect(() => {
console.log(props) console.log(props)
//
let isAxyData = props.location.search
if (isAxyData) {
setAxyData(qs.parse(isAxyData.slice(1)))
setCameraModal(true)
}
//NVR
if (props.location.query) { if (props.location.query) {
setAddNvr(props.location.query.addNvr) setAddNvr(props.location.query.addNvr)
setNvrNumber(props.location.query.serialNo) setNvrNumber(props.location.query.serialNo)
setCameraModal(true); setCameraModal(true);
} }
dispatch(actions.equipmentWarehouse.getVender()).then((res) => { dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
setvenderList(res.payload.data); setvenderList(res.payload.data);
attribute(res.payload.data); attribute(res.payload.data);
@ -74,8 +83,31 @@ const CameraHeader = (props) => {
function equipmentGetCamera () { function equipmentGetCamera () {
dispatch(equipmentWarehouse.getCamera({ ...query, ...search })); dispatch(equipmentWarehouse.getCamera({ ...query, ...search }));
} }
const equipmentStatus = { ON: "在线", ONLINE: "在线", OFF: "离线", Alarmed: "未知状态" } function equipmentStatus (data) {
switch (data) {
case "ON":
return "在线"
case "ONLINE":
return "在线"
case "OFF":
return "离线"
default:
return "未知"
}F
}
function colorStatus (data) {
switch (data) {
case "ON":
return "#04B234"
case "ONLINE":
return "#04B234"
case "OFF":
return "rgba(0, 0, 0, 0.45)"
default:
return "#1859C1"
}
}
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
@ -123,6 +155,7 @@ const CameraHeader = (props) => {
width: "20%", width: "20%",
dataIndex: "", dataIndex: "",
render: (_, row) => { render: (_, row) => {
console.log(row)
return ( return (
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Button <Button
@ -144,7 +177,20 @@ const CameraHeader = (props) => {
}} }}
> >
修改 修改
</Button> </Button>
{/* <Button onClick={() => { //aa开始为true
if(aa){
显示注记的方法
aa=false
}else{
隐藏注记的方法
aa=true
}
}}>
{aa?"显示注记":"隐藏注记"}
</Button> */}
<Button <Button
theme="borderless" theme="borderless"
onClick={() => { onClick={() => {
@ -158,7 +204,8 @@ const CameraHeader = (props) => {
<Button <Button
theme="borderless" theme="borderless"
onClick={() => { onClick={() => {
setRowId(row.id); // setRowId(row.id);
setVideoPlay(true)
}} }}
> >
播放 播放
@ -256,6 +303,24 @@ const CameraHeader = (props) => {
title: "设备状态", title: "设备状态",
dataIndex: "channelCount", dataIndex: "channelCount",
key: "state", key: "state",
render: (_, r, index) => {
let status = r.gbCamera;
return (
<div>
<span
style={{
width: 8,
height: 8,
display: "inline-block",
borderRadius: "50%",
backgroundColor: r.forbidden ? "red" : status ? colorStatus(status.online) : "",
margin: "0 8px 0 0",
}}
/>
{r.forbidden ? "禁用" : status ? equipmentStatus(status.online) : ""}
</div>
);
},
}, },
{ {
title: "云台支持", title: "云台支持",
@ -696,6 +761,7 @@ const CameraHeader = (props) => {
addNvr={addNvr} addNvr={addNvr}
nvrNumber={nvrNumber} nvrNumber={nvrNumber}
parentCamera={parentCamera} parentCamera={parentCamera}
axyData={axyData}
close={() => { close={() => {
setCameraModal(false); setCameraModal(false);
setCameraData({}); setCameraData({});
@ -703,6 +769,7 @@ const CameraHeader = (props) => {
setParentCamera("") setParentCamera("")
setAddNvr(false) setAddNvr(false)
setNvrNumber("") setNvrNumber("")
setAxyData("")
equipmentGetCamera(); equipmentGetCamera();
}} }}
modalName={modalName} modalName={modalName}
@ -710,8 +777,13 @@ const CameraHeader = (props) => {
) : ( ) : (
"" ""
)} )}
{ {videoPlay ?
// <VideoPlayModal visible={true} /> <VideoPlayModal
visible={true}
close={() => {
setVideoPlay(false)
}} />
: ""
} }
</> </>
); );

50
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -45,7 +45,6 @@ const NvrHeader = (props) => {
const nvrRef = useRef(); // const nvrRef = useRef(); //
useEffect(() => { useEffect(() => {
console.log(props)
dispatch(actions.equipmentWarehouse.getVender()).then((res) => { dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
setvenderList(res.payload.data); setvenderList(res.payload.data);
attribute(res.payload.data); attribute(res.payload.data);
@ -67,28 +66,31 @@ const NvrHeader = (props) => {
dispatch(equipmentWarehouse.getNvr({ ...query, ...search })); dispatch(equipmentWarehouse.getNvr({ ...query, ...search }));
} }
const equipmentStatus = { function equipmentStatus (data) {
ON: "在线", switch (data) {
ONLINE: "在线", case "ON":
OFF: "离线", return "在线"
Alarmed: "未知", case "ONLINE":
}; return "在线"
case "OFF":
const colorStatus = { return "离线"
ON: "#04B234", default:
ONLINE: "#04B234", return "未知"
OFF: "rgba(0, 0, 0, 0.45)", }F
Alarmed: "#1859C1", }
};
// function colorStatus (data) {
// switch (data) {
// case ON || ONLINE:
// break;
// default:
// break;
// }
// } function colorStatus (data) {
switch (data) {
case "ON":
return "#04B234"
case "ONLINE":
return "#04B234"
case "OFF":
return "rgba(0, 0, 0, 0.45)"
default:
return "#1859C1"
}
}
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
@ -205,11 +207,11 @@ const NvrHeader = (props) => {
height: 8, height: 8,
display: "inline-block", display: "inline-block",
borderRadius: "50%", borderRadius: "50%",
backgroundColor: colorStatus[status.online], backgroundColor: status ?colorStatus(status.online):"",
margin: "0 8px 0 0", margin: "0 8px 0 0",
}} }}
/> />
{status ? equipmentStatus[status.online] : ""} {status ? equipmentStatus(status.online) : ""}
</div> </div>
); );
}, },

1
code/VideoAccess-VCMP/web/package.json

@ -64,6 +64,7 @@
"moment": "^2.29.3", "moment": "^2.29.3",
"npm": "^7.20.6", "npm": "^7.20.6",
"perfect-scrollbar": "^1.5.5", "perfect-scrollbar": "^1.5.5",
"qs": "^6.10.5",
"screenfull": "5.2.0", "screenfull": "5.2.0",
"socket.io-client": "^4.5.0", "socket.io-client": "^4.5.0",
"socket.io-parser": "^4.2.0", "socket.io-parser": "^4.2.0",

Loading…
Cancel
Save