diff --git a/code/VideoAccess-VCMP/web/client/index.ejs b/code/VideoAccess-VCMP/web/client/index.ejs index 0e4ff01..70dffe5 100644 --- a/code/VideoAccess-VCMP/web/client/index.ejs +++ b/code/VideoAccess-VCMP/web/client/index.ejs @@ -4,7 +4,7 @@ - + diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx index ffe0152..c0769c9 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -58,7 +58,7 @@ const VideoPlay = ({ dispatch, actions, // audio: false, // serialNo: '34020000001310000003', // 设备序列号 必须 // topSerialNo: '34020000001110000079', // 设备顶级序列号 必须 - // playUrlSd: 'ws://221.230.55.27:8081/jessica/34020000001110000079/34020000001310000003', // 必须 + // playUrlSd: 'wss://221.230.55.27:8082/jessica/34020000001110000079/34020000001310000003.flv', // 必须 // // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', // // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', // }, @@ -393,12 +393,13 @@ const VideoPlay = ({ dispatch, actions, debug: true, showBandwidth: false, // 显示网速 operateBtns: { - fullscreen: true, + fullscreen: false, screenshot: false, play: false, audio: false, }, forceNoOffscreen: false, + controlAutoHide:true, isNotMute: false, }); setjessibuca(jessibuca) diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx index 05abe2b..fd2c278 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx @@ -86,8 +86,8 @@ const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, color: '#fff' }}> - 0 ? 'url(/assets/images/background/videoPlayBg.png)' : '', + - 480?15:10} style={{}}> + 480 ? 15 : 10} style={{}}>
{content && content?.length > 0 ? : ""}
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 d618a9e..0b2e91f 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 @@ -8,393 +8,393 @@ import { VideoPlayModal } from "$components"; let equipmentScrollbar; function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, testComplete, close, ashTrue, ashFalse }) { - const form = useRef(); - const { equipmentWarehouse } = actions; - const [sip, setSip] = useState([]); - const [cascadeList, setCascadeList] = useState([]); //nvr视频流列表 - const [CheckList, setCheckList] = useState([]); //nvr视频流多选 - const [isAllChoose, setIsAllChoose] = useState(false); //全选 - const [formData, setFormData] = useState() //表单数据 - const [videoPlay, setVideoPlay] = useState(false);//播放 - const [videoObj, setVideoObj] = useState(); //播放条件 + const form = useRef(); + const { equipmentWarehouse } = actions; + const [sip, setSip] = useState([]); + const [cascadeList, setCascadeList] = useState([]); //nvr视频流列表 + const [CheckList, setCheckList] = useState([]); //nvr视频流多选 + const [isAllChoose, setIsAllChoose] = useState(false); //全选 + const [formData, setFormData] = useState() //表单数据 + const [videoPlay, setVideoPlay] = useState(false);//播放 + const [videoObj, setVideoObj] = useState(); //播放条件 - useEffect(() => { - dispatch(equipmentWarehouse.getCascadeSIP()).then((res) => { - setSip(res.payload.data); - if (cameraData.id) { - let sip = res.payload.data.find((item) => item.streamid == cameraData.topSerialNo) - dispatch(equipmentWarehouse.getCascadeStream({ streamId: sip.streamid })).then((res) => { - let oneData = res.payload.data[0]; - let modifyData = res.payload.data.find( - (item) => item.id == cameraData.gbId - ); - let data = res.payload.data.map((item, index) => { - if (item.camera) { - item.name = item.camera.name; - } - if (item.id == cameraData.gbId) { - item = oneData; - } - if (index == 0) { - item = modifyData; - } - return item; - }) - setCascadeList(data) - setCheckList([data[0].id]) - }); - } - }); - const videoStreaming = document.getElementById("video_streaming"); - if (videoStreaming && equipmentScrollbar) { - equipmentScrollbar.update(); - } - }, []); - - useEffect(() => { - cascadeList - ? (equipmentScrollbar = new PerfectScrollbar("#video_streaming", { - suppressScrollX: true, - })) - : ""; - }, [cascadeList]); - - useEffect(() => { - //测试成功后获取级联视频流 - if (testComplete) { - dispatch(equipmentWarehouse.getCascadeStream({ streamId: formData.streamId })).then((res) => { - let chooseList = []; - let data = res.payload.data.map((item, index) => { - if (item.camera) { - item.name = item.camera.name; - } - return item; - }) - setCascadeList(data) - for (let index = 0; index < data.length; index++) { - chooseList.push(data[index].id); - } - setCheckList(chooseList); - setIsAllChoose(true); + useEffect(() => { + dispatch(equipmentWarehouse.getCascadeSIP()).then((res) => { + setSip(res.payload.data); + if (cameraData.id) { + let sip = res.payload.data.find((item) => item.streamid == cameraData.topSerialNo) + dispatch(equipmentWarehouse.getCascadeStream({ streamId: sip.streamid })).then((res) => { + let oneData = res.payload.data[0]; + let modifyData = res.payload.data.find( + (item) => item.id == cameraData.gbId + ); + let data = res.payload.data.map((item, index) => { + if (item.camera) { + item.name = item.camera.name; + } + if (item.id == cameraData.gbId) { + item = oneData; + } + if (index == 0) { + item = modifyData; + } + return item; + }) + setCascadeList(data) + setCheckList([data[0].id]) }); - } - close() - }, [testComplete]) - + } + }); + const videoStreaming = document.getElementById("video_streaming"); + if (videoStreaming && equipmentScrollbar) { + equipmentScrollbar.update(); + } + }, []); - //内存卡列表 - const memoryList = [ - { - 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(() => { + cascadeList + ? (equipmentScrollbar = new PerfectScrollbar("#video_streaming", { + suppressScrollX: true, + })) + : ""; + }, [cascadeList]); - function NvrChangeName (e, index, id) { - //级联摄像头视频流获取修改名称 - let NvrchangeList = JSON.parse(JSON.stringify(cascadeList)); - if (!cameraData.gbId || cameraData.gbId == id) { - NvrchangeList[index].change = true; - setCascadeList(NvrchangeList); - } - e.stopPropagation(); - } - function nvronBlur (index) { - //nvr摄像头名称修改失去焦点 - let NvrchangeList = JSON.parse(JSON.stringify(cascadeList)); - NvrchangeList[index].change = false; - setCascadeList(NvrchangeList); - } - function inputchange (e, index) { - //nvr摄像头名称修改 - let NvrchangeList = JSON.parse(JSON.stringify(cascadeList)); - NvrchangeList[index].name = e; - setCascadeList(NvrchangeList); - } - function allChoose (e) { - //全选/全不选 - let chooseList = []; - if (cascadeList.length == CheckList.length) { - setCheckList([]); - setIsAllChoose(false); - } else { - for (let index = 0; index < cascadeList.length; index++) { - chooseList.push(cascadeList[index].id); + useEffect(() => { + //测试成功后获取级联视频流 + if (testComplete) { + dispatch(equipmentWarehouse.getCascadeStream({ streamId: formData.streamId })).then((res) => { + let chooseList = []; + let data = res.payload.data.map((item, index) => { + if (item.camera) { + item.name = item.camera.name; + } + return item; + }) + setCascadeList(data) + for (let index = 0; index < data.length; index++) { + chooseList.push(data[index].id); } setCheckList(chooseList); setIsAllChoose(true); - } - } - function playVideo (e, id) { - //nvr播放视频 - if (cameraData.gbId == id || !cameraData.gbId) { - let data = cascadeList.find((item) => item.id == id) - setVideoObj({ - type: 'cascade', - audio: false, - serialNo: data.streamid, - topSerialNo: cameraData.id ? cameraData.topSerialNo : formData?.streamId, - playUrlSd: data?.playUrl?.liveUrl?.sd["WS-RAW"], - content: data?.camera?.cameraRemarks.map((item) => item.remark), - }) - setVideoPlay(true); - } - e.stopPropagation(); - } - function onDisabled (id) { - if (id == cameraData.gbId || !cameraData.gbId) { - return false; - } else { - return true; - } - } + }); + } + close() + }, [testComplete]) - useImperativeHandle(dRef, () => ({ - //传给父组件方法 - //子组件暴露给父组件的方法 - cascadeCameraForm: form.current.validate, - resetCascadeCamera: form.current.reset, - cascadeList: cascadeList.filter((v) => - CheckList.some((e) => e == v.id) - ), - toempty: () => { - setCascadeList([]) - } - })); - return ( - <> -
{ - setFormData(values) - let setting = ["externalDomain", "cascadeType", "streamId"] - let b = {} - setting.map((item) => { - if (values.hasOwnProperty(item)) { - return b.true = values.hasOwnProperty(item) - } else { - return b.false = values.hasOwnProperty(item) - } - }) - Object.keys(b).length == 1 ? ashTrue() : ashFalse() - }} - initValues={{ - externalDomain: cameraData.externalDomain || "" - }} - getFormApi={(formApi) => (form.current = formApi)} - > - - - - - - - - 上级域 - - - - - - {sip.map((item, index) => ( - - {item.streamid} - - ))} - - - - + //内存卡列表 + const memoryList = [ + { + 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", + }, + ]; -
- {cascadeList.length > 0 ? ( -
- allChoose(e)} - aria-label="全选" - > - 全选 - -
- ) : ( - "" - )} - { - setCheckList(nvrCheck); - if (cascadeList.length == nvrCheck.length) { - setIsAllChoose(true); - } else { - setIsAllChoose(false); - } - }}> - {cascadeList.length > 0 - ? cascadeList.map((item, index) => ( - - -
-
- 通道名称: - {item.change ? ( - inputchange(e, index)} - onBlur={() => nvronBlur(index)} - onClick={(e) => e.stopPropagation()} - > - ) : ( - item.name - )} -
-
- - NvrChangeName(e, index, item.id) - } - /> -
-
-
- 设备编号:{item.streamid} -
-
- playVideo(e, item.id)} - /> -
-
- } - style={{ width: 280, border: "1px solid #F9F9F9" }} - > - - )) - : ""} - - + function NvrChangeName (e, index, id) { + //级联摄像头视频流获取修改名称 + let NvrchangeList = JSON.parse(JSON.stringify(cascadeList)); + if (!cameraData.gbId || cameraData.gbId == id) { + NvrchangeList[index].change = true; + setCascadeList(NvrchangeList); + } + e.stopPropagation(); + } + function nvronBlur (index) { + //nvr摄像头名称修改失去焦点 + let NvrchangeList = JSON.parse(JSON.stringify(cascadeList)); + NvrchangeList[index].change = false; + setCascadeList(NvrchangeList); + } + function inputchange (e, index) { + //nvr摄像头名称修改 + let NvrchangeList = JSON.parse(JSON.stringify(cascadeList)); + NvrchangeList[index].name = e; + setCascadeList(NvrchangeList); + } + function allChoose (e) { + //全选/全不选 + let chooseList = []; + if (cascadeList.length == CheckList.length) { + setCheckList([]); + setIsAllChoose(false); + } else { + for (let index = 0; index < cascadeList.length; index++) { + chooseList.push(cascadeList[index].id); + } + setCheckList(chooseList); + setIsAllChoose(true); + } + } + function playVideo (e, id) { + //nvr播放视频 + if (cameraData.gbId == id || !cameraData.gbId) { + let data = cascadeList.find((item) => item.id == id) + setVideoObj({ + type: 'cascade', + audio: false, + serialNo: data.streamid, + topSerialNo: cameraData.id ? cameraData.topSerialNo : formData?.streamId, + playUrlSd: data?.playUrl?.liveUrl?.sd["WS-RAW"], + content: data?.camera?.cameraRemarks.map((item) => item.remark), + }) + setVideoPlay(true); + } + e.stopPropagation(); + } + function onDisabled (id) { + if (id == cameraData.gbId || !cameraData.gbId) { + return false; + } else { + return true; + } + } -
-
- {videoPlay ? - { - setVideoPlay(false) - }} /> - : "" - } - - ); + useImperativeHandle(dRef, () => ({ + //传给父组件方法 + //子组件暴露给父组件的方法 + cascadeCameraForm: form.current.validate, + resetCascadeCamera: form.current.reset, + cascadeList: cascadeList.filter((v) => + CheckList.some((e) => e == v.id) + ), + toempty: () => { + setCascadeList([]) + } + })); + return ( + <> +
{ + setFormData(values) + let setting = ["externalDomain", "cascadeType", "streamId"] + let b = {} + setting.map((item) => { + if (values.hasOwnProperty(item)) { + return b.true = values.hasOwnProperty(item) + } else { + return b.false = values.hasOwnProperty(item) + } + }) + Object.keys(b).length == 1 ? ashTrue() : ashFalse() + + }} + initValues={{ + externalDomain: cameraData.externalDomain || "" + }} + getFormApi={(formApi) => (form.current = formApi)} + > + + + + + + + + 上级域 + + + + + + {sip.map((item, index) => ( + + {item.streamid} + + ))} + + + + + +
+ {cascadeList.length > 0 ? ( +
+ allChoose(e)} + aria-label="全选" + > + 全选 + +
+ ) : ( + "" + )} + { + setCheckList(nvrCheck); + if (cascadeList.length == nvrCheck.length) { + setIsAllChoose(true); + } else { + setIsAllChoose(false); + } + }}> + {cascadeList.length > 0 + ? cascadeList.map((item, index) => ( + + +
+
+ 通道名称: + {item.change ? ( + inputchange(e, index)} + onBlur={() => nvronBlur(index)} + onClick={(e) => e.stopPropagation()} + > + ) : ( + item.name + )} +
+
+ + NvrChangeName(e, index, item.id) + } + /> +
+
+
+ 设备编号:{item.streamid} +
+
+ playVideo(e, item.id)} + /> +
+
+ } + style={{ width: 280, border: "1px solid #F9F9F9" }} + > + + )) + : ""} + + + +
+
+ {videoPlay ? + { + setVideoPlay(false) + }} /> + : "" + } + + ); } function mapStateToProps (state) { - const { auth, global, members } = state; - return { - loading: members.isRequesting, - user: auth.user, - actions: global.actions, - members: members.data, - }; + const { auth, global, members } = state; + return { + loading: members.isRequesting, + user: auth.user, + actions: global.actions, + members: members.data, + }; } export default connect(mapStateToProps)(cascadeCamera); diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx index 8ab98ba..ae18dd4 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx @@ -96,7 +96,7 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData, ashTrue, }} initValues={{ name: cameraData.name || "", - highDefinition: cameraData?.highDefinition || "", + highDefinition: cameraData?.highDefinition, memoryCard: cameraData.memoryCard || "", position: cameraData.longitude ? `${cameraData.longitude},${cameraData.latitude}` @@ -106,8 +106,8 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData, ashTrue, ? cameraData.cameraAbilities.map((item) => item.id) : "" , - cloudControl: cameraData.cloudControl || "", - voice: cameraData.voice || "", + cloudControl: cameraData.cloudControl, + voice: cameraData.voice, serialNo: cameraData.serialNo || "", channelNo: cameraData.channelNo || "", // rtmp: cameraData.rtmp || "", diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx index 64b94e0..ee8ec95 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx @@ -109,9 +109,9 @@ function ipcCamera ({ : "", kindId: cameraData.kindId || "", abilityId: cameraData.cameraAbilities ? cameraData.cameraAbilities.map((item) => item.id) : "", - cloudControl: cameraData.cloudControl || "", + cloudControl: cameraData.cloudControl, voice: cameraData.voice || "", - serialNo: cameraData.serialNo || "", + serialNo: cameraData.serialNo, rtmp: "此处无效 自动生成", // rtmp: cameraData.rtmp || "", }} 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 cd7d739..eb11d0d 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 @@ -138,6 +138,7 @@ function SideSheets (props) { rowId ) ).then((res) => { + if(res?.success){ setNvrDetails(res.payload.data); projectScrollbar = new PerfectScrollbar("#project_information", { suppressScrollX: true, @@ -146,6 +147,8 @@ function SideSheets (props) { suppressScrollX: true, }); + + } }); }, []); @@ -180,7 +183,7 @@ function SideSheets (props) { {nvrDetails?.name} + <>{nvrDetails?.name} : <>{nvrDetails?.name} } style={{ background: "#F9FBFF" }} diff --git a/code/VideoAccess-VCMP/web/package.json b/code/VideoAccess-VCMP/web/package.json index d2d19ed..317b8bc 100644 --- a/code/VideoAccess-VCMP/web/package.json +++ b/code/VideoAccess-VCMP/web/package.json @@ -7,7 +7,7 @@ "test": "mocha", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params", - "start-params": "node server -p 5000 -u http://localhost:4000 --apiVcmpUrl http://localhost:4000 --apiAuthUrl http://localhost:4200 --apiAnxinyunUrl http://localhost:4100 --iotAuthWeb http://localhost:5200 --iotVideoServer http://221.230.55.27:8081", + "start-params": "node server -p 5000 -u http://localhost:4000 --apiVcmpUrl http://localhost:4000 --apiAuthUrl http://localhost:4200 --apiAnxinyunUrl http://localhost:4100 --iotAuthWeb http://localhost:5200 --iotVideoServer http://iotmedia.anxinyun.cn", "deploy": "export NODE_ENV=production&& npm run build && node server", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js"