+ 表格属性设置
+
+ {check.length}/8
+
+
+ }
visible={visible}
- style={{ width: 580 }}
+ style={{ width: 600 }}
onOk={() => {
- localStorage.setItem(SETUPS, JSON.stringify(checkeds));
+ cameraSetup
+ ? localStorage.setItem(CAMERAS, JSON.stringify(check))
+ : localStorage.setItem(SETUPS, JSON.stringify(check));
close();
}}
onCancel={() => {
@@ -42,14 +116,14 @@ function Setup(props) {
direction="horizontal"
defaultValue={check}
aria-label="表格属性设置"
- onChange={(checked) => {
- setCheckeds(checked);
+ onChange={(check) => {
+ setCheck(check);
+ ischeck();
}}
>
设备信息
-
-
- 设备厂家
-
-
- 添加账号
-
-
- 通道数
-
-
- 端口
-
-
- 设备状态
-
-
- 创建时间
-
+
+ {(cameraSetup ? equipmentCamera : equipmentNVR).map((item) => {
+ return (
+
+ {item.name}
+
+ );
+ })}
项目信息
-
-
- 项目名称
-
-
- things名称
-
-
- things数量
-
+
+ {(cameraSetup ? projectCamera : projectNVR).map((item) => {
+ return (
+
+ {item.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 cdff1ca..4e55e79 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,16 +1,25 @@
import React, { useState, useEffect } from "react";
import { SideSheet, Tabs, TabPane } from "@douyinfe/semi-ui";
+import copy from "copy-to-clipboard";
function SideSheets(props) {
- const { dispatch, actions, user, loading, visible, close, SETUPS } = props;
- const [checkeds, setCheckeds] = useState([]);
- const [check, setCheck] = useState([]);
+ const {
+ dispatch,
+ actions,
+ user,
+ loading,
+ visible,
+ close,
+ SETUPS,
+ cameraSetup,
+ } = props;
+ const [clickStyle, setclickStyle] = useState();
const list = [
{
name: "项目名称",
a: "南昌县智慧环保",
b: "南昌县智慧环保",
- c: "南昌市市政隧道综合管理平台",
+ c: "南昌市市政隧道综合管理平台cbj次哦爱吃此课程实地考察大检查的吃点【",
d: "C",
},
{ name: "关联结构物", a: "a", b: "B", c: "C", d: "C" },
@@ -18,35 +27,276 @@ function SideSheets(props) {
{ name: "关联监测因素", a: "a", b: "B", c: "C", d: "C" },
];
const IFname = [
- "设备名称:",
- "设备编号:",
- "接入方式:",
- "厂商:",
- "添加账号:",
- "添加时间:",
- "行政区别:",
- "设备安装位置:",
- "SIP服务编号:",
- "SIP域:",
- "SIP端口号:",
- "通道数量:",
- "心跳周期:",
- "最大心跳次数:",
- "注册密码:",
- "注册有效期::",
- "接入识别模块:",
+ { 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: "" },
];
- console.log(IFname);
+ 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(
+
+
+
+ {cameraSetup ? "复制直播地址" : "接入信息"}
+
+
+ );
+ }
+ if (cameraSetup ? i == 12 : i == 17) {
+ str.push(
+
+
+
+ {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 styles = {
width: 180,
+ height: 64,
textAlign: "center",
- // background: "#FFFFFF",
background: "url(/assets/images/background/backGround.png)",
backgroundSize: "100% 100%",
- padding: "12px 17px",
+ padding: "12px 17px 12px 17px",
margin: "30px 0 0 10px",
- lineHeight: "20px",
- position: "relative",
+ lineHeight: "24px",
+ overflow: "hidden",
+ textOverflow: "ellipsis",
+ display: "-webkit-box",
+ WebkitLineClamp: "2",
+ WebkitBoxOrient: "vertical",
zIndex: 5,
};
@@ -55,7 +305,7 @@ function SideSheets(props) {
return (
{
@@ -65,7 +315,7 @@ function SideSheets(props) {
- {list.map((item) => {
+ {list.map((item, index) => {
return (
+
{item.name}
{item.a}
@@ -94,9 +349,7 @@ function SideSheets(props) {
- {IFname.map((item, index) => {
- return index;
- })}
+ {pp()}
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 050cba6..a9b8616 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,12 +1,203 @@
-import React, { useState, useEffect } from "react";
+import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux";
-import { Button, Form, Input, Row, Table } from "@douyinfe/semi-ui";
+import { Button, Form, Input, Row, Table, Pagination } from "@douyinfe/semi-ui";
import "../style.less";
import CameraModal from "../components/cameraModal";
+import NvrModal from "../components/nvrModal";
+import Setup from "../components/setup";
+import SideSheets from "../components/sideSheet";
const CameraHeader = (props) => {
- const [cameraModal,setCameraModal] = useState(false)
- const [modalName,setModalName] = useState('')
+ const { dispatch, actions, user, loading, equipmentWarehouseNvr } = props;
+ const [cameraModal, setCameraModal] = useState(false);
+ const [modalName, setModalName] = useState("");
+ const [setup, setSetup] = useState(false);
+ const [sideSheet, setSideSheet] = useState(false);
+ const [cameraSetup, setcameraSetup] = useState(false);
+ const [setupp, setSetupp] = useState([]);
+ const [venderList, setvenderList] = useState([]); //厂商信息
+ const [query, setQuery] = useState({ limit: 10, page: 0 });
+ const { equipmentWarehouse } = actions;
+ const api = useRef();
+ const CAMERAS = "cameras";
+
+ useEffect(() => {
+ dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
+ setvenderList(res.payload.data);
+ });
+ //初始化表格显示设置
+ localStorage.setItem(
+ CAMERAS,
+ JSON.stringify(["state", "type", "manufactor"])
+ );
+ attribute();
+ }, []);
+
+ useEffect(() => {
+ equipmentGetNvr();
+ }, [query]);
+
+ function equipmentGetNvr() {
+ dispatch(equipmentWarehouse.getNvr(query));
+ }
+ const columns = [
+ {
+ title: "序号",
+ render: (text, record, index) => {
+ return index + 1;
+ },
+ },
+ {
+ title: "设备名称",
+ dataIndex: "name",
+ render: (text, record, index) => {
+ return (
+
+
+ {record.name}
+
+ );
+ },
+ },
+
+ {
+ title: "操作",
+ width: "20%",
+ dataIndex: "",
+ render: (_, row) => {
+ // console.log(row);
+ return (
+
+
+
+
+
+
+
+ );
+ },
+ },
+ ];
+
+ //获取表格属性设置
+ function attribute() {
+ const arr = localStorage.getItem(CAMERAS)
+ ? JSON.parse(localStorage.getItem(CAMERAS))
+ : [];
+
+ const column = [
+ {
+ title: "设备厂家",
+ dataIndex: "venderId",
+ key: "manufactor",
+ },
+ {
+ title: "接入类型",
+ dataIndex: "createUserId",
+ key: "type",
+ },
+ {
+ title: "设备状态",
+ dataIndex: "channelCount",
+ key: "state",
+ },
+ {
+ title: "云台支持",
+ dataIndex: "port",
+ key: "support",
+ },
+ {
+ title: "内存卡信息",
+ dataIndex: "size",
+ key: "memoryCard",
+ },
+ {
+ title: "设备创建时间",
+ dataIndex: "createTime",
+ key: "time",
+ },
+ {
+ title: "设备添加账号",
+ dataIndex: "size",
+ key: "account",
+ },
+ {
+ title: "项目名称",
+ dataIndex: "updateTime",
+ key: "name",
+ },
+ {
+ title: "pcode",
+ dataIndex: "updateTime",
+ key: "pcode",
+ },
+ {
+ title: "结构物",
+ dataIndex: "updateTime",
+ key: "structure",
+ },
+ {
+ title: "测点",
+ dataIndex: "updateTime",
+ key: "measuringPoint",
+ },
+ {
+ title: "监测因素",
+ dataIndex: "updateTime",
+ key: "factor",
+ },
+ ];
+ for (let i = 0; i < arr.length; i++) {
+ let colum = column.filter((item) => {
+ return item.key === arr[i];
+ });
+ columns.splice(i + 2, 0, colum[0]);
+ }
+ setSetupp(columns);
+ }
+
+ //条件赛选样式
+ const screen = {
+ width: 193,
+ marginRight: 20,
+ marginBottom: 16,
+ color: "rgba(0, 0, 0, 0.65)",
+ };
+
return (
<>
@@ -52,7 +243,7 @@ const CameraHeader = (props) => {
cursor: "pointer",
}}
onClick={() => {
- setModalName('add')
+ setModalName("add");
setCameraModal(true);
}}
>
@@ -60,25 +251,289 @@ const CameraHeader = (props) => {
- {cameraModal?
- {
- setCameraModal(false);
- // setEditData(null)
- }}
- modalName={modalName} />:''}
+
+
+
+ 筛选条件
+
+
+
+
+ 111
+ 111111
+
+
+ {venderList.map((item) => {
+ return (
+
+ {item.name}
+
+ );
+ })}
+
+
+ 在线
+ 离线
+
+ {/*
+
+ 飞尚科技1
+
+
+ 飞尚科技2
+
+ */}
+
+
+
+
+
+
+
+
+
+
+ 设备列表
+
+
+
+
+
+
+
+
+
+ 共{equipmentWarehouseNvr.total}个设备
+
+
{
+ setQuery({ limit: pageSize, page: currentPage - 1 });
+ }}
+ />
+
+
+ {setup ? (
+
{
+ setSetup(false);
+ attribute();
+ setcameraSetup(false);
+ }}
+ />
+ ) : (
+ ""
+ )}
+
+ {sideSheet ? (
+ {
+ setSideSheet(false);
+ setcameraSetup(false);
+ }}
+ />
+ ) : (
+ []
+ )}
+
+
+ {cameraModal ? (
+ {
+ setCameraModal(false);
+ // setEditData(null)
+ }}
+ modalName={modalName}
+ />
+ ) : (
+ ""
+ )}
>
);
};
function mapStateToProps(state) {
- const { auth, global, members } = state;
+ const { auth, global, members, equipmentWarehouseNvr } = state;
return {
loading: members.isRequesting,
user: auth.user,
actions: global.actions,
members: members.data,
+ equipmentWarehouseNvr: equipmentWarehouseNvr.data || [],
};
}
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 f3bac4a..f29141a 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
@@ -1,5 +1,6 @@
-import React, { useState, useEffect } from "react";
+import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux";
+import moment from "moment";
import { Button, Form, Input, Row, Table, Pagination } from "@douyinfe/semi-ui";
import "../style.less";
import NvrModal from "../components/nvrModal";
@@ -14,6 +15,7 @@ const NvrHeader = (props) => {
const [setupp, setSetupp] = useState([]);
const [venderList, setvenderList] = useState([]); //厂商信息
const [query, setQuery] = useState({ limit: 10, page: 0 });
+ const api = useRef();
const SETUPS = "setups";
useEffect(() => {
@@ -71,7 +73,7 @@ const NvrHeader = (props) => {
render: (_, row) => {
// console.log(row);
return (
- <>
+
-
- >
+
+
);
},
},
@@ -136,6 +143,9 @@ const NvrHeader = (props) => {
title: "创建时间",
dataIndex: "createTime",
key: "f",
+ render: (text, r, index) => {
+ return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
+ },
},
{
title: "项目名称",
@@ -250,11 +260,14 @@ const NvrHeader = (props) => {
{
label="厂家筛选:"
labelPosition="left"
style={screen}
- field="type1"
+ field="venderId"
placeholder="全部"
>
{venderList.map((item) => {
@@ -284,16 +297,20 @@ const NvrHeader = (props) => {
在线
离线
-
- 飞尚科技1
- 飞尚科技2
-
+
+ 飞尚科技1
+
+
+ 飞尚科技2
+
+ */}
{
marginBottom: 20,
marginRight: 20,
}}
- onClick={() => {}}
+ onClick={() => {
+ api.current.validate().then((values) => {
+ console.log(values);
+ console.log(
+ equipmentWarehouseNvr.data.filter((item) => {
+ return (
+ item.name.indexOf(values.name) > -1 &&
+ item.venderId === values.venderId
+ );
+ })
+ );
+ });
+ console.log(equipmentWarehouseNvr.data);
+ }}
>
搜素
@@ -414,10 +444,10 @@ const NvrHeader = (props) => {
className="22"
total={equipmentWarehouseNvr.total}
showSizeChanger
+ currentPage={query.page + 1}
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
- console.log(currentPage, pageSize);
}}
/>
diff --git a/code/VideoAccess-VCMP/web/package.json b/code/VideoAccess-VCMP/web/package.json
index aa18208..9638a48 100644
--- a/code/VideoAccess-VCMP/web/package.json
+++ b/code/VideoAccess-VCMP/web/package.json
@@ -60,12 +60,13 @@
"@vitejs/plugin-react": "^1.3.1",
"@vitejs/plugin-react-refresh": "^1.3.6",
"args": "^5.0.1",
+ "copy-to-clipboard": "^3.3.1",
"cross-env": "^7.0.3",
"fs-web-server-scaffold": "^1.0.6",
"koa-better-http-proxy": "^0.2.5",
"koa-proxy": "^1.0.0-alpha.3",
"koa-view": "^2.1.4",
- "moment": "^2.22.0",
+ "moment": "^2.29.3",
"npm": "^7.20.6",
"perfect-scrollbar": "^1.5.5",
"socket.io-client": "^4.5.0",