diff --git a/code/VideoAccess-VCMP/web/client/assets/images/background/backGround.png b/code/VideoAccess-VCMP/web/client/assets/images/background/backGround.png
new file mode 100644
index 0000000..a01c0fe
Binary files /dev/null and b/code/VideoAccess-VCMP/web/client/assets/images/background/backGround.png differ
diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
index 367fa0e..f96c665 100644
--- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
@@ -1,15 +1,63 @@
-'use strict';
+"use strict";
-import { basicAction } from '@peace/utils'
-import { ApiTable } from '$utils'
+import { basicAction } from "@peace/utils";
+import { ApiTable } from "$utils";
-export function getMembers (orgId) {
- return dispatch => basicAction({
- type: 'get',
+export function getMembers(orgId) {
+ return (dispatch) =>
+ basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_MEMBERS",
+ url: `${ApiTable.getEnterprisesMembers.replace("{enterpriseId}", orgId)}`,
+ msg: { error: "获取用户列表失败" },
+ reducer: { name: "members" },
+ });
+}
+
+export function getNvr(query) {
+ return (dispatch) =>
+ basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_NVR",
+ query: query,
+ url: `${ApiTable.getNvr}`,
+ msg: { option: "获取nvr列表信息" },
+ reducer: { name: "equipmentWarehouseNvr" },
+ });
+}
+export function delNvr(orgId) {
+ return (dispatch) =>
+ basicAction({
+ type: "del",
dispatch: dispatch,
- actionType: 'GET_MEMBERS',
- url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
- msg: { error: '获取用户列表失败' },
- reducer: { name: 'members' }
+ actionType: "DEL_NVR",
+ url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`,
+ msg: { option: "删除NVR" },
+ reducer: { name: "" },
+ });
+ }
+export function addchangeNvr(data) {
+ return (dispatch) =>
+ basicAction({
+ type: "post",
+ dispatch: dispatch,
+ data,
+ actionType: "ADD_CHANGE_NVR",
+ url: `${ApiTable.nvr}`,
+ });
+}
+
+export function getVender() {
+ //获取设备厂商
+ return (dispatch) =>
+ basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_VENDER",
+ url: `${ApiTable.getVender}`,
+ msg: { error: "获取设备厂商失败" },
+ reducer: { name: "vender" },
});
}
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 0d19d87..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,15 +1,20 @@
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';
-function nvrModal(props){
+import "./cameraModal.less";
+function cameraModal(props){
+ const { TextArea } = Form;
const {modalName,visible,close}=props
const form = useRef();
// const [visible, setVisible] = useState(false);//是否显示弹框
const [isloading,setloading] = useState(false);//是否显示loading
const [loadingTip,setloadingTip] = useState('获取中...请稍后...');//loading tip的值
const [step,setstep] = useState(0)//第几步
- const [okText,setokText] = useState('测试校验')//ok弹框text 右边
+ const [okText,setokText] = useState('确定')//ok弹框text 右边
const [cancelText,setcancelText] = useState('取消')//取消弹框text 左边
+ const [cloud,setcloud] = useState('')//云台支持
+ const [voice,setvoice] = useState('')//语音支持
const opts ={//添加完成确认后通知
title:'Hi',
content:'添加成功',
@@ -55,7 +60,7 @@ function nvrModal(props){
setcancelText('上一步');
setloading(false);
}, 2000);
- },2000)
+ }, 2000)
}, 2000);
})
.catch(errors=>{//表单校验失败
@@ -86,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);
@@ -193,10 +198,153 @@ 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/cameraModal.less b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.less
new file mode 100644
index 0000000..a53e2f0
--- /dev/null
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.less
@@ -0,0 +1,6 @@
+.semi-radio-cardRadioGroup_checked .cloud{
+ color: #1859C1;
+}
+.semi-radio-cardRadioGroup_checked .voice{
+ color: #1859C1;
+}
\ 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 fd36234..3ff8a59 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,9 +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 { IconTickCircle } from '@douyinfe/semi-icons';
function nvrModal(props){
const {modalName}=props
- const nvrData = props.nvrData||{}
+ const { dispatch, actions, user, loading,vender,close } = props;
+ const nvrData = props.nvrData||{}//修改时传来的值
+ console.log('nvrDatanvrDatanvrData',nvrData);
const form = useRef();
const [visible, setVisible] = useState(false);//是否显示弹框
const [isloading,setloading] = useState(false);//是否显示loading
@@ -11,6 +14,7 @@ function nvrModal(props){
const [step,setstep] = useState(0)//第几步
const [okText,setokText] = useState('测试校验')//ok弹框text 右边
const [cancelText,setcancelText] = useState('取消')//取消弹框text 左边
+ const [formObj,setformObj] = useState()//接口入参
const opts ={//添加完成确认后通知
title:'Hi',
content:'添加成功',
@@ -19,10 +23,37 @@ function nvrModal(props){
function showDialog() {//打开弹框
setVisible(true);
}
+ function positionForm(val){
+ let zz = /^(-?\d+)(\.\d+)?$/
+ if(!val){
+ return '请输入或拾取高德经纬度坐标'
+ }
+ else if(val.split(',').length!=2){
+ return '请输入格式为116.354169,39.835452的经纬度坐标'
+ }
+ else if(!zz.test(val.split(',')[0])){
+ return '只能填写数字'
+ }
+ else if(!zz.test(val.split(',')[1])){
+ return '只能填写数字'
+ }
+ else{
+ return ''
+ }
+ }
function handleOk() {//点击弹框确定 右边按钮
if(step==0){
form.current.validate()
.then(values=>{//表单校验成功
+ 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(() => {
setloadingTip('...接受成功')
@@ -43,8 +74,11 @@ function nvrModal(props){
}
else{
- Notification.success(opts)
- setVisible(false);
+ dispatch(actions.equipmentWarehouse.addchangeNvr(formObj)).then(res => {
+ Notification.success(opts)
+ setVisible(false);
+ close();
+ })
}
}
function handleAfterClose(){//在关闭之后
@@ -63,7 +97,7 @@ function nvrModal(props){
}
}
function handleLocation(){//高德经纬度
- console.log('handleLocationhandleLocation');
+ window.open('https://lbs.amap.com/tools/picker','_blank')
}
return (
<>
@@ -81,6 +115,7 @@ function nvrModal(props){
{step==0?
@@ -249,7 +250,6 @@ const NvrHeader = (props) => {
飞尚科技1
- 飞尚科技2
+ {venderList.map((item) => {
+ return (
+
+ {item.name}
+
+ );
+ })}
{
marginBottom: 20,
marginRight: 20,
}}
+ onClick={() => {}}
>
搜素
@@ -386,14 +392,36 @@ const NvrHeader = (props) => {
+
+
+ 共{equipmentWarehouseNvr.total}个设备
+
+
{
+ setQuery({ limit: pageSize, page: currentPage - 1 });
+ console.log(currentPage, pageSize);
+ }}
+ />
+
+
{setup ? (
{
close={() => {
setSetup(false);
attribute();
- // setEditData(null)
}}
- // reportType={reportType}
- // editData={editData}
/>
) : (
""
@@ -426,12 +451,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..2afd6be 100644
--- a/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
+++ b/code/VideoAccess-VCMP/web/client/src/utils/webapi.js
@@ -8,6 +8,11 @@ export const ApiTable = {
logout: 'logout',
getEnterprisesMembers: 'enterprises/{enterpriseId}/members',
+
+ getNvr:'nvr',
+ getVender:'vender',
+ nvr:'nvr',
+ delNvr:'nvr/{nvrId}',
};
export const RouteTable = {