Browse Source

萤石云摄像头和IPC摄像头的添加,摄像头删除

release_0.0.2
wenlele 3 years ago
parent
commit
205f8f177e
  1. 57
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js
  2. 12
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
  3. 558
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx
  4. 574
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx
  5. 484
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx
  6. 13
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/skeletonScreen.jsx
  7. 39
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  8. 14
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
  9. 49
      code/VideoAccess-VCMP/web/client/src/utils/webapi.js

57
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js

@ -24,11 +24,23 @@ export function putForbidden(data, forbidden) {
actionType: "PUT_FORBIDDEN",
data,
url: `${ApiTable.putForbidden}`,
msg: { option: forbidden ? "启用":"禁用" }, //禁用摄像头
msg: { option: forbidden ? "启用" : "禁用" }, //禁用摄像头
reducer: {},
});
}
export function delCamera(query) {
return (dispatch) =>
basicAction({
type: "del",
dispatch: dispatch,
actionType: "DEL_CAMERA",
query,
url: `${ApiTable.delCamera}`,
msg: { option: "删除摄像头" }, //删除摄像头
reducer: {},
});
}
export function getCameraDetails(orgId) {
return (dispatch) =>
basicAction({
@ -40,6 +52,19 @@ export function getCameraDetails(orgId) {
reducer: { name: "nvrDetails" },
});
}
export function getCameraKind() {
return (dispatch) =>
basicAction({
type: "get",
dispatch: dispatch,
actionType: "GET_CAMERA_KIND",
url: `${ApiTable.getCameraKind}`,
msg: { option: "" }, //获取摄像头种类列表
reducer: { name: "CameraKind" },
});
}
export function getAbility() {
return (dispatch) =>
basicAction({
@ -47,7 +72,33 @@ export function getAbility() {
dispatch: dispatch,
actionType: "GET_ABILITY",
url: `${ApiTable.getAbility}`,
msg: { option: "获取摄像头能力列表" },
reducer: { name: "equipmentWarehouseCamera" },
msg: { option: "" }, //获取摄像头能力列表
reducer: { name: "CameraAbility" },
});
}
export function postCameraYingshi(data) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data,
actionType: "POST_CAMERA_YINGSHI",
url: `${ApiTable.postCameraYingshi}`,
msg: { option: "" }, //创建萤石摄像头
reducer: { name: "" },
});
}
export function postCameraIpc(data) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data,
actionType: "POST_CAMERA_IPC",
url: `${ApiTable.postCameraIpc}`,
msg: { option: "" }, //创建IPC摄像头
reducer: { name: "" },
});
}

12
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js

@ -77,3 +77,15 @@ export function getVender() {
reducer: { name: "vender" },
});
}
export function getExport() {
return (dispatch) =>
basicAction({
type: "get",
dispatch: dispatch,
actionType: "GET_EXPORT",
url: `${ApiTable.getExport}`,
msg: { option: "导出" }, //导出
reducer: { name: "" },
});
}

558
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx

@ -1,244 +1,447 @@
import React, { useState ,useRef,useEffect} from 'react'
import React, { useState, useRef, useEffect } from "react";
import { connect } from "react-redux";
import { Modal,Spin } from '@douyinfe/semi-ui';
import { IconChevronLeft,IconChevronRight } from '@douyinfe/semi-icons';
import { Modal, Spin } from "@douyinfe/semi-ui";
import { IconChevronLeft, IconChevronRight } from "@douyinfe/semi-icons";
import FluoriteCamera from "./fluoriteCamera";
import NvrCamera from './nvrCamera';
import IpcCamera from './ipcCamera';
import CascadeCamera from './cascadeCamera';
import NvrCamera from "./nvrCamera";
import IpcCamera from "./ipcCamera";
import CascadeCamera from "./cascadeCamera";
import "./cameraModal.less";
function cameraModal(props){
const {modalName,visible,close}=props
function cameraModal(props) {
const {
dispatch,
actions,
modalName,
visible,
close,
venderList,
CameraKind,
CameraAbility,
cameraData, //
} = props;
const { equipmentWarehouse } = actions;
const fluoriteRef = useRef();
const ipcRef = useRef();
const cascadeRef = useRef();
const [isloading,setloading] = useState(false);//loading
const [loadingTip,setloadingTip] = useState('获取中...请稍后...');//loading tip
const [okText,setokText] = useState('确定')//oktext
const [cancelText,setcancelText] = useState('取消')//text
const [clickNum,setclickNum] = useState(1);//
const cameraList=[//
const [isloading, setloading] = useState(false); //loading
const [loadingTip, setloadingTip] = useState("获取中...请稍后..."); //loading tip
const [okText, setokText] = useState("确定"); //oktext
const [cancelText, setcancelText] = useState("取消"); //text
const [clickNum, setclickNum] = useState(
cameraData.type == "yingshi"
? 1
: cameraData.type == "ipc"
? 3
: cameraData.type == "nvr"
? 2
: cameraData.type == "cascade"
? 4
: 1
); //
useEffect(() => {
dispatch(equipmentWarehouse.getCameraKind());
dispatch(equipmentWarehouse.getAbility());
}, []);
const cameraList = [
//
{
id: 1,
img: "/assets/images/background/ysy.png",
title: "萤石云平台摄像头",
text: "通过萤石云平台rtmp地址配置完成推流的平台摄像头。",
},
{
id: 3,
img: "/assets/images/background/ipc.png",
title: "IPC网络摄像头",
text: "通过网络与监控设备直连完成视频流推送的摄像头设备",
},
{
id:1,
img:'/assets/images/background/ysy.png',
title:'萤石云平台摄像头',
text:'通过萤石云平台rtmp地址配置完成推流的平台摄像头。'
},{
id:3,
img:'/assets/images/background/ipc.png',
title:'IPC网络摄像头',
text:'通过网络与监控设备直连完成视频流推送的摄像头设备'
},{
id:4,
img:'/assets/images/background/cascade.png',
title:'级联摄像头',
text:'通过GB/T28181协议级联的平台摄像头,常用于平台对接推送'
},{
id:2,
img:'/assets/images/background/nvr.png',
title:'NVR摄像头',
text:'通过连接NVR(网络硬盘录像机)进行视频流推送的摄像头'
id: 4,
img: "/assets/images/background/cascade.png",
title: "级联摄像头",
text: "通过GB/T28181协议级联的平台摄像头,常用于平台对接推送",
},
]
const [showcameraList,setcameraList]=useState(cameraList.slice(0,3));//
function handleOk() {//
if(clickNum==1){
console.log('1111111111111');
}else if(clickNum==2){
console.log('22222222222222');
}else if(clickNum==3){
console.log('33333333333333');
}else if(clickNum==4){
console.log('44444444444444');
{
id: 2,
img: "/assets/images/background/nvr.png",
title: "NVR摄像头",
text: "通过连接NVR(网络硬盘录像机)进行视频流推送的摄像头",
},
];
const [showcameraList, setcameraList] = useState(cameraList.slice(0, 3)); //
function handleOk() {
//
if (clickNum == 1) {
//
fluoriteRef.current.fluoriteCameraForm().then((values) => {
values = JSON.parse(JSON.stringify(values));
values.longitude = values.position.split(",")[0];
values.latitude = values.position.split(",")[1];
delete values.position;
if (cameraData.id) {
values.id = cameraData.id;
}
// close();
dispatch(equipmentWarehouse.postCameraYingshi(values)).then((res) => {
if (res.success) {
onReset();
}
function handleAfterClose(){//
});
});
} else if (clickNum == 2) {
console.log("22222222222222");
close();
} else if (clickNum == 3) {
//IPC
ipcRef.current.ipcCameraForm().then((values) => {
values = JSON.parse(JSON.stringify(values));
values.longitude = values.position.split(",")[0];
values.latitude = values.position.split(",")[1];
delete values.position;
if (cameraData.id) {
values.id = cameraData.id;
}
console.log(values);
dispatch(equipmentWarehouse.postCameraIpc(values)).then((res) => {
if (res.success) {
onReset();
}
function handleCancel() {//
});
});
} else if (clickNum == 4) {
console.log("44444444444444");
close();
}
function handleChoose(id){//
}
function handleAfterClose() {
//
}
function handleCancel() {
onReset();
//
}
function handleChoose(id) {
//
setclickNum(id);
}
function turnLift(){//
setcameraList(cameraList.slice(0,3))
function turnLift() {
//
setcameraList(cameraList.slice(0, 3));
}
function turnRight(){//
setcameraList(cameraList.slice(1,4))
function turnRight() {
//
setcameraList(cameraList.slice(1, 4));
}
function onReset(){
if(clickNum==1){
function onReset() {
if (clickNum == 1) {
fluoriteRef.current.resetFluoriteCamera();
fluoriteRef.current.toempty();
}else if(clickNum==3){
close();
} else if (clickNum == 3) {
ipcRef.current.resetIpcCamera();
ipcRef.current.toempty();
}else if(clickNum==4){
close();
} else if (clickNum == 4) {
close();
}
close();
}
function toTest(){
if(clickNum==1){
fluoriteRef.current.fluoriteCameraForm().then(values=>{//
console.log('111111111',values);
})
.catch(errors=>{//
console.log('errors',errors);
})
}else if(clickNum==3){
ipcRef.current.ipcCameraForm().then(values=>{//
console.log('111111111',values);
function toTest() {
if (clickNum == 1) {
fluoriteRef.current
.fluoriteCameraForm()
.then((values) => {
//
console.log("111111111", values);
})
.catch(errors=>{//
console.log('errors',errors);
.catch((errors) => {
//
console.log("errors", errors);
});
} else if (clickNum == 3) {
ipcRef.current
.ipcCameraForm()
.then((values) => {
//
console.log("111111111", values);
})
}else if(clickNum==4){
cascadeRef.current.cascadeCameraForm()
.then(values=>{//
let chooseList=[]
let nvrCameraList=[{
id:10,
name:'南昌县1',
number:'111111111111111111',
support:false,
change:false,
},{
id:20,
name:'南昌县2',
number:'222222222222222222',
support:false,
change:false,
},{
id:30,
name:'南昌县3',
number:'333333333333333333',
support:false,
change:false,
},{
id:40,
name:'南昌县4',
number:'444444444444444444',
support:false,
change:false,
}]
cascadeRef.current.setNVRcameraList(nvrCameraList)
.catch((errors) => {
//
console.log("errors", errors);
});
} else if (clickNum == 4) {
cascadeRef.current
.cascadeCameraForm()
.then((values) => {
//
let chooseList = [];
let nvrCameraList = [
{
id: 10,
name: "南昌县1",
number: "111111111111111111",
support: false,
change: false,
},
{
id: 20,
name: "南昌县2",
number: "222222222222222222",
support: false,
change: false,
},
{
id: 30,
name: "南昌县3",
number: "333333333333333333",
support: false,
change: false,
},
{
id: 40,
name: "南昌县4",
number: "444444444444444444",
support: false,
change: false,
},
];
cascadeRef.current.setNVRcameraList(nvrCameraList);
for (let index = 0; index < nvrCameraList.length; index++) {
chooseList.push(nvrCameraList[index].id)
chooseList.push(nvrCameraList[index].id);
}
cascadeRef.current.setNvrCheckList(chooseList)
cascadeRef.current.setIsAllChoose(true)
})
.catch(errors=>{//
console.log('errors',errors);
cascadeRef.current.setNvrCheckList(chooseList);
cascadeRef.current.setIsAllChoose(true);
})
.catch((errors) => {
//
console.log("errors", errors);
});
}
}
return (
<>
<Modal
title={modalName=='add'?'添加摄像头':'修改摄像头'}
title={modalName == "add" ? "添加摄像头" : "修改摄像头"}
okText={okText}
cancelText={cancelText} //
visible={visible}
onOk={handleOk}
width={921}
width={966}
afterClose={handleAfterClose}
onCancel={handleCancel}
>
<Spin tip={loadingTip} spinning={isloading}>
<div style={{marginLeft:'-24px',marginRight:'-24px',marginTop:8}}>
<div style={{marginLeft:29,color:'#1859C1',fontSize:14,fontWeight:500}}>接入类型</div>
<div style={{marginTop:5,display:'flex',alignItems:'center',justifyContent:'space-between'}}>
<div
style={{ marginLeft: "-24px", marginRight: "-24px", marginTop: 8 }}
>
<div
style={{
marginLeft: 29,
color: "#1859C1",
fontSize: 14,
fontWeight: 500,
}}
>
接入类型
</div>
<div
style={{
marginTop: 5,
display: "flex",
alignItems: "center",
justifyContent: "space-between",
}}
>
<IconChevronLeft
style={{color:'rgba(0, 0, 0, 0.45)',fontSize:16,marginLeft:29,cursor: "pointer",}}
onClick={turnLift}/>
style={{
color: "rgba(0, 0, 0, 0.45)",
fontSize: 16,
marginLeft: 29,
cursor: "pointer",
}}
onClick={turnLift}
/>
<div
style={{display:'flex',alignItems:'center',height:146}}>
{showcameraList.map((item,index)=>(
style={{ display: "flex", alignItems: "center", height: 146 }}
>
{showcameraList.map((item, index) => (
<div
key={item.id}
style={{
width:266,
height:146,
marginRight:12,
border:clickNum===item.id?'1px solid #1859C1':'1px solid #F9F9F9',
borderRadius:3,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
width: 266,
height: 146,
marginRight: 12,
border:
clickNum === item.id
? "1px solid #1859C1"
: "1px solid #F9F9F9",
borderRadius: 3,
display: "flex",
flexDirection: "column",
alignItems: "center",
cursor: "pointer",
position: 'relative'}}
onClick={()=>handleChoose(item.id)}>
position: "relative",
}}
onClick={() => handleChoose(item.id)}
>
<div
style={{
marginTop: 5,
height: 65,
width: 116,
display: "flex",
justifyContent: "center",
alignItems: "center",
}}
>
<img src={item.img} alt="设置" />
</div>
<div
style={{
marginTop: 2,
fontSize: 14,
color: "rgba(0, 0, 0, 0.85)",
}}
>
{item.title}
</div>
<div
style={{
width: 210,
height: 34,
marginTop: 9,
fontSize: 12,
color: "rgba(0, 0, 0, 0.45)",
textAlign: "center",
}}
>
{item.text}
</div>
{clickNum === item.id ? (
<div
style={{marginTop:5,
height:65,
width:116,
display: 'flex',
justifyContent: 'center',
alignItems: 'center'}}>
style={{
position: "absolute",
top: "-3px",
right: "-5px",
}}
>
<img
src={item.img}
alt="设置"
src="/assets/images/background/topchoose.png"
alt="1"
/>
</div>
<div style={{marginTop:2,fontSize:14,color:'rgba(0, 0, 0, 0.85)',}}>{item.title}</div>
<div style={{width:210,height:34,marginTop:9,fontSize:12,color:'rgba(0, 0, 0, 0.45)',textAlign:'center'}}>{item.text}</div>
{clickNum===item.id?<div style={{ position: 'absolute', top: '-3px', right: '-5px'}}>
<img src="/assets/images/background/topchoose.png" alt="1" />
</div>:''}
) : (
""
)}
</div>
))}
</div>
<IconChevronRight
style={{color:'rgba(0, 0, 0, 0.45)',fontSize:16,marginRight:18,cursor: "pointer",}}
onClick={turnRight}/>
style={{
color: "rgba(0, 0, 0, 0.45)",
fontSize: 16,
marginRight: 18,
cursor: "pointer",
}}
onClick={turnRight}
/>
</div>
</div>
<div style={{height:30,marginLeft:'-24px',marginRight:'-24px',marginTop:48,display:'flex',alignItems: 'center',justifyContent: 'space-between'}}>
<div style={{marginLeft:29,color:'#1859C1',fontSize:14,fontWeight:500}}>配置属性</div>
{clickNum!==2?<div style={{display:'flex',marginRight:43,}}>
<div style={{
height:30,
width:64,
border:'1px solid #D9D9D9',
borderRadius: '3px',
color:'rgba(0, 0, 0, 0.65)',
display:'flex',
justifyContent: 'center',
alignItems: 'center',
<div
style={{
height: 30,
marginLeft: "-24px",
marginRight: "-24px",
marginTop: 48,
display: "flex",
alignItems: "center",
justifyContent: "space-between",
}}
>
<div
style={{
marginLeft: 29,
color: "#1859C1",
fontSize: 14,
fontWeight: 500,
}}
>
配置属性
</div>
{clickNum !== 2 ? (
<div style={{ display: "flex", marginRight: 43 }}>
<div
style={{
height: 30,
width: 64,
border: "1px solid #D9D9D9",
borderRadius: "3px",
color: "rgba(0, 0, 0, 0.65)",
display: "flex",
justifyContent: "center",
alignItems: "center",
cursor: "pointer",
marginRight:16
}} onClick={onReset}>
<img src="/assets/images/background/Reset.png" alt="1" style={{marginRight:4}}/>
marginRight: 16,
}}
onClick={onReset}
>
<img
src="/assets/images/background/Reset.png"
alt="1"
style={{ marginRight: 4 }}
/>
重置
</div>
<div style={{
height:30,
width:64,
border:'1px solid #1859C1',
borderRadius: '3px',
color:'#1859C1',
display:'flex',
justifyContent: 'center',
alignItems: 'center',
<div
style={{
height: 30,
width: 64,
border: "1px solid #1859C1",
borderRadius: "3px",
color: "#1859C1",
display: "flex",
justifyContent: "center",
alignItems: "center",
cursor: "pointer",
}} onClick={toTest}>
<img src="/assets/images/background/test.png" alt="1" style={{marginRight:4}} />
}}
onClick={toTest}
>
<img
src="/assets/images/background/test.png"
alt="1"
style={{ marginRight: 4 }}
/>
测试
</div>
</div>:''}
</div>
) : (
""
)}
</div>
<div>
{clickNum==1?
<FluoriteCamera cRef={fluoriteRef}/>
:clickNum==2?
<NvrCamera/>
:clickNum==3?
<IpcCamera aRef={ipcRef} />
:<CascadeCamera dRef={cascadeRef}/>}
{clickNum == 1 ? (
<FluoriteCamera
cRef={fluoriteRef}
CameraKind={CameraKind}
CameraAbility={CameraAbility}
cameraData={cameraData}
/>
) : clickNum == 2 ? (
<NvrCamera />
) : clickNum == 3 ? (
<IpcCamera
aRef={ipcRef}
CameraKind={CameraKind}
CameraAbility={CameraAbility}
venderList={venderList}
cameraData={cameraData}
/>
) : (
<CascadeCamera dRef={cascadeRef} />
)}
</div>
</Spin>
</Modal>
@ -246,12 +449,13 @@ function cameraModal(props){
);
}
function mapStateToProps(state) {
const { auth, global, members } = state;
const { auth, global, members, CameraKind, CameraAbility } = state;
return {
loading: members.isRequesting,
user: auth.user,
actions: global.actions,
members: members.data,
CameraKind: CameraKind.data || [],
CameraAbility: CameraAbility.data || [],
};
}

574
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx

@ -1,254 +1,470 @@
import React, { useState ,useRef,useEffect,useImperativeHandle} from 'react'
import React, { useState, useRef, useEffect, useImperativeHandle } from "react";
import { connect } from "react-redux";
import { Form,Row,Col} from '@douyinfe/semi-ui';
import { Form, Row, Col } from "@douyinfe/semi-ui";
import "./cameraModal.less";
function fluoriteCamera({cRef}){
function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) {
const { TextArea } = Form;
const form = useRef();
const [cloud,setcloud] = useState('')//
const [voice,setvoice] = useState('')//
const [switching,setSwitching] = useState('')//
const [memoryList,setMemoryList] = useState([
const [cloud, setcloud] = useState(""); //
const [voice, setvoice] = useState(""); //
const [switching, setSwitching] = useState(""); //
const [memoryList, setMemoryList] = useState([
{
id:1,
value:'8g'
},{
id:2,
value:'16g'
},{
id:3,
value:'32g'
},{
id:4,
value:'64g'
},{
id:5,
value:'128g'
},{
id:6,
value:'256g'
},{
id:7,
value:'>256g'
}
])//
function handleLocation(){//
window.open('https://lbs.amap.com/tools/picker','_blank')
}
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 '只能填写数字'
id: 1,
value: "8g",
},
{
id: 2,
value: "16g",
},
{
id: 3,
value: "32g",
},
{
id: 4,
value: "64g",
},
{
id: 5,
value: "128g",
},
{
id: 6,
value: "256g",
},
{
id: 7,
value: ">256g",
},
]); //
useEffect(() => {
setcloud(cameraData.cloudControl || "");
setvoice(cameraData.voice || "");
setSwitching(cameraData.highDefinition || "");
}, []);
function handleLocation() {
//
window.open("https://lbs.amap.com/tools/picker", "_blank");
}
else{
return ''
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 "";
}
}
useImperativeHandle(cRef,() => ({//
useImperativeHandle(cRef, () => ({
//
//
fluoriteCameraForm : form.current.validate,
resetFluoriteCamera : form.current.reset,
toempty:empty,
}))
function empty(){
setcloud(null)
setvoice(null)
setSwitching(null)
fluoriteCameraForm: form.current.validate,
resetFluoriteCamera: form.current.reset,
toempty: empty,
}));
function empty() {
setcloud("");
setvoice("");
setSwitching("");
}
return (
<>
<Form
labelPosition='left'
labelAlign='left'
labelWidth= '115px'
onValueChange={values=>console.log(values)}
getFormApi={formApi => form.current = formApi}>
labelPosition="left"
labelAlign="left"
labelWidth="115px"
onValueChange={(values) => console.log(values)}
initValues={{
name: cameraData ? cameraData.name : "",
highDefinition: cameraData ? cameraData.highDefinition : "",
memoryCard: cameraData ? cameraData.memoryCard : "",
position: cameraData.longitude
? `${cameraData.longitude},${cameraData.latitude}`
: "",
kindId: cameraData ? cameraData.kindId : "",
abilityId: cameraData
? cameraData.cameraAbilities
? cameraData.cameraAbilities.map((item) => item.id)
: ""
: "",
cloudControl: cameraData ? cameraData.cloudControl : "",
voice: cameraData ? cameraData.voice : "",
serialNo: cameraData ? cameraData.serialNo : "",
rtmp: cameraData ? cameraData.rtmp : "",
}}
getFormApi={(formApi) => (form.current = formApi)}
>
<Row>
<Col span={12}>
{/* 设备名称 */}
<Form.Input field='UserName' label='设备名称:' initValue={''} placeholder='请输入设备名称、常用项目或位置定义' style={{ width:307 }}
rules={[
{ required: true, message: '请输入设备名称' }
]}/>
<Form.Input
field="name"
label="设备名称:"
placeholder="请输入设备名称、常用项目或位置定义"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备名称" }]}
/>
{/* 高清切换 */}
<Form.RadioGroup
label="高清切换:"
field='hdSwitching'
type='pureCard'
direction='horizontal'
style={{padding:0,paddingTop:1,paddingBottom:1}}
rules={[
{ required: true, message: '请选择高清切换' }
]}
field="highDefinition"
type="pureCard"
direction="horizontal"
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }}
rules={[{ required: true, message: "请选择高清切换" }]}
onChange={(checked) => {
console.log(checked.target.value);
if(checked.target.value=='yes'){
setSwitching('yes')
}
else{
setSwitching('no')
if (checked.target.value == true) {
setSwitching(true);
} else {
setSwitching(false);
}
}}>
<Form.Radio value="yes" style={{width:58,height:30,padding:0,margin:0,background:'#F9F9F9'}}>
<div className='switching' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
}}
>
<Form.Radio
value={true}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
background: "#F9F9F9",
}}
>
<div
className="switching"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
支持
</div>
{switching=='yes'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{switching == true ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
<Form.Radio value="no" style={{width:58,height:30,padding:0,margin:0,marginLeft:18,background:'#F9F9F9'}}>
<div className='switching' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
<Form.Radio
value={false}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
marginLeft: 18,
background: "#F9F9F9",
}}
>
<div
className="switching"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
不支持
</div>
{switching=='no'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{switching == false && switching !== "" ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
</Form.RadioGroup>
{/* 内存 */}
<Form.Select label="内存:" field='business2' placeholder='未安装' style={{ width:307 }}>
{memoryList.map((item,index)=>(
<Form.Select.Option key={index} value={item.id}>{item.value}</Form.Select.Option>
<Form.Select
label="内存:"
field="memoryCard"
placeholder="未安装"
style={{ width: 307 }}
>
{memoryList.map((item, index) => (
<Form.Select.Option key={index} value={item.value}>
{item.value}
</Form.Select.Option>
))}
</Form.Select>
{/* 安装位置 */}
<div style={{display:'flex'}}>
<Form.Input field='Use11rName1312' label='安装位置:' placeholder='请输入或拾取高德经纬度坐标' style={{ width:270 }}
<div style={{ display: "flex" }}>
<Form.Input
field="position"
label="安装位置:"
placeholder="请输入或拾取高德经纬度坐标"
style={{ width: 270 }}
validate={positionForm}
rules={[
{ required: true, message: '请输入或拾取高德经纬度坐标' }
]}/>
<div style={{
width:32,
height:32,
background:"#1859C1",
marginLeft:4,
display:'flex',
justifyContent: 'center',
alignItems: 'center',
{ required: true, message: "请输入或拾取高德经纬度坐标" },
]}
/>
<div
style={{
width: 32,
height: 32,
background: "#1859C1",
marginLeft: 4,
display: "flex",
justifyContent: "center",
alignItems: "center",
cursor: "pointer",
marginTop:12,
borderRadius: 3+'px'}}
onClick={handleLocation}>
<img src="../../../assets/images/background/location.png" width={16} height={20}/>
marginTop: 12,
borderRadius: 3 + "px",
}}
onClick={handleLocation}
>
<img
src="../../../assets/images/background/location.png"
width={16}
height={20}
/>
</div>
</div>
{/* 设备类型 */}
<div style={{display:'flex',}}>
<div>
<Form.Select label="设备类型:" field='business23' placeholder='请选择摄像头类型' style={{ width:160 }}
rules={[
{ required: true, message: '请选择摄像头类型' }
]}>
{memoryList.map((item,index)=>(
<Form.Select.Option key={index} value={item.id}>{item.value}</Form.Select.Option>
<Form.Select
label="设备类型:"
field="kindId"
placeholder="请选择摄像头类型"
style={{ width: 180 }}
rules={[{ required: true, message: "请选择摄像头类型" }]}
>
{CameraKind.map((item, index) => (
<Form.Select.Option key={index} value={item.id}>
{item.kind}
</Form.Select.Option>
))}
</Form.Select>
</div>
<div style={{marginLeft:7}}>
<Form.Select noLabel='true' field='business244' placeholder='请选择能力' style={{ width:140 }}
rules={[
{ required: true, message: '请选择能力' }
]}>
{memoryList.map((item,index)=>(
<Form.Select.Option key={index} value={item.id}>{item.value}</Form.Select.Option>
<Form.Select
label="设备能力:"
multiple
maxTagCount={1}
field="abilityId"
placeholder="请选择能力"
style={{ width: 180 }}
rules={[{ required: true, message: "请选择能力" }]}
>
{CameraAbility.map((item, index) => (
<Form.Select.Option key={index} value={item.id}>
{item.ability}
</Form.Select.Option>
))}
</Form.Select>
</div>
</div>
</Col>
<Col span={12}>
{/* 云台支持 */}
<Form.RadioGroup
label="云台支持:"
field='role'
type='pureCard'
direction='horizontal'
style={{padding:0,paddingTop:1,paddingBottom:1}}
rules={[
{ required: true, message: '请选择云台支持' }
]}
field="cloudControl"
type="pureCard"
direction="horizontal"
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }}
rules={[{ required: true, message: "请选择云台支持" }]}
onChange={(checked) => {
console.log(checked.target.value);
if(checked.target.value=='yes'){
setcloud('yes')
}
else{
setcloud('no')
if (checked.target.value == true) {
setcloud(true);
} else {
setcloud(false);
}
}}>
<Form.Radio value="yes" style={{width:58,height:30,padding:0,margin:0,background:'#F9F9F9'}}>
<div className='cloud' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
}}
>
<Form.Radio
value={true}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
background: "#F9F9F9",
}}
>
<div
className="cloud"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
支持
</div>
{cloud=='yes'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{cloud == true ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
<Form.Radio value="no" style={{width:58,height:30,padding:0,margin:0,marginLeft:18,background:'#F9F9F9'}}>
<div className='cloud' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
<Form.Radio
value={false}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
marginLeft: 18,
background: "#F9F9F9",
}}
>
<div
className="cloud"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
不支持
</div>
{cloud=='no'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{cloud == false && cloud !== "" ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
</Form.RadioGroup>
{/* 语音支持 */}
<Form.RadioGroup
// labelWidth= '76px'
label="语音支持:"
field='role2'
type='pureCard'
direction='horizontal'
style={{padding:0,paddingTop:1,paddingBottom:1}}
field="voice"
type="pureCard"
direction="horizontal"
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }}
onChange={(checked) => {
console.log(checked.target.value);
if(checked.target.value=='yes'){
setvoice('yes')
}
else{
setvoice('no')
if (checked.target.value == true) {
setvoice(true);
} else {
setvoice(false);
}
}}>
<Form.Radio value="yes" style={{width:58,height:30,padding:0,margin:0,background:'#F9F9F9'}}>
<div className='voice' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
}}
>
<Form.Radio
value={true}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
background: "#F9F9F9",
}}
>
<div
className="voice"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
支持
</div>
{voice=='yes'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{voice == true ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
<Form.Radio value="no" style={{width:58,height:30,padding:0,margin:0,marginLeft:18,background:'#F9F9F9'}}>
<div className='voice' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
<Form.Radio
value={false}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
marginLeft: 18,
background: "#F9F9F9",
}}
>
<div
className="voice"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
不支持
</div>
{voice=='no'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{voice == false && voice !== "" ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
</Form.RadioGroup>
{/* 设备名称 */}
<Form.Input field='serialNumber' label='设备序列号:' initValue={''} placeholder='请输入设备序列号' style={{ width:307 }}
rules={[
{ required: true, message: '请输入设备序列号' }
]}/>
<Form.Input
field="serialNo"
label="设备序列号:"
placeholder="请输入设备序列号"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备序列号" }]}
/>
{/* RTMP地址接入 */}
<TextArea
style={{ width:320, height: 90 }}
field='description'
label='RTMP地址接入:'
placeholder='请输入RTMP地址接入'
style={{ width: 320, height: 90 }}
field="rtmp"
label="RTMP地址接入:"
placeholder="请输入RTMP地址接入"
rules={[{ required: true, message: "请输入RTMP地址接入" }]}
/>
</Col>
</Row>

484
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx

@ -1,207 +1,391 @@
import React, { useState ,useRef,useEffect,useImperativeHandle} from 'react'
import React, { useState, useRef, useEffect, useImperativeHandle } from "react";
import { connect } from "react-redux";
import { Form,Row,Col } from '@douyinfe/semi-ui';
import { Form, Row, Col } from "@douyinfe/semi-ui";
import "./cameraModal.less";
function ipcCamera({aRef}){
function ipcCamera({
aRef,
CameraKind,
CameraAbility,
venderList,
cameraData,
}) {
const { TextArea } = Form;
const form = useRef();
const [cloud,setcloud] = useState('')//
const [voice,setvoice] = useState('')//
const [memoryList,setMemoryList] = useState([
const [cloud, setcloud] = useState(""); //
const [voice, setvoice] = useState(""); //
const [memoryList, setMemoryList] = useState([
{
id:1,
value:'8g'
},{
id:2,
value:'16g'
},{
id:3,
value:'32g'
},{
id:4,
value:'64g'
},{
id:5,
value:'128g'
},{
id:6,
value:'256g'
},{
id:7,
value:'>256g'
}
])//
function handleLocation(){//
window.open('https://lbs.amap.com/tools/picker','_blank')
}
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 '只能填写数字'
id: 1,
value: "8g",
},
{
id: 2,
value: "16g",
},
{
id: 3,
value: "32g",
},
{
id: 4,
value: "64g",
},
{
id: 5,
value: "128g",
},
{
id: 6,
value: "256g",
},
{
id: 7,
value: ">256g",
},
]); //
useEffect(() => {
setcloud(cameraData.cloudControl || "");
setvoice(cameraData.voice || "");
}, []);
function handleLocation() {
//
window.open("https://lbs.amap.com/tools/picker", "_blank");
}
else{
return ''
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 "";
}
}
useImperativeHandle(aRef,() => ({//
useImperativeHandle(aRef, () => ({
//
//
ipcCameraForm : form.current.validate,
resetIpcCamera : form.current.reset,
toempty:empty,
}))
function empty(){
setcloud(null)
setvoice(null)
ipcCameraForm: form.current.validate,
resetIpcCamera: form.current.reset,
toempty: empty,
}));
function empty() {
setcloud(null);
setvoice(null);
}
return (
<>
<Form
labelPosition='left'
labelAlign='left'
labelWidth= '115px'
onValueChange={values=>console.log(values)}
getFormApi={formApi => form.current = formApi}>
labelPosition="left"
labelAlign="left"
labelWidth="115px"
onValueChange={(values) => console.log(values)}
initValues={{
name: cameraData ? cameraData.name : "",
venderId: cameraData ? cameraData.venderId : "",
memoryCard: cameraData ? cameraData.memoryCard : "",
position: cameraData.longitude
? `${cameraData.longitude},${cameraData.latitude}`
: "",
kindId: cameraData ? cameraData.kindId : "",
abilityId: cameraData
? cameraData.cameraAbilities
? cameraData.cameraAbilities.map((item) => item.id)
: ""
: "",
cloudControl: cameraData ? cameraData.cloudControl : "",
voice: cameraData ? cameraData.voice : "",
serialNo: cameraData ? cameraData.serialNo : "",
rtmp: cameraData ? cameraData.rtmp : "",
}}
getFormApi={(formApi) => (form.current = formApi)}
>
<Row>
<Col span={12}>
<Form.Input field='UserName' label='设备名称:' initValue={''} placeholder='请输入设备名称、常用项目或位置定义' style={{ width:307 }}
rules={[
{ required: true, message: '请输入设备名称' }
]}/>
<Form.Input field='Use11rName11' label='设备厂家:' placeholder='请选择设备厂家' style={{ width:307 }}/>
<Form.Select label="内存:" field='business2' placeholder='未安装' style={{ width:307 }}>
{memoryList.map((item,index)=>(
<Form.Select.Option key={index} value={item.id}>{item.value}</Form.Select.Option>
<Form.Input
field="name"
label="设备名称:"
placeholder="请输入设备名称、常用项目或位置定义"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备名称" }]}
/>
<Form.Select
field="venderId"
label="设备厂家:"
placeholder="请选择设备厂家"
style={{ width: 307 }}
>
{venderList.map((item, index) => (
<Form.Select.Option key={index} value={item.id}>
{item.name}
</Form.Select.Option>
))}
</Form.Select>
<Form.Select
label="内存:"
field="memoryCard"
placeholder="未安装"
style={{ width: 307 }}
>
{memoryList.map((item, index) => (
<Form.Select.Option key={index} value={item.value}>
{item.value}
</Form.Select.Option>
))}
</Form.Select>
<div style={{display:'flex'}}>
<Form.Input field='Use11rName1312' label='安装位置:' placeholder='请输入或拾取高德经纬度坐标' style={{ width:270 }}
<div style={{ display: "flex" }}>
<Form.Input
field="position"
label="安装位置:"
placeholder="请输入或拾取高德经纬度坐标"
style={{ width: 270 }}
validate={positionForm}
rules={[
{ required: true, message: '请输入或拾取高德经纬度坐标' }
]}/>
<div style={{
width:32,
height:32,
background:"#1859C1",
marginLeft:4,
display:'flex',
justifyContent: 'center',
alignItems: 'center',
{ required: true, message: "请输入或拾取高德经纬度坐标" },
]}
/>
<div
style={{
width: 32,
height: 32,
background: "#1859C1",
marginLeft: 4,
display: "flex",
justifyContent: "center",
alignItems: "center",
cursor: "pointer",
marginTop:12,
borderRadius: 3+'px'}}
onClick={handleLocation}>
<img src="../../../assets/images/background/location.png" width={16} height={20}/>
marginTop: 12,
borderRadius: 3 + "px",
}}
onClick={handleLocation}
>
<img
src="../../../assets/images/background/location.png"
width={16}
height={20}
/>
</div>
</div>
<div style={{display:'flex',}}>
<div>
<Form.Select label="设备类型:" field='business23' placeholder='请选择摄像头类型' style={{ width:160 }}
rules={[
{ required: true, message: '请选择摄像头类型' }
]}>
{memoryList.map((item,index)=>(
<Form.Select.Option key={index} value={item.id}>{item.value}</Form.Select.Option>
<Form.Select
label="设备类型:"
field="kindId"
placeholder="请选择摄像头类型"
style={{ width: 180 }}
rules={[{ required: true, message: "请选择摄像头类型" }]}
>
{CameraKind.map((item, index) => (
<Form.Select.Option key={index} value={item.id}>
{item.kind}
</Form.Select.Option>
))}
</Form.Select>
</div>
<div style={{marginLeft:7}}>
<Form.Select noLabel='true' field='business244' placeholder='请选择能力' style={{ width:140 }}
rules={[
{ required: true, message: '请选择能力' }
]}>
{memoryList.map((item,index)=>(
<Form.Select.Option key={index} value={item.id}>{item.value}</Form.Select.Option>
<Form.Select
label="设备能力:"
multiple
maxTagCount={1}
field="abilityId"
placeholder="请选择能力"
style={{ width: 180 }}
rules={[{ required: true, message: "请选择能力" }]}
>
{CameraAbility.map((item, index) => (
<Form.Select.Option key={index} value={item.id}>
{item.ability}
</Form.Select.Option>
))}
</Form.Select>
</div>
</div>
</Col>
<Col span={12}>
<Form.RadioGroup
label="云台支持:"
field='role'
type='pureCard'
direction='horizontal'
style={{padding:0,paddingTop:1,paddingBottom:1}}
rules={[
{ required: true, message: '请选择云台支持' }
]}
field="cloudControl"
type="pureCard"
direction="horizontal"
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }}
rules={[{ required: true, message: "请选择云台支持" }]}
onChange={(checked) => {
console.log(checked.target.value);
if(checked.target.value=='yes'){
setcloud('yes')
if (checked.target.value == true) {
setcloud(true);
} else {
setcloud(false);
}
else{
setcloud('no')
}
}}>
<Form.Radio value="yes" style={{width:58,height:30,padding:0,margin:0,background:'#F9F9F9'}}>
<div className='cloud' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
}}
>
<Form.Radio
value={true}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
background: "#F9F9F9",
}}
>
<div
className="cloud"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
支持
</div>
{cloud=='yes'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{cloud == true ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
<Form.Radio value="no" style={{width:58,height:30,padding:0,margin:0,marginLeft:18,background:'#F9F9F9'}}>
<div className='cloud' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
<Form.Radio
value={false}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
marginLeft: 18,
background: "#F9F9F9",
}}
>
<div
className="cloud"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
不支持
</div>
{cloud=='no'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{cloud == false && cloud !== "" ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
</Form.RadioGroup>
<Form.RadioGroup
label="语音支持:"
field='role2'
type='pureCard'
direction='horizontal'
style={{padding:0}}
field="voice"
type="pureCard"
direction="horizontal"
style={{ padding: 0 }}
onChange={(checked) => {
console.log(checked.target.value);
if(checked.target.value=='yes'){
setvoice('yes')
}
else{
setvoice('no')
if (checked.target.value == true) {
setvoice(true);
} else {
setvoice(false);
}
}}>
<Form.Radio value="yes" style={{width:58,height:30,padding:0,margin:0,background:'#F9F9F9'}}>
<div className='voice' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
}}
>
<Form.Radio
value={true}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
background: "#F9F9F9",
}}
>
<div
className="voice"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
支持
</div>
{voice=='yes'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{voice == true ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
<Form.Radio value="no" style={{width:58,height:30,padding:0,margin:0,marginLeft:18,background:'#F9F9F9'}}>
<div className='voice' style={{width:58,height:30,textAlign:'center',lineHeight:'30px'}}>
<Form.Radio
value={false}
style={{
width: 58,
height: 30,
padding: 0,
margin: 0,
marginLeft: 18,
background: "#F9F9F9",
}}
>
<div
className="voice"
style={{
width: 58,
height: 30,
textAlign: "center",
lineHeight: "30px",
}}
>
不支持
</div>
{voice=='no'?<div style={{position: 'absolute', top: '-2px', right: '-1px'}}>
<img src="/assets/images/background/formchoose.png" alt="1" />
</div>:''}
{voice == false && voice !== "" ? (
<div
style={{ position: "absolute", top: "-2px", right: "-1px" }}
>
<img
src="/assets/images/background/formchoose.png"
alt="1"
/>
</div>
) : (
""
)}
</Form.Radio>
</Form.RadioGroup>
<div>
<Form.Input field='UserName11' label='设备编号接入:' initValue={''} placeholder='请输入设备编号' style={{ width:307 }}/>
<Form.Input
field="serialNo"
label="设备编号接入:"
placeholder="请输入设备编号"
style={{ width: 307 }}
/>
</div>
<TextArea
style={{ width:320, height: 90 }}
field='description'
label='RTMP地址接入:'
placeholder='请输入RTMP地址接入'
style={{ width: 320, height: 90 }}
field="rtmp"
label="RTMP地址接入:"
placeholder="请输入RTMP地址接入"
/>
</Col>
{/* <Col span={18}>

13
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/skeletonScreen.jsx

@ -1,17 +1,6 @@
import { Table } from "@douyinfe/semi-ui";
export function skeletonScreen(line, columns) {
// function TableHead() {
// let str = [];
// for (let i = 0; i <= column; i++) {
// if(i==column-2){
// }else{
// str.push(<div>ngfbn</div>)
// }
// }
// return str;
// }
const data = () => {
let str = [];
for (let i = 0; i < line; i++) {
@ -52,7 +41,7 @@ export function skeletonScreen(line, columns) {
style={{
width: 50,
height: 14,
background: "red",
background: "rgba(217, 216, 216, 0.3)",
}}
></div>
),

39
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -13,7 +13,7 @@ import {
Skeleton,
Popconfirm,
} from "@douyinfe/semi-ui";
import { SimpleFileDownButton } from '$components'
import { SimpleFileDownButton } from "$components";
import "../style.less";
import CameraModal from "../components/cameraModal";
import NvrModal from "../components/nvrModal";
@ -34,14 +34,13 @@ const CameraHeader = (props) => {
const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [search, setearch] = useState({}); //
const [rowId, setRowId] = useState(); //id
const [load, setLoad] = useState(); //
const [cameraData, setCameraData] = useState({}); //id
const { equipmentWarehouse } = actions;
const api = useRef();
const CAMERAS = "cameras";
useEffect(() => {
setLoad(loading);
dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
setvenderList(res.payload.data);
attribute(res.payload.data);
@ -60,7 +59,7 @@ const CameraHeader = (props) => {
equipmentGetCamera();
}, [query, search]);
function equipmentGetCamera () {
function equipmentGetCamera() {
dispatch(equipmentWarehouse.getCamera({ ...query, ...search }));
}
@ -98,17 +97,17 @@ const CameraHeader = (props) => {
width: "20%",
dataIndex: "",
render: (_, row) => {
console.log(row);
return (
<div style={{ display: "flex" }}>
<Button theme="borderless">
<NvrModal
nvrData={row}
modalName="revise"
venderList={venderList}
close={() => {
equipmentGetCamera();
<Button
theme="borderless"
onClick={() => {
setCameraModal(true);
setCameraData(row);
}}
/>
>
修改
</Button>
<Button
theme="borderless"
@ -116,7 +115,6 @@ const CameraHeader = (props) => {
setSideSheet(true);
setcameraSetup(true);
setRowId(row.id);
console.log(row.id);
}}
>
查看
@ -170,7 +168,9 @@ const CameraHeader = (props) => {
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(equipmentWarehouse.delNvr(row.id)).then(() => {
dispatch(
equipmentWarehouse.delCamera({ cameraId: row.id })
).then(() => {
equipmentGetCamera();
});
}}
@ -184,7 +184,7 @@ const CameraHeader = (props) => {
];
//
function attribute (data) {
function attribute(data) {
const arr = localStorage.getItem(CAMERAS)
? JSON.parse(localStorage.getItem(CAMERAS))
: [];
@ -313,7 +313,7 @@ const CameraHeader = (props) => {
}
//station
function station (first, whole, name) {
function station(first, whole, name) {
return (
<Popover
key="updateTime"
@ -674,9 +674,12 @@ const CameraHeader = (props) => {
{cameraModal ? (
<CameraModal
visible={true}
venderList={venderList}
cameraData={cameraData}
close={() => {
setCameraModal(false);
// setEditData(null)
setCameraData({});
equipmentGetCamera();
}}
modalName={modalName}
/>
@ -687,7 +690,7 @@ const CameraHeader = (props) => {
);
};
function mapStateToProps (state) {
function mapStateToProps(state) {
const { auth, global, members, equipmentWarehouseCamera } = state;
return {
loading:

14
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -14,11 +14,11 @@ import {
Tag,
} from "@douyinfe/semi-ui";
import "../style.less";
import { ApiTable } from "$utils";
import NvrModal from "../components/nvrModal";
import Setup from "../components/setup";
import SideSheets from "../components/sideSheet";
import {skeletonScreen} from "../components/skeletonScreen";
import { skeletonScreen } from "../components/skeletonScreen";
export const accessType = [
{ name: "萤石云平台摄像头", key: "yingshi" },
@ -40,7 +40,6 @@ const NvrHeader = (props) => {
const [rowId, setRowId] = useState(); //id
const [load, setLoad] = useState(); //
const api = useRef();
const SETUPS = "setups";
@ -514,6 +513,7 @@ const NvrHeader = (props) => {
style={{ width: 18, height: 18 }}
/>
</Button>
<a href={`/_api/${ApiTable.getExport}`}>
<Button
style={{
width: 65,
@ -525,12 +525,10 @@ const NvrHeader = (props) => {
>
导出
</Button>
</a>
</div>
</div>
<Skeleton
loading={load}
placeholder={skeletonScreen(8, setupp.length)}
>
<Skeleton loading={loading} placeholder={skeletonScreen(8, setupp.length)}>
<Table
columns={setupp.filter((s) => s)}
dataSource={equipmentWarehouseNvr.data}
@ -598,7 +596,7 @@ const NvrHeader = (props) => {
function mapStateToProps(state) {
const { auth, global, members, equipmentWarehouseNvr } = state;
return {
loading: equipmentWarehouseNvr.isRequesting,
loading: equipmentWarehouseNvr.isRequesting && !equipmentWarehouseNvr.data,
user: auth.user,
actions: global.actions,
members: members.data,

49
code/VideoAccess-VCMP/web/client/src/utils/webapi.js

@ -1,30 +1,33 @@
'use strict';
import { ProxyRequest } from '@peace/utils'
"use strict";
import { ProxyRequest } from "@peace/utils";
export const AuthRequest = new ProxyRequest('_auth')
export const AuthRequest = new ProxyRequest("_auth");
export const ApiTable = {
login: 'login',
logout: 'logout',
getEnterprisesMembers: 'enterprises/{enterpriseId}/members',
getNvr:'nvr',
getVender:'vender',
nvr:'nvr',
delNvr:'nvr/{nvrId}',
getNvrDetails:'nvr/detail/{nvrId}', //获取nvr详情
getCamera:"camera/project", // 获取摄像头列表
putForbidden:"camera/banned", //禁用摄像头
getCameraDetails:"camera/{cameraId}/detail", //获取摄像头详情
getAbility:"/camera/ability"//获取摄像头能力列表
login: "login",
logout: "logout",
getEnterprisesMembers: "enterprises/{enterpriseId}/members",
getNvr: "nvr",
getVender: "vender",
nvr: "nvr",
delNvr: "nvr/{nvrId}",
getNvrDetails: "nvr/detail/{nvrId}", //获取nvr详情
getExport: "camera/export", //nvr表格数据导出
getCamera: "camera/project", // 获取摄像头列表
putForbidden: "camera/banned", //禁用摄像头
delCamera:"camera", //删除摄像头
getCameraDetails: "camera/{cameraId}/detail", //获取摄像头详情
getCameraKind: "camera/kind", //获取摄像头种类列表
getAbility: "/camera/ability", //获取摄像头能力列表
postCameraYingshi: "camera/create/yingshi", //创建萤石摄像头
postCameraIpc: "camera/create/ipc", //创建IPC摄像头
};
export const RouteTable = {
apiRoot: '/api/root',
fileUpload: '/_upload/new',
cleanUpUploadTrash: '/_upload/cleanup',
apiRoot: "/api/root",
fileUpload: "/_upload/new",
cleanUpUploadTrash: "/_upload/cleanup",
};
Loading…
Cancel
Save