From 70080015d77a34a0cb4adcc310cf0b0e78ae7826 Mon Sep 17 00:00:00 2001 From: wenlele Date: Thu, 19 May 2022 10:54:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=92=8C=E6=9F=A5=E8=AF=A2=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/.vscode/extensions.json | 5 + .../equipmentWarehouse/components/setup.jsx | 8 +- .../components/sideSheet.jsx | 629 ++++++++++-------- .../equipmentWarehouse/containers/camera.jsx | 10 +- .../equipmentWarehouse/containers/nvr.jsx | 7 +- 5 files changed, 388 insertions(+), 271 deletions(-) create mode 100644 code/VideoAccess-VCMP/web/.vscode/extensions.json diff --git a/code/VideoAccess-VCMP/web/.vscode/extensions.json b/code/VideoAccess-VCMP/web/.vscode/extensions.json new file mode 100644 index 0000000..0925499 --- /dev/null +++ b/code/VideoAccess-VCMP/web/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "formulahendry.code-runner" + ] +} \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx index e560110..942c765 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx @@ -24,12 +24,12 @@ function Setup(props) { useEffect(() => { //获取是否勾选信息 - const ISgetItem1 = localStorage.getItem(SETUPS); - const ISgetItem2 = localStorage.getItem(CAMERAS); + const nvrItem = localStorage.getItem(SETUPS); + const cameraItem = localStorage.getItem(CAMERAS); if (cameraSetup) { - setCheck(ISgetItem2 ? JSON.parse(ISgetItem2) : []); + setCheck(cameraItem ? JSON.parse(cameraItem) : []); } else { - setCheck(ISgetItem1 ? JSON.parse(ISgetItem1) : []); + setCheck(nvrItem ? JSON.parse(nvrItem) : []); } ischeck(); }, []); 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 4e55e79..1e68740 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 @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { SideSheet, Tabs, TabPane } from "@douyinfe/semi-ui"; +import { SideSheet, Tabs, TabPane, Button } from "@douyinfe/semi-ui"; import copy from "copy-to-clipboard"; function SideSheets(props) { @@ -19,270 +19,102 @@ function SideSheets(props) { name: "项目名称", a: "南昌县智慧环保", b: "南昌县智慧环保", - c: "南昌市市政隧道综合管理平台cbj次哦爱吃此课程实地考察大检查的吃点【", + c: "南昌市市政隧道综合管理 哦哦哦哦哦 哦哦哦哦 哦哦哦哦 哦哦哦哦哦哦哦哦哦 哦", d: "C", }, { name: "关联结构物", a: "a", b: "B", c: "C", d: "C" }, { name: "关联测点", a: "a", b: "B", c: "C", d: "C" }, { name: "关联监测因素", a: "a", b: "B", c: "C", d: "C" }, ]; - const IFname = [ - { name: "设备名称:", value: "消火栓呼呼呼呼" }, - { name: "设备编号:", value: "D50F2049010B" }, - { name: "接入方式:", value: "NJBJ858G68H" }, - { name: "厂商:", value: "哇哇哇哇哇" }, - { name: "添加账号:", value: "Superadmin" }, - { name: "添加时间:", value: "2022-09-09" }, - { name: "行政区别:", value: "江西省-南昌市-南昌县" }, - { - name: "设备安装位置:", - value: "江西省南昌县小蓝经开区江西飞尚科技有限公司", - }, - { name: "SIP服务编号:", value: "1111111111" }, - { name: "SIP域:", value: "KGU876J87" }, - { name: "SIP端口号:", value: "KGU876J87" }, - { name: "通道数量:", value: "16通道" }, - { name: "心跳周期:", value: "3600s" }, - { name: "最大心跳次数:", value: "3次" }, - { name: "注册密码:", value: "**********" }, - { name: "注册有效期::", value: "3600s" }, - { name: "接入识别模块:", value: "sssss" }, - { - name: "通道1", - value1: "145641201564-1", - value2: "哦哦哦我我我喔噢喔喔我", - }, - { name: "通道2", value1: "145641201564-2", value2: "哦哦哦哦哦噢噢欧欧哦" }, - ]; - const sewage = [ - { name: "设备名称:", value: "消火栓呼呼呼呼" }, - { name: "SIP编号/设备编号:", value: "D50F2049010B" }, - { name: "接入方式:", value: "NJBJ858G68H" }, - { name: "厂商:", value: "哇哇哇哇哇" }, - { name: "添加账号:", value: "Superadmin" }, - { name: "添加时间:", value: "2022-09-09" }, - { - name: "设备安装位置:", - value: "江西省南昌县小蓝经开区江西飞尚科技有限公司", - }, - { name: "HLS地址", value: "" }, - { name: "FLV地址", value: "" }, - { name: "RTMP地址", value: "" }, - { name: "EZOPEN地址", value: "" }, - { name: "ONVIF地址", value: "" }, - { name: "云储存地址", value: "" }, - { name: "本地储存地址", value: "" }, - ]; - function pp() { - let str = []; - for (let i = 0; i < (cameraSetup ? sewage : IFname).length; i++) { - if (i === 0) { - str.push( -
- 基础信息 -
- ); - } - if (cameraSetup ? i == 7 : i == 8) { - str.push( -
- 1 -
- {cameraSetup ? "复制直播地址" : "接入信息"} -
-
- ); - } - if (cameraSetup ? i == 12 : i == 17) { - str.push( -
- 1 -
- {cameraSetup ? "复制回收地址" : "摄像头信息"} -
-
- ); - } - if ( - cameraSetup ? 0 <= i && i < 6 : (0 <= i && i < 6) || (i > 7 && i <= 16) - ) { - str.push( -
- - {(cameraSetup ? sewage : IFname)[i].name} - - - {(cameraSetup ? sewage : IFname)[i].value} - -
- ); - } - if (cameraSetup ? i == 6 : i > 5 && i < 8) { - str.push( -
- - {(cameraSetup ? sewage : IFname)[i].name} - - - {(cameraSetup ? sewage : IFname)[i].value} - -
- ); - } - if (cameraSetup ? i > 6 && i < 14 : i > 16) { - str.push( -
{ - copy(sewage[i].name); - // alert("复制成功"); - setclickStyle(sewage[i].name); - } - : "" - } - > -
- -
- {cameraSetup ? ( - <> - {sewage[i].name} - - - ) : ( - IFname[i].name - )} -
-
- {cameraSetup ? ( - "" - ) : ( - <> -

{IFname[i].value1}

-

- {IFname[i].value2} -

- - )} -
- ); - } - } - return str; - } + const information = { + nvr: [ + { + name: "基础信息", + basics: [ + { name: "设备名称:", value: "消火栓呼呼呼呼" }, + { name: "设备编号:", value: "D50F2049010B" }, + { name: "接入方式:", value: "NJBJ858G68H" }, + { name: "厂商:", value: "哇哇哇哇哇" }, + { name: "添加账号:", value: "Superadmin" }, + { name: "添加时间:", value: "2022-09-09" }, + { + name: "行政区别:", + value: "江西省-南昌市-南昌县", + difference: "difference", + }, + { + name: "设备安装位置:", + value: "江西省南昌县小蓝经开区江西飞尚科技有限公司", + difference: "line", + }, + ], + }, + { + name: "接入信息", + access: [ + { name: "SIP服务编号:", value: "1111111111" }, + { name: "SIP域:", value: "KGU876J87" }, + { name: "SIP端口号:", value: "KGU876J87" }, + { name: "通道数量:", value: "16通道" }, + { name: "心跳周期:", value: "3600s" }, + { name: "最大心跳次数:", value: "3次" }, + { name: "注册密码:", value: "**********" }, + { name: "注册有效期::", value: "3600s" }, + { name: "接入识别模块:", value: "sssss" }, + ], + }, + { + name: "摄像头信息", + CameraInformation: [ + { + name: "通道1", + value1: "145641201564-1", + value2: "哦哦哦我我我喔噢喔喔我", + }, + { + name: "通道2", + value1: "145641201564-2", + value2: "哦哦哦哦哦噢噢欧欧哦", + }, + ], + }, + ], + camera: [ + { + name: "基础信息", + basics: [ + { name: "设备名称:", value: "消火栓呼呼呼呼" }, + { name: "SIP编号/设备编号:", value: "D50F2049010B" }, + { name: "接入方式:", value: "NJBJ858G68H" }, + { name: "厂商:", value: "哇哇哇哇哇" }, + { name: "添加账号:", value: "Superadmin" }, + { name: "添加时间:", value: "2022-09-09" }, + { + name: "设备安装位置:", + value: "江西省南昌县小蓝经开区江西飞尚科技有限公司", + difference: "line", + }, + ], + }, + { + name: "复制直播地址", + liveBroadcast: [ + { name: "HLS地址", value: "" }, + { name: "FLV地址", value: "" }, + { name: "RTMP地址", value: "" }, + { name: "EZOPEN地址", value: "" }, + { name: "ONVIF地址", value: "" }, + ], + }, + { + name: "复制回收地址", + recovery: [ + { name: "云储存地址", value: "" }, + { name: "本地储存地址", value: "" }, + ], + }, + ], + }; const styles = { width: 180, height: 64, @@ -349,7 +181,284 @@ function SideSheets(props) { - {pp()} + {(cameraSetup ? information.camera : information.nvr).map( + (item, index) => { + let str = []; + if (index > 0) { + str.push( + 无法显示 + ); + } + str.push( +
+ {item.name} + {cameraSetup ? ( + index == 1 ? ( +
+ + +
+ ) : ( + "" + ) + ) : ( + "" + )} +
+ ); + //基础信息 + if (index == 0) { + item.basics.map((item, index) => { + if (item.difference == "line") { + str.push( +
+ + {item.name} + + + {item.value} + +
+ ); + } else { + str.push( +
+ + {item.name} + + + {item.value} + +
+ ); + } + return str; + }); + } + //接入信息/复制直播地址 + if (index == 1) { + (cameraSetup ? item.liveBroadcast : item.access).map( + (item, index) => { + if (cameraSetup) { + str.push( +
{ + copy(item.name); + // alert("复制成功"); + setclickStyle(item.name); + }} + > + +
+ {item.name} + +
+
+ ); + } else { + str.push( +
+ + {item.name} + + + {item.value} + +
+ ); + } + return str; + } + ); + } + //摄像头信息/复制回收地址 + if (index == 2) { + (cameraSetup ? item.recovery : item.CameraInformation).map( + (item, index) => { + if (cameraSetup) { + str.push( +
{ + copy(item.name); + // alert("复制成功"); + setclickStyle(item.name); + }} + > + +
+ {item.name} + +
+
+ ); + } else { + str.push( +
+
+ +
+ {item.name} +
+
+

+ {item.value1} +

+

+ {item.value2} +

+
+ ); + } + return str; + } + ); + } + + return str; + } + )}
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 a9b8616..92c6c1a 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 @@ -26,10 +26,12 @@ const CameraHeader = (props) => { setvenderList(res.payload.data); }); //初始化表格显示设置 - localStorage.setItem( - CAMERAS, - JSON.stringify(["state", "type", "manufactor"]) - ); + localStorage.getItem(CAMERAS) == null + ? localStorage.setItem( + CAMERAS, + JSON.stringify(["state", "type", "manufactor"]) + ) + : ""; attribute(); }, []); diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx index f29141a..936acf8 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx @@ -23,10 +23,12 @@ const NvrHeader = (props) => { setvenderList(res.payload.data); }); //初始化表格显示设置 - localStorage.setItem(SETUPS, JSON.stringify(["a", "c", "d", "e"])); + localStorage.getItem(SETUPS) == null + ? localStorage.setItem(SETUPS, JSON.stringify(["a", "c", "d", "e"])) + : ""; + // ; attribute(); }, []); - useEffect(() => { equipmentGetNvr(); }, [query]); @@ -441,7 +443,6 @@ const NvrHeader = (props) => { 共{equipmentWarehouseNvr.total}个设备 Date: Thu, 19 May 2022 15:12:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8E=82=E5=AE=B6?= =?UTF-8?q?=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/equipmentWarehouse/components/nvrModal.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx index b849127..f27cdec 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx @@ -135,7 +135,10 @@ function nvrModal(props){ ]}/> - + {vender.map((item,index)=>( {item.name} ))}