From 9958510f5c6e2e85b8a083a9abdd4a5e2ad487b6 Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 20 Jun 2022 17:15:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BB=8E=E5=AE=89=E5=BF=83=E4=BA=91?= =?UTF-8?q?=E5=9B=9B=E4=B8=AA=E6=91=84=E5=83=8F=E5=A4=B4=E7=9A=84=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=A7=86=E9=A2=91=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=AF=B9=E5=BA=94=E7=9A=84=E6=91=84=E5=83=8F=E5=A4=B4?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=2050%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/assets/images/background/blue.png | Bin 0 -> 3116 bytes .../client/assets/images/background/green.png | Bin 0 -> 3116 bytes .../client/assets/images/background/grey.png | Bin 0 -> 3116 bytes .../client/assets/images/background/red.png | Bin 0 -> 3116 bytes .../components/cameraModal.jsx | 6 +- .../components/nvrCamera.jsx | 5 +- .../components/sideSheet.jsx | 83 ++++++++++------- .../equipmentWarehouse/containers/camera.jsx | 84 ++++++++++++++++-- .../equipmentWarehouse/containers/nvr.jsx | 50 ++++++----- code/VideoAccess-VCMP/web/package.json | 1 + 10 files changed, 163 insertions(+), 66 deletions(-) create mode 100644 code/VideoAccess-VCMP/web/client/assets/images/background/blue.png create mode 100644 code/VideoAccess-VCMP/web/client/assets/images/background/green.png create mode 100644 code/VideoAccess-VCMP/web/client/assets/images/background/grey.png create mode 100644 code/VideoAccess-VCMP/web/client/assets/images/background/red.png 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 0000000000000000000000000000000000000000..5c1500a474113d60888263dfaa51557e83922eda GIT binary patch literal 3116 zcmcK6eM}Q)7y$6|N^2>i*B1Q1qGttx4FRhtDyBe+YfT5Pl9~}U*UB_ejA;CTh(<*k ziAMYwi!~yP{vjHbq$L@1m|dCMM2RsZi*q4MXf_iQw0;}01>fWKCC?x4A9sIv>GgRp z?R&p_pQq3DnpT&6m8eV6F$|OFu-jZHN@JZ?h2C!tS({PNdNx)#QJjT##@+hl6$+KB zofV}hPX9LaIbM5A;$n36)LpK!HOw>SW;=g>oBlz?0fA;-5`1tMn zpX{lN&=*rS;Y&nAeErg3Y@5I&F-*bjhFWwq-(f4R&_3KK6lto>7K^!B_@OhKvp4*0 z4hTG3b+_oOrQMmPw*PZ-QiF z03Z$n+1*}mcQ)^9FW`={{_e0K-V=F^r)drWI^yECJr1~}t0sV&4(P?S2mmw~=qoHK zDeU8YKjv{-)?e5oh`)(^oF{%9I8~*(K6`h@NdQcw15x)o4FI$laGL7tO-^2uYvrD^ zep6HsL!vm*^I{yR;n=^1+kOoJfTTx?c*8YF|DzHek{akRaC~Upx}oE|CSwU#!}^B? z1o6Hosy#c#0ap#1Tz=>23N)3ZC;^QL0)S{RIS7DB3Rd8~2#hXGl?qC>283z|w&q^ASiGgTe{3>c8r2glg9Ish2yK&UTQt1Gf zFxUuySs0Mj$(gkW-DoPQ!E8DZYqeAZfLE}B{L$~E!V+K(9Wd54{RaTEk{UEVY6HMr zIxrHclx`yAW|xKmS)F_-{Iw4N>2$!Dp1BtQ^DrQ*ldpuIO8-?PMHzHpB>3S105UNk ztCKUVCAR^PMF))H-5vmZpk0a=~=AUU=Y0J(HvMAy{?fIJMy>g3_blh*)PKnDy7Q`!Mw!GNqzF7Nt93xI`m zV6=6h7yyeDtiV;Sm7dv1k@M+*VeJj+o=b|nSV0Y1@;hOQme7IG(Efe^6ktGBCzpBu l??zL}3YO9VL%?|g0Lw5StCMZs(hfA0ag>(XZj=azKLY48=KBBu literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..e3eb5327dc601d64e17e7825242e6e4c93cfd75f GIT binary patch literal 3116 zcmcK6Z%h+s7y$6|`iD|vUR&@F7C9>jC<1mcnPLj0xYktAN@_yXTq|?YVTQ|=LBvI6 zG!o4~H;gqh41N%eO45>uit)g|C^3e_I2W>nW-~FtRkx`bwy^hj_mbzs`{C}xF1PyNbWv6-1?<}Iq%Fb8q<9vFC69 zx#CDIKwnJRi7yci@%2lC>1`I1#4ts-o9fZg3a7oaO80b!P@=81Sgn>?;Y4o^=V)`fT-Tn z4gfUTM` z6%X_NGx?m34HORw;w_O^d*f$-V>PNvXlvVqW1mcP-W&h`NskoqhHH>~FG?k<%0gVX)fM_T=1c2EJR^Ya6cLE@h4j39f8v?)w3Tn_^ z9)>BJLkFUfULF7(24ww;4zjl0XevpOfevtgsPX||#DJ_mIKp-|0Kh~CV)c)o0U!wj zxR-gq)XS=X)XRe+uksG@qz}TQnj5W=HxNjs16;7{ECA*zSizF6Z(pOSBt`S+KrDUl zdH~E4r?s{cm*pcocdHMECCkN0aHWEZve0;sX_CzP5>;S z1Cx^13~UmFbIHU3RZCB%OUA;hpb>Z9hmeikUk+b$Wc&(?2*Gy0kDD&m`;Db z2>`hmkk!eLlVj@ukVgk5^?iK+$j5-JPM(Oo_!|H#>3}g|PB#Fo7?9P;m3`NB0Qis& zOm&Qw0-!*_3fz@C>6wibxsVPRw_KL)xunP+DX2kvVJ}S4DmpMVuzv&qMHrCP$rZle l`_WXgf{*EdG3fdp0IM+|tCQ`%@*Xsmah6xuFP902{slMy-jo0U literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..057bd4fdbe726e95cfb54d0518e6909bf49918c6 GIT binary patch literal 3116 zcmcK6Z%h+s7y$6|N^2=HuPyioi=Gt(6oGXznX(i}*;>Ka3|rWHynD&>;r(#;VV7Lr zw`rgIz3=n%xn9$jlF#FHNjipM;vIII3ysoTr&XcXYZKNMG-y3L%bjRkj!wqiKK>dF z6 zc((Fx!6{3pGevEGdUQd9irF-#?t8h{n}q_&<>#S!?0+X3&@p>?{h7vkG|#T8EG$PO zJ4>*a*w$9|67TytfwMDy)+O+w$j5pd<{%f)Cg+qfcU)?{&0su@LI@ybodQI3?lu6# zU?8*C>+Q|teVuvSA=cj;62yBVukkdkBtTb8%(u@2E@{;SP}2dum=Xqn1_Q(SMMe3; zyzkc>PRsi92L$nk$j5kM=YV6Cs>>^WNIMFE`E(%Sey0I|76VRGeZ9%aYqG7}OV)3S z2x7k|&iA~U18O+-;Z(=y(P7nY@f{8%@EKslmmvx5&0P%D{U-$J806tJqgSO%j zOwmF*5D9nl0N^kn>sNGuweCWpBt?2Uz`aoA0Kk9&S$%Mr?WhBQkq$&_A3Om-0tRp| z^FFDUReq_L2Si@w8RAJFghthUE#bEiNTdT?;Osd7EK;z8RcC*Cg+fV+7Sn-f%AU;t zSfZc?ah9n~09Z-~xUB_?0FZT5gnLm zA1wsHdIdXhm1?DDHd5qVI$+p(MY`vbB7dx)25q_BFhv{az)b(X5dh?2KvpN0c>nB0 jp=1Z2&;dihc?19(F(9jxZQkN86v{Y?OKew)goFPAoqhBp literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..a5a34bf595df717dd915f88f1135e279774f8c98 GIT binary patch literal 3116 zcmcK6Z%h+s7y$6|N=qrC*A{eQ(X)bpL%=GEiYbtyt*M}u)P$(HR_2loBhDEiqEV4X zq7nSVvKkSCA4H>)v?QWpb}+YzBgT*{&V?+Y*-T7u^}i8Y*n7Ob`+)%nUL6@v!7$(7Cx4BT1#yYJEecm3iHld*PY%h1BI0wBMck8p)C{%24 zmY1OT+GP41uTy*8^rEAueD5mV#LP7DX_?tuckMrL=*Za?|K;nQ!CSxlHt_fG({~?k z+EbRIA13d>r-+95{H4LfHib!KnEZS7HE3^<4ri*`{#WzVdKI&3Sbg`!es4BPB!{1Z#&MtCD4=cP@cQ!&b!eQkqq3+R zMRtNum<(Ig~;GY1Jt}MCWb+ zKnw=5dc5AAEZ*0V&mCj^Jt0B-UF0>M#(4zjjEUL#G~klXngD7#pchla0MKAyprE+8 zV1V~s%;mJKzo1VLe-`-|PuwJMs#0}*?%wof0L0RPi2J<;09p(>s0TKS|dDnE_cIDdG*+Ann%*v`cEB!@!A=En7xT@S61HTs7+- z84|>YqNw)lo&;RgY*N|%=c`dF0pih^AOMI2lY#)4s$d2#>ox}f66k=w_UnECOjA&U zmXZ)$qUm%X67J#wz+phvRdkrOeuGlU66xsx_n#^k00s=m>VxBKTP*;LbRb&u=m`K4 zF@SrS_es61@=LwkC-N#!KTrA~G^D=U6n+bVBs#za+AjfMhJqQ)Z$J1FrIIC@Ne7~- zyVn8W3k5ZZw~Vd=z$`kzZ7!SvfMg8F>f~2%o2~+2HXVreo*4?Me^xix1H0x5KW ziyv+Pz#I(7>g0@?LvEBxYA}}$L|ZLY0N@qOAaDFDsjvi?M+c0xjsF0^tfU4FPuc)5 zpAL+LE2NtUx!I*+KvpMT3a$46AdLx%;|`g@mvmsvJxltA)F4Yi4KfFhJqExcI$%8i z?M47(V?b6XKT3+O0YDBN7}Irk10WXzvO0M*{Ok { + 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", From 26a9ff2b1f507718998a7f60c223b7063aea0e0b Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 20 Jun 2022 17:28:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/VideoAccess-VCMP/api/app/lib/models/camera.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/VideoAccess-VCMP/api/app/lib/models/camera.js b/code/VideoAccess-VCMP/api/app/lib/models/camera.js index 6912d71..0168a47 100644 --- a/code/VideoAccess-VCMP/api/app/lib/models/camera.js +++ b/code/VideoAccess-VCMP/api/app/lib/models/camera.js @@ -246,7 +246,16 @@ module.exports = dc => { key: "id", model: "secretYingshi" } - } + }, + gbId: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "gb_id", + autoIncrement: false, + }, }, { tableName: "camera", comment: "", From d1dbeeccae5a08ba470720abf304abcf6398dfcf Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 20 Jun 2022 17:32:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E6=8E=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentWarehouse/containers/camera.jsx | 12 ------------ 1 file changed, 12 deletions(-) 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 66e8e5a..d0787ce 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 @@ -179,18 +179,6 @@ const CameraHeader = (props) => { 修改 - - {/* */}