@@ -74,9 +74,15 @@ const NvrHeader = (props) => {
},
];
+ useEffect(() => {
+ localStorage.setItem(SETUPS, JSON.stringify(["a", "c", "d", "e"]));
+ dispatch(equipmentWarehouse.getNvr(pagination));
+ }, [pagination]);
+console.log(equipmentWarehouseNvr);
useEffect(() => {
attribute();
}, []);
+
//获取表格属性设置
function attribute() {
const arr = localStorage.getItem(SETUPS)
@@ -86,22 +92,22 @@ const NvrHeader = (props) => {
const column = [
{
title: "设备厂家",
- dataIndex: "size",
+ dataIndex: "venderId",
key: "a",
},
{
- title: "添加张账号",
- dataIndex: "size",
+ title: "添加账号",
+ dataIndex: "createUserId",
key: "b",
},
{
title: "通道数",
- dataIndex: "size",
+ dataIndex: "channelCount",
key: "c",
},
{
title: "端口",
- dataIndex: "size",
+ dataIndex: "port",
key: "d",
},
{
@@ -111,7 +117,7 @@ const NvrHeader = (props) => {
},
{
title: "创建时间",
- dataIndex: "size",
+ dataIndex: "createTime",
key: "f",
},
{
@@ -139,6 +145,7 @@ const NvrHeader = (props) => {
setSetupp(columns);
}
+ //条件赛选样式
const screen = {
width: 193,
marginRight: 20,
@@ -146,35 +153,6 @@ const NvrHeader = (props) => {
color: "rgba(0, 0, 0, 0.65)",
};
- const data = [
- {
- key: "1",
- name: "智能设备NVR1",
- nameIconSrc: "12",
- size: "飞尚科技1",
- owner: "192.168.1.1",
- updateTime: "5000",
- avatarBg: "red",
- },
- {
- key: "2",
- name: "智能设备NVR2",
- nameIconSrc: "8",
- size: "飞尚科技2",
- owner: "192.168.1.3",
- updateTime: "5001",
- avatarBg: "green",
- },
- {
- key: "3",
- name: "智能设备NVR3",
- nameIconSrc: "9",
- size: "飞尚科技3",
- owner: "192.168.1.2",
- updateTime: "5002",
- avatarBg: "green",
- },
- ];
return (
<>
@@ -386,14 +364,29 @@ const NvrHeader = (props) => {
+
+
共{equipmentWarehouseNvr.total}个设备
+
{
+ setPagination({limit:pageSize,page:currentPage-1})
+ console.log(currentPage,pageSize);
+ }}
/>
+
+
+
{setup ? (
{
close={() => {
setSetup(false);
attribute();
- // setEditData(null)
}}
- // reportType={reportType}
- // editData={editData}
/>
) : (
""
@@ -426,12 +416,13 @@ const NvrHeader = (props) => {
};
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/utils/webapi.js b/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
index e05f516..2b0a9b1 100644
--- a/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
+++ b/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
@@ -8,6 +8,8 @@ export const ApiTable = {
logout: 'logout',
getEnterprisesMembers: 'enterprises/{enterpriseId}/members',
+
+ getNvr:'nvr',
};
export const RouteTable = {
From ee8881a661b5b2acdcfdb72091db9d1a9b371e0f Mon Sep 17 00:00:00 2001
From: deartibers <947466799@qq.com>
Date: Fri, 6 May 2022 11:35:14 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9nvr?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/cameraModal.jsx | 22 +++++++++++----
.../components/nvrModal.jsx | 28 ++++++++++++-------
.../equipmentWarehouse/containers/nvr.jsx | 14 ++++------
3 files changed, 40 insertions(+), 24 deletions(-)
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 b837f96..f9cd3c6 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
@@ -1,8 +1,9 @@
import React, { useState ,useRef} from 'react'
+import { connect } from "react-redux";
import { Modal,Form,Row,Col,Spin,Notification,Button } from '@douyinfe/semi-ui';
import { IconChevronLeft,IconChevronRight } from '@douyinfe/semi-icons';
import "./cameraModal.less";
-function nvrModal(props){
+function cameraModal(props){
const { TextArea } = Form;
const {modalName,visible,close}=props
const form = useRef();
@@ -12,8 +13,8 @@ function nvrModal(props){
const [step,setstep] = useState(0)//第几步
const [okText,setokText] = useState('确定')//ok弹框text 右边
const [cancelText,setcancelText] = useState('取消')//取消弹框text 左边
- const [cloud,setcloud] = useState('')
- const [voice,setvoice] = useState('')
+ const [cloud,setcloud] = useState('')//云台支持
+ const [voice,setvoice] = useState('')//语音支持
const opts ={//添加完成确认后通知
title:'Hi',
content:'添加成功',
@@ -59,7 +60,7 @@ function nvrModal(props){
setcancelText('上一步');
setloading(false);
}, 2000);
- },2000)
+ }, 2000)
}, 2000);
})
.catch(errors=>{//表单校验失败
@@ -90,7 +91,7 @@ function nvrModal(props){
}
}
function handleLocation(){//高德经纬度
- console.log('handleLocationhandleLocation');
+ window.open('https://lbs.amap.com/tools/picker','_blank')
}
function handleChoose(id){//选择摄像头接入类型
setclickNum(id);
@@ -336,5 +337,14 @@ function nvrModal(props){
>
);
}
+function mapStateToProps(state) {
+ const { auth, global, members } = state;
+ return {
+ loading: members.isRequesting,
+ user: auth.user,
+ actions: global.actions,
+ members: members.data,
+ };
+}
-export default nvrModal
\ No newline at end of file
+export default connect(mapStateToProps)(cameraModal);
\ No newline at end of file
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 b065ac8..09c230a 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
@@ -1,12 +1,12 @@
import React, { useState ,useRef} from 'react'
import { connect } from "react-redux";
-import { Modal,Form,Row,Col,Spin,Notification } from '@douyinfe/semi-ui';
+import { Modal,Form,Row,Col,Spin,Notification,close } from '@douyinfe/semi-ui';
import { IconTickCircle } from '@douyinfe/semi-icons';
function nvrModal(props){
const {modalName}=props
- const { dispatch, actions, user, loading } = props;
- const venderList=props.venderList||[]//设备厂家
+ const { dispatch, actions, user, loading,vender } = props;
const nvrData = props.nvrData||{}//修改时传来的值
+ console.log('nvrDatanvrDatanvrData',nvrData);
const form = useRef();
const [visible, setVisible] = useState(false);//是否显示弹框
const [isloading,setloading] = useState(false);//是否显示loading
@@ -48,6 +48,11 @@ function nvrModal(props){
let valuesObj=JSON.parse(JSON.stringify(values))
valuesObj.longitude=values.position.split(',')[0]
valuesObj.latitude=values.position.split(',')[1]
+ delete valuesObj.position
+ if(nvrData.id){
+ valuesObj.id=nvrData.id
+ }
+ console.log('valuesObjvaluesObj',valuesObj);
setformObj(valuesObj)
setloading(true);
setTimeout(() => {
@@ -72,6 +77,7 @@ function nvrModal(props){
dispatch(actions.equipmentWarehouse.addchangeNvr(formObj)).then(res => {
Notification.success(opts)
setVisible(false);
+ close();
})
}
}
@@ -109,6 +115,7 @@ function nvrModal(props){
{step==0?
@@ -422,13 +419,14 @@ console.log(equipmentWarehouseNvr);
};
function mapStateToProps(state) {
- const { auth, global, members, equipmentWarehouseNvr } = state;
+ const { auth, global, members, equipmentWarehouseNvr,vender } = state;
return {
loading: members.isRequesting,
user: auth.user,
actions: global.actions,
members: members.data,
equipmentWarehouseNvr: equipmentWarehouseNvr.data || [],
+ vender:vender.data||[],//设备厂家
};
}
From 870afbcd47dc72094fee4e45e81b7938935c2bb0 Mon Sep 17 00:00:00 2001
From: wenlele