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?
form.current = formApi}> - - + - - - {venderList.map((item,index)=>( + + {vender.map((item,index)=>( {item.name} ))} -