diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js
index 2f5c892..dd35adf 100644
--- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js
@@ -125,3 +125,27 @@ export function postCameraNvr(data) {
msg: { option: "" }, //记录NVR摄像头
});
}
+
+export function getCascadeSIP() {
+ return (dispatch) =>
+ basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_CASCADE_SIP",
+ url: `${ApiTable.getCascadeSIP}`,
+ msg: { option: "" }, //获取级联摄像头sip列表
+ });
+}
+
+
+export function postAddCascade(data) {
+ return (dispatch) =>
+ basicAction({
+ type: "post",
+ dispatch: dispatch,
+ data,
+ actionType: "POST_ADD_CASCADE",
+ url: `${ApiTable.postAddCascade}`,
+ msg: { option: "" }, //添加级联摄像头
+ });
+}
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 ba3cf9f..91bccc3 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
@@ -44,6 +44,7 @@ function cameraModal(props) {
useEffect(() => {
dispatch(equipmentWarehouse.getCameraKind());
dispatch(equipmentWarehouse.getAbility());
+ cameraData.type == "nvr" ? setcameraList(cameraList.slice(1, 4)) : "";
}, []);
const cameraList = [
//循环摄像头列表
@@ -124,8 +125,16 @@ function cameraModal(props) {
});
});
} else if (clickNum == 4) {
- console.log("44444444444444");
- close();
+ //级联摄像头
+ cascadeRef.current.cascadeCameraForm().then((values) => {
+ console.log(values);
+ dispatch(equipmentWarehouse.postAddCascade(values)).then((res) => {
+ console.log(res);
+ if (res.success) {
+ onReset();
+ }
+ });
+ });
}
}
function handleAfterClose() {
@@ -157,6 +166,7 @@ function cameraModal(props) {
ipcRef.current.toempty();
close();
} else if (clickNum == 4) {
+ cascadeRef.current.resetCascadeCamera();
close();
} else {
nvrRef.current.resetFluoriteCamera();
@@ -172,6 +182,7 @@ function cameraModal(props) {
ipcRef.current.resetIpcCamera();
ipcRef.current.toempty();
} else if (clickNum == 4) {
+ cascadeRef.current.resetCascadeCamera();
} else {
nvrRef.current.resetFluoriteCamera();
}
@@ -459,7 +470,7 @@ function cameraModal(props) {
cameraData={cameraData}
/>
) : clickNum == 2 ? (
-
+
) : clickNum == 3 ? (
) : (
-
+
)}
diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
index 725c1be..2ffe25d 100644
--- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
@@ -1,179 +1,110 @@
-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,CheckboxGroup, Checkbox,Radio,Input } from '@douyinfe/semi-ui';
-import { IconEdit,IconPlayCircle } from '@douyinfe/semi-icons';
+import { Form, Row, Col } from "@douyinfe/semi-ui";
+
import "./cameraModal.less";
-function cascadeCamera({dRef}){
+function cascadeCamera({ dRef, dispatch, actions }) {
const form = useRef();
- const [memoryList,setMemoryList] = useState([
+ const { equipmentWarehouse } = actions;
+ const [sip, setSip] = useState([]);
+
+ useEffect(() => {
+ dispatch(equipmentWarehouse.getCascadeSIP()).then((res) => {
+ console.log(res)
+ setSip(res.payload.data);
+ });
+ }, []);
+
+ //内存卡列表
+ const memoryList = [
+ {
+ id: 1,
+ value: "8g",
+ },
+ {
+ id: 2,
+ value: "16g",
+ },
+ {
+ id: 3,
+ value: "32g",
+ },
+ {
+ id: 4,
+ value: "64g",
+ },
{
- 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'
- }
- ])//内存卡列表
- const [nvrCheckList, setNvrCheckList] = useState([]);//nvr视频流多选
- const [NVRcameraList,setNVRcameraList]=useState([])//nvr视频流列表
- const [isAllChoose,setIsAllChoose]=useState(false)//全选
- const [equipmentNum,setEquipmentNum]=useState('')//nvr视频编号
- function NvrChangeName(e,index){//nvr摄像头视频流获取修改名称
- let NvrchangeList = JSON.parse(JSON.stringify(NVRcameraList))
- NvrchangeList[index].change=true
- setNVRcameraList(NvrchangeList)
- e.stopPropagation()
- }
- function nvronBlur(index){//nvr摄像头名称修改失去焦点
- let NvrchangeList = JSON.parse(JSON.stringify(NVRcameraList))
- NvrchangeList[index].change=false
- setNVRcameraList(NvrchangeList)
- }
- function inputchange(e,index){//nvr摄像头名称修改
- let NvrchangeList = JSON.parse(JSON.stringify(NVRcameraList))
- NvrchangeList[index].name=e
- setNVRcameraList(NvrchangeList)
- }
- function toggle(e,index){//nvr云台支持
- let NvrchangeList = JSON.parse(JSON.stringify(NVRcameraList))
- NvrchangeList[index].support=e.target.checked
- setNVRcameraList(NvrchangeList)
- e.stopPropagation()
- }
- function allChoose(e){//全选/全不选
- let chooseList=[]
- if(NVRcameraList.length==nvrCheckList.length){
- setNvrCheckList([])
- setIsAllChoose(false)
- }
- else{
- for (let index = 0; index < NVRcameraList.length; index++) {
- chooseList.push(NVRcameraList[index].id)
- }
- setNvrCheckList(chooseList)
- setIsAllChoose(true)
- }
- }
- function playVideo(e) {//nvr播放视频
- console.log('22222222222222222');
- e.stopPropagation()
- }
- useImperativeHandle(dRef,() => ({//传给父组件方法
+ id: 5,
+ value: "128g",
+ },
+ {
+ id: 6,
+ value: "256g",
+ },
+ {
+ id: 7,
+ value: ">256g",
+ },
+ ];
+
+ useImperativeHandle(dRef, () => ({
+ //传给父组件方法
//子组件暴露给父组件的方法
- cascadeCameraForm : form.current.validate,
- resetCascadeCamera : form.current.reset,
- setNVRcameraList : setNVRcameraList,
- setNvrCheckList : setNvrCheckList,
- setIsAllChoose : setIsAllChoose,
- }))
+ cascadeCameraForm: form.current.validate,
+ resetCascadeCamera: form.current.reset,
+ }));
return (
<>
-
>
@@ -189,4 +120,4 @@ function mapStateToProps(state) {
};
}
-export default connect(mapStateToProps)(cascadeCamera);
\ No newline at end of file
+export default connect(mapStateToProps)(cascadeCamera);
diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
index 664180c..464c3af 100644
--- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
@@ -13,10 +13,12 @@ import {
import { IconEdit, IconPlayCircle } from "@douyinfe/semi-icons";
import "./cameraModal.less";
import PerfectScrollbar from "perfect-scrollbar";
+import { isIndexed } from "immutable";
let equipmentScrollbar;
-function nvrCamera({ dispatch, actions, nvrRef }) {
+function nvrCamera({ dispatch, actions, nvrRef, cameraData }) {
const { equipmentWarehouse } = actions;
+ const cameraDataNvr = cameraData.nvr || "";
const form = useRef();
const [nvrCheckList, setNvrCheckList] = useState([]); //nvr视频流多选
const [NVRcameraList, setNVRcameraList] = useState([]); //nvr视频流列表
@@ -36,12 +38,54 @@ function nvrCamera({ dispatch, actions, nvrRef }) {
equipmentScrollbar.update();
}
});
- function NvrChangeName(e, index) {
+ useEffect(() => {
+ cameraDataNvr
+ ? dispatch(
+ equipmentWarehouse.getVideoStreaming({
+ streamId: cameraDataNvr.serialNo,
+ })
+ ).then((res) => {
+ let oneData = res.payload.data[0];
+
+ let modifyData = res.payload.data.find(
+ (item) => item.camera.name == cameraData.name
+ );
+ console.log(oneData);
+ console.log(modifyData);
+ let data = res.payload.data.map((item, index) => {
+ if (index == 0) {
+ item = modifyData;
+ }
+ if (
+ item.camera
+ ? item.camera.name == cameraData.name && index > 0
+ : index < 0
+ ) {
+ item = oneData;
+ }
+ item.change = false;
+ item.support = false;
+ if (item.camera) {
+ item.name = item.camera.name;
+ }
+
+ return item;
+ });
+ console.log(data);
+ setNVRcameraList(data);
+
+ setNvrCheckList([data[0].id]);
+ })
+ : "";
+ }, []);
+ function NvrChangeName(e, index, name) {
//nvr摄像头视频流获取修改名称
let NvrchangeList = JSON.parse(JSON.stringify(NVRcameraList));
- NvrchangeList[index].change = true;
- setNVRcameraList(NvrchangeList);
- e.stopPropagation();
+ if (!cameraDataNvr || cameraData.name == name) {
+ NvrchangeList[index].change = true;
+ setNVRcameraList(NvrchangeList);
+ e.stopPropagation();
+ }
}
function nvronBlur(index) {
//nvr摄像头名称修改失去焦点
@@ -58,7 +102,9 @@ function nvrCamera({ dispatch, actions, nvrRef }) {
}
function toggle(e, index) {
//nvr云台支持
+ console.log(e)
let NvrchangeList = JSON.parse(JSON.stringify(NVRcameraList));
+ console.log(NvrchangeList)
NvrchangeList[index].support = e.target.checked;
setNVRcameraList(NvrchangeList);
e.stopPropagation();
@@ -112,11 +158,18 @@ function nvrCamera({ dispatch, actions, nvrRef }) {
console.log("22222222222222222");
e.stopPropagation();
}
+ function onDisabled(name) {
+ if ((cameraDataNvr && cameraData.name == name) || !cameraDataNvr) {
+ return false;
+ } else {
+ return true;
+ }
+ }
useImperativeHandle(nvrRef, () => ({
//传给父组件方法
//aa即为子组件暴露给父组件的方法
resetFluoriteCamera: form.current.reset,
- equipmentNum: equipmentNum,
+ equipmentNum: cameraDataNvr ? cameraDataNvr.serialNo : equipmentNum,
NVRcameraList: NVRcameraList.filter((v) =>
nvrCheckList.some((e) => e == v.id)
),
@@ -138,7 +191,8 @@ function nvrCamera({ dispatch, actions, nvrRef }) {
field="serialNo"
maxLength="39"
label="设备编号:"
- initValue={""}
+ disabled={cameraDataNvr ? true : false}
+ initValue={cameraDataNvr ? cameraDataNvr.serialNo : ""}
placeholder="请输入设备编号"
style={{ width: 307 }}
rules={[
@@ -164,6 +218,7 @@ function nvrCamera({ dispatch, actions, nvrRef }) {
allChoose(e)}
aria-label="全选"
>
@@ -189,7 +244,10 @@ function nvrCamera({ dispatch, actions, nvrRef }) {
}
}}
>
-
+
{NVRcameraList.length > 0
? NVRcameraList.map((item, index) => (
NvrChangeName(e, index)}
+ onClick={(e) =>
+ NvrChangeName(e, index, item.name)
+ }
/>
- 设备编号:{item.parent}
+ 设备编号:{item.streamid}
toggle(e, index)}
aria-label="单选"
>
diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
index 7bd5b36..cdd3a65 100644
--- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
@@ -37,14 +37,10 @@ function SideSheets(props) {
{ name: "厂商:", key: "venderId" },
{ name: "添加账号:", key: "createUser" },
{ name: "添加时间:", key: "createTime" },
- {
- name: "行政区别:",
- key: "江西省-南昌市-南昌县",
- difference: "difference",
- },
+ { name: "行政区划:", key: "regionCode" },
{
name: "设备安装位置:",
- key: "江西省南昌县小蓝经开区江西飞尚科技有限公司",
+ key: "latitude",
difference: "line",
},
],
@@ -94,7 +90,7 @@ function SideSheets(props) {
{ name: "添加时间:", key: "createTime" },
{
name: "设备安装位置:",
- key: "江西省南昌县小蓝经开区江西飞尚科技有限公司",
+ key: "latitude",
difference: "line",
},
],
@@ -206,7 +202,8 @@ function SideSheets(props) {