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 82d675d..b50c9b3 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,27 +1,54 @@
-'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',
- dispatch: dispatch,
- actionType: 'GET_MEMBERS',
- url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
- msg: { error: '获取用户列表失败' },
- reducer: { name: 'members' }
+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 getNvr(query) {
+ return (dispatch) =>
+ basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_NVR",
+ query: query,
+ url: `${ApiTable.getNvr}`,
+ msg: { option: "获取nvr列表信息" },
+ reducer: { name: "equipmentWarehouseNvr" },
});
-}
\ No newline at end of file
+}
+
+export function addchangeNvr(data) {
+ return (dispatch) =>
+ basicAction({
+ type: "post",
+ dispatch: dispatch,
+ data,
+ actionType: "ADD_CHANGE_NVR",
+ url: `${ApiTable.nvr}`,
+ msg: { option: "添加/修改" },
+ });
+}
+
+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..b837f96 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,19 @@
import React, { useState ,useRef} from 'react'
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){
+ 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:'添加成功',
@@ -193,6 +197,140 @@ function nvrModal(props){
+
>
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..b065ac8 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 } = props;
+ const venderList=props.venderList||[]//设备厂家
+ const nvrData = props.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,32 @@ 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]
+ setformObj(valuesObj)
setloading(true);
setTimeout(() => {
setloadingTip('...接受成功')
@@ -43,8 +69,10 @@ function nvrModal(props){
}
else{
- Notification.success(opts)
- setVisible(false);
+ dispatch(actions.equipmentWarehouse.addchangeNvr(formObj)).then(res => {
+ Notification.success(opts)
+ setVisible(false);
+ })
}
}
function handleAfterClose(){//在关闭之后
@@ -63,7 +91,7 @@ function nvrModal(props){
}
}
function handleLocation(){//高德经纬度
- console.log('handleLocationhandleLocation');
+ window.open('https://lbs.amap.com/tools/picker','_blank')
}
return (
<>
@@ -88,29 +116,30 @@ function nvrModal(props){
getFormApi={formApi => form.current = formApi}>
-
-
+
-
-
- Semi
- 轻颜相机
- 今日头条
+
+ {venderList.map((item,index)=>(
+ {item.name}
+ ))}
-
@@ -148,4 +177,14 @@ function nvrModal(props){
);
}
-export default nvrModal
\ No newline at end of file
+function mapStateToProps(state) {
+ const { auth, global, members } = state;
+ return {
+ loading: members.isRequesting,
+ user: auth.user,
+ actions: global.actions,
+ members: members.data,
+ };
+}
+
+export default connect(mapStateToProps)(nvrModal);
\ No newline at end of file
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 284cb6e..e27f6c7 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
@@ -15,6 +15,12 @@ const NvrHeader = (props) => {
const [pagination, setPagination] = useState({limit:10,page:0});
const SETUPS = "setups";
+ const [venderList,setvenderList] =useState([]);
+ useEffect(() => {
+ dispatch(actions.equipmentWarehouse.getVender()).then(res => {
+ setvenderList(res.payload.data)
+ })
+}, [])
const columns = [
{
@@ -57,7 +63,7 @@ const NvrHeader = (props) => {
return (
<>