diff --git a/code/VideoAccess-VCMP/web/client/assets/images/background/blue.png b/code/VideoAccess-VCMP/web/client/assets/images/background/blue.png new file mode 100644 index 0000000..5c1500a Binary files /dev/null and b/code/VideoAccess-VCMP/web/client/assets/images/background/blue.png differ diff --git a/code/VideoAccess-VCMP/web/client/assets/images/background/green.png b/code/VideoAccess-VCMP/web/client/assets/images/background/green.png new file mode 100644 index 0000000..e3eb532 Binary files /dev/null and b/code/VideoAccess-VCMP/web/client/assets/images/background/green.png differ diff --git a/code/VideoAccess-VCMP/web/client/assets/images/background/grey.png b/code/VideoAccess-VCMP/web/client/assets/images/background/grey.png new file mode 100644 index 0000000..057bd4f Binary files /dev/null and b/code/VideoAccess-VCMP/web/client/assets/images/background/grey.png differ diff --git a/code/VideoAccess-VCMP/web/client/assets/images/background/red.png b/code/VideoAccess-VCMP/web/client/assets/images/background/red.png new file mode 100644 index 0000000..a5a34bf Binary files /dev/null and b/code/VideoAccess-VCMP/web/client/assets/images/background/red.png differ diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx index 68cf5f8..4b458a5 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx @@ -23,7 +23,8 @@ function cameraModal (props) { modify, parentCamera, addNvr, - nvrNumber + nvrNumber, + axyData, } = props; const { equipmentWarehouse } = actions; const fluoriteRef = useRef(); @@ -51,6 +52,9 @@ function cameraModal (props) { dispatch(equipmentWarehouse.getCameraKind()); dispatch(equipmentWarehouse.getAbility()); cameraData.type == "nvr" || addNvr ? setcameraList(cameraList.slice(1, 4)) : ""; + // if(){ + + // } }, []); const cameraList = [ //循环摄像头列表 diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx index 877c3ac..3c50916 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx +++ b/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, }) ).then((res) => { + console.log(res) let oneData = res.payload.data[0]; let modifyData = res.payload.data.find( (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.change = false; - item.support = false; + // item.change = false; + // item.support = false; if (item.camera) { item.name = item.camera.name; } 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 cf4ef15..ec3f055 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 @@ -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 ( 污水管理出出口 + : <>智慧设备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 ( -
-
{v.name}
-
{item.structure.name}
-
{item.name}
-
{item.factor.name}
-
- ); - }); - }) + ? nvrDetails.station.length == 0 + ? "" + : nvrDetails.station.map((item, index) => { + return item.structure.projects.map((v, i) => { + return ( +
+
{v.name}
+
{item.structure.name}
+
{item.name}
+
{item.factor.name}
+
+ ); + }); + }) : ""} @@ -311,7 +331,7 @@ function SideSheets (props) { - {`${nvrDetails[item.key]},${nvrDetails.longitude}`} + {nvrDetails.latitude ? `${nvrDetails[item.key]},${nvrDetails.longitude}` : "未知"} ); @@ -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] : ""} ); @@ -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( diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx index 58242e9..66e8e5a 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect, useRef } from "react"; import { connect } from "react-redux"; import moment from "moment"; +import qs from "qs"; import { Button, Form, @@ -25,6 +26,7 @@ import { accessType } from "./nvr"; const CameraHeader = (props) => { const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props; const [cameraModal, setCameraModal] = useState(false); + const [videoPlay, setVideoPlay] = useState(false); const [modalName, setModalName] = useState(""); const [setup, setSetup] = useState(false); const [sideSheet, setSideSheet] = useState(false); @@ -39,6 +41,7 @@ const CameraHeader = (props) => { const [parentCamera, setParentCamera] = useState(""); //级联摄像头父级设备 const [addNvr, setAddNvr] = useState(false); //nvr页面传递参数打开NVR摄像头添加弹框 const [nvrNumber, setNvrNumber] = useState(); + const [axyData, setAxyData] = useState(); const { equipmentWarehouse } = actions; const api = useRef(); const searchb = useRef(search) @@ -47,13 +50,19 @@ const CameraHeader = (props) => { useEffect(() => { console.log(props) + //安心云传参 + let isAxyData = props.location.search + + if (isAxyData) { + setAxyData(qs.parse(isAxyData.slice(1))) + setCameraModal(true) + } + //NVR传来的参数 if (props.location.query) { setAddNvr(props.location.query.addNvr) setNvrNumber(props.location.query.serialNo) setCameraModal(true); } - - dispatch(actions.equipmentWarehouse.getVender()).then((res) => { setvenderList(res.payload.data); attribute(res.payload.data); @@ -74,8 +83,31 @@ const CameraHeader = (props) => { function equipmentGetCamera () { 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 = [ { title: "序号", @@ -123,6 +155,7 @@ const CameraHeader = (props) => { width: "20%", dataIndex: "", render: (_, row) => { + console.log(row) return (
+ + {/* */}
); }, diff --git a/code/VideoAccess-VCMP/web/package.json b/code/VideoAccess-VCMP/web/package.json index 929b5f3..8916608 100644 --- a/code/VideoAccess-VCMP/web/package.json +++ b/code/VideoAccess-VCMP/web/package.json @@ -64,6 +64,7 @@ "moment": "^2.29.3", "npm": "^7.20.6", "perfect-scrollbar": "^1.5.5", + "qs": "^6.10.5", "screenfull": "5.2.0", "socket.io-client": "^4.5.0", "socket.io-parser": "^4.2.0",