From 0355135113176bbbf0b0dd84b7894269179a704a Mon Sep 17 00:00:00 2001 From: longyvfengyun <496960745@qq.com> Date: 星期二, 22 八月 2023 09:52:40 +0800 Subject: [PATCH] 视频内容提交 --- src/views/video/components/js/hkVideo/hkModule.js | 38 ++++++--- src/views/home/index.vue | 1 src/views/mainLayout/components/SlideMenu.vue | 56 +++++++------- src/views/home/js/homeInfoModule.js | 64 ++++++++++++++-- src/components/MapPin.vue | 8 + src/views/video/components/hkVideo.vue | 48 ++++++++++-- 6 files changed, 155 insertions(+), 60 deletions(-) diff --git a/src/components/MapPin.vue b/src/components/MapPin.vue index 36dec90..0d9182d 100644 --- a/src/components/MapPin.vue +++ b/src/components/MapPin.vue @@ -26,6 +26,10 @@ type: Number, default: 100 }, + placement: { + type: String, + default: "top" + }, x: { type: Number, default: 0 @@ -63,9 +67,9 @@ </script> <template> - <div class="map-pin" :style="posStyle"> + <div class="map-pin" :style="posStyle" v-if="visible"> <div class="map-pin-wrapper"> - <el-tooltip placement="top" :visible="visible"> + <el-tooltip :placement="placement" :visible="visible"> <template #content> <div class="home-info name">{{name}}</div> <div class="home-info">娓╁害锛歿{ info.tmp }} 鈩�</div> diff --git a/src/views/home/index.vue b/src/views/home/index.vue index b2f5b74..b2acb6a 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -65,6 +65,7 @@ v-if="isShowMapPin" v-for="(item, index) in homeInfo" :key="'key'+index" :visible="item.pos.visible" + :placement="item.pos.placement" :name="item.name" :c-width="cWidth" :c-height="cHeight" :d-width="dWidth" :d-height="dHeight" diff --git a/src/views/home/js/homeInfoModule.js b/src/views/home/js/homeInfoModule.js index e2b4096..d92a961 100644 --- a/src/views/home/js/homeInfoModule.js +++ b/src/views/home/js/homeInfoModule.js @@ -16,7 +16,7 @@ let iData = data[i]; for(let j=0; j<homeInfo.length; j++) { let jData = homeInfo[j]; - if(iData.roomName === jData.name && iData.devId === 220000001) { + if(iData.roomName === jData.name) { jData.info.tmp = iData.envirState.devTemp.toHold(2); jData.info.hum = iData.envirState.devHumid.toHold(2); jData.info.diff = iData.envirState.devPresss.toHold(2); @@ -33,7 +33,8 @@ hum: 7, diffPre: 1, pos: { - visible: true, + visible: false, + placement: "top", x: 710, y: 690 }, @@ -51,6 +52,7 @@ diffPre: 1, pos: { visible: true, + placement: "top", x: 916, y: 690 }, @@ -68,6 +70,7 @@ diffPre: 1, pos: { visible: true, + placement: "left", x: 1212, y: 690 }, @@ -85,6 +88,7 @@ diffPre: 1, pos: { visible: true, + placement: "top", x: 1395, y: 690 }, @@ -96,12 +100,13 @@ } }, { - name: "鏂囧簱鎵╁睍", + name: "鏂囧簱鎵╁瀹�", temp: 32, hum: 7, diffPre: 1, pos: { visible: true, + placement: "top", x: 1576, y: 650 }, @@ -119,6 +124,7 @@ diffPre: 1, pos: { visible: true, + placement: "top", x: 1495, y: 337 }, @@ -136,6 +142,7 @@ diffPre: 1, pos: { visible: true, + placement: "top", x: 1190, y: 355 }, @@ -153,6 +160,7 @@ diffPre: 1, pos: { visible: true, + placement: "top", x: 1000, y: 378 }, @@ -169,7 +177,8 @@ hum: 0, diffPre: 0, pos: { - visible: true, + visible: false, + placement: "top", x: 550, y: 380 }, @@ -186,7 +195,8 @@ hum: 0, diffPre: 0, pos: { - visible: true, + visible: false, + placement: "top", x: 750, y: 360 }, @@ -203,7 +213,8 @@ hum: 0, diffPre: 0, pos: { - visible: true, + visible: false, + placement: "top", x: 420, y: 700 }, @@ -220,7 +231,8 @@ hum: 0, diffPre: 0, pos: { - visible: true, + visible: false, + placement: "top", x: 420, y: 1100 }, @@ -230,7 +242,43 @@ hum: 0, diff: 0 } - } + }, + { + name: "缂撳啿闂�", + temp: 32, + hum: 7, + diffPre: 1, + pos: { + visible: true, + placement: "top", + x: 820, + y: 490 + }, + info: { + num: 99, + tmp: 0, + hum: 0, + diff: 0 + } + }, + { + name: "娲佸噣璧板粖", + temp: 32, + hum: 7, + diffPre: 1, + pos: { + visible: true, + placement: "left", + x: 1200, + y: 490 + }, + info: { + num: 99, + tmp: 0, + hum: 0, + diff: 0 + } + }, ]); onMounted(()=>{ diff --git a/src/views/mainLayout/components/SlideMenu.vue b/src/views/mainLayout/components/SlideMenu.vue index 97f1860..fda289b 100644 --- a/src/views/mainLayout/components/SlideMenu.vue +++ b/src/views/mainLayout/components/SlideMenu.vue @@ -29,34 +29,34 @@ path: "/video", icon: "VideoCameraFilled", }, - { - title: "鐢ㄦ埛绠$悊", - path: "/userManagement", - icon: "UserFilled" - }, - { - title: "璧勪骇绠$悊", - path: "/asset", - icon: "School", - children: [ - { - title: "闂ㄧ璧勪骇绠$悊", - path: "/asset/accessControl", - }, - { - title: "绌鸿皟璧勪骇绠$悊", - path: "/asset/air", - }, - { - title: "瑙嗛鐩戞帶璧勪骇绠$悊", - path: "/asset/video", - }, - { - title: "鏈烘埧閲囬泦妯″潡绠$悊", - path: "/asset/homeModule", - } - ] - }, + // { + // title: "鐢ㄦ埛绠$悊", + // path: "/userManagement", + // icon: "UserFilled" + // }, + // { + // title: "璧勪骇绠$悊", + // path: "/asset", + // icon: "School", + // children: [ + // { + // title: "闂ㄧ璧勪骇绠$悊", + // path: "/asset/accessControl", + // }, + // { + // title: "绌鸿皟璧勪骇绠$悊", + // path: "/asset/air", + // }, + // { + // title: "瑙嗛鐩戞帶璧勪骇绠$悊", + // path: "/asset/video", + // }, + // { + // title: "鏈烘埧閲囬泦妯″潡绠$悊", + // path: "/asset/homeModule", + // } + // ] + // }, ]; watchEffect(()=>{ diff --git a/src/views/video/components/hkVideo.vue b/src/views/video/components/hkVideo.vue index 249b0e3..a8584a9 100644 --- a/src/views/video/components/hkVideo.vue +++ b/src/views/video/components/hkVideo.vue @@ -5,12 +5,32 @@ companyVideoData: { type: Object, default() { - return { - ip: "192.168.10.10", - port: 80, - username: "admin", - password: "a123456789" - }; + return [ + { + ip: "192.168.10.5", + port: 80, + username: "admin", + password: "a123456789" + }, + { + ip: "192.168.10.6", + port: 80, + username: "admin", + password: "a123456789" + }, + { + ip: "192.168.10.4", + port: 80, + username: "admin", + password: "a123456789" + }, + { + ip: "192.168.10.3", + port: 80, + username: "admin", + password: "a123456789" + } + ]; }, }, }); @@ -22,13 +42,25 @@ } = hkModule(); onMounted(()=>{ + for(let i=0; i<props.companyVideoData.length; i++) { + let item = props.companyVideoData[i]; + WebVideoCtrl.I_Logout(item.ip+"_"+item.port); + } videoInitPlugin(()=>{ - clickLogin(props.companyVideoData); + for(let i=0; i<props.companyVideoData.length; i++) { + let item = props.companyVideoData[i]; + setTimeout(()=>{ + clickLogin(item, i); + }, 1000); + } }); }); onUnmounted(()=>{ - WebVideoCtrl.I_Logout(props.companyVideoData.ip); + for(let i=0; i<props.companyVideoData.length; i++) { + let item = props.companyVideoData[i]; + WebVideoCtrl.I_Logout(item.ip+"_"+item.port); + } WebVideoCtrl.I_GetPluginOBJECT().JS_DestroyPlugin(); }); </script> diff --git a/src/views/video/components/js/hkVideo/hkModule.js b/src/views/video/components/js/hkVideo/hkModule.js index a6ca057..0ac7c79 100644 --- a/src/views/video/components/js/hkVideo/hkModule.js +++ b/src/views/video/components/js/hkVideo/hkModule.js @@ -7,7 +7,7 @@ const hkModule = ()=>{ const {isCollapse} = slideMenu(); const divPlugin = ref(null); - const iWndowType = ref(1); + const iWndowType = ref(3); const gIWndIndex = ref(0); const videoInitPlugin = (cbComplete)=>{ let iRet = WebVideoCtrl.I_CheckPluginInstall(); @@ -20,7 +20,7 @@ const initPlugin = (cbComplete)=>{ WebVideoCtrl.I_InitPlugin({ - bWndFull: false, //鏄惁鏀寔鍗曠獥鍙e弻鍑诲叏灞� + bWndFull: true, //鏄惁鏀寔鍗曠獥鍙e弻鍑诲叏灞� iWndowType: iWndowType.value, bDebugMode:true, cbSelWnd: function (xmlDoc){ @@ -39,15 +39,24 @@ }); } - const clickLogin = (data)=>{ - console.log(data); + const clickLogin = (data, iWndIndex)=>{ WebVideoCtrl.I_Login(data.ip, 1, data.port, data.username, data.password, { timeout: 3000, success: function () { console.log("寮�濮嬮瑙�"); //涓嶈兘鍒犻櫎 - setTimeout(()=>{ - initPlay(data.ip, data.port); - }, 1000); + // 妯℃嫙閫氶亾 + WebVideoCtrl.I_GetAnalogChannelInfo(data.ip, { + success: function (xmlDoc) { + setTimeout(()=>{ + initPlay(data.ip, data.port, iWndIndex); + }, 1000); + }, + error: function (oError) { + setTimeout(()=>{ + initPlay(data.ip, data.port, iWndIndex); + }, 1000); + } + }); }, error: function () { console.log("login error"); @@ -64,24 +73,26 @@ }); }; - const initPlay = (ip, port)=>{ - let oWndInfo = WebVideoCtrl.I_GetWindowStatus(0); + const initPlay = (ip, port, iWndIndex)=>{ + let oWndInfo = WebVideoCtrl.I_GetWindowStatus(iWndIndex); if (oWndInfo != null) {// 宸茬粡鍦ㄦ挱鏀句簡锛屽厛鍋滄 WebVideoCtrl.I_Stop({ + iWndIndex, success: function () { - startRealPlay(ip, port); + startRealPlay(ip, port, iWndIndex); } }); } else { - startRealPlay(ip, port); + startRealPlay(ip, port, iWndIndex); } } - const startRealPlay = (ip, port)=>{ + const startRealPlay = (ip, port, iWndIndex)=>{ WebVideoCtrl.I_StartRealPlay(ip, { iStreamType: 1, iChannelID: 1, + iWndIndex, bZeroChannel: false, success: function () { console.log("寮�濮嬮瑙堟垚鍔燂紒"); @@ -102,10 +113,9 @@ watch( isCollapse, (newVal)=>{ - //changeWndNum(newVal[0]); setTimeout(()=>{ WebVideoCtrl.I_My_Resize(); - }, 0); + }, 300); }, ); -- Gitblit v1.9.1