Explorar o código

演示监控相关修改 获取特定实验室摄像头

dedsudiyu hai 2 semanas
pai
achega
5e5dab0a35
Modificáronse 1 ficheiros con 42 adicións e 36 borrados
  1. 42 36
      src/components/LabStats/videoStats.vue

+ 42 - 36
src/components/LabStats/videoStats.vue

@@ -7,12 +7,13 @@
       <!--<webRTC v-if="webRtcType"></webRTC>-->
       <!--<videoForMod v-for="(item,index) in modList" :key="index"-->
                    <!--:deviceNo="item.deviceNo"></videoForMod>-->
-      <mpegts-video style="display: inline-block" :videoProps="item" v-for="(item,index) in demoList" :key="index"></mpegts-video>
+      <mpegts-video style="display: inline-block;margin:0 5px 5px 0;"
+                    :videoProps="item" v-for="(item,index) in demoList" :key="index"></mpegts-video>
     </div>
   </div>
 </template>
 <script>
-  import { getVideoList,laboratoryLabScreenScreenConfigGet,iotDeviceList } from '@/api/index'
+  import { getVideoList,laboratoryLabScreenScreenConfigGet,iotDeviceList,iotCameraFindByCondition } from '@/api/index'
   import videoForMod from '@/components/videoForMod/videoForMod.vue'
   import webRTC from './webRTC.vue'
   import mpegtsVideo from '@/components/mpegtsVideo/mpegtsVideo.vue'
@@ -31,40 +32,7 @@
         pollTimer:null,
         page:1,
         webRtcType:false,
-        demoList:[
-          {
-            id:1,        //(ID:非必传-默认随机生成)
-            width:470,    //(宽度:非必传-默认600)
-            height:280,   //(高度:非必传-默认338)
-            type:'flv',   //(视频类型:非必传-默认'flv')
-            isLive:true,  //(是否直播流:非必传-默认true)
-            url:"http://192.168.1.88:8230/rtp/440102004920000000010064_34020000001320000064.flv"        //(视频地址:必传)
-          },
-          {
-            id:2,        //(ID:非必传-默认随机生成)
-            width:470,    //(宽度:非必传-默认600)
-            height:280,   //(高度:非必传-默认338)
-            type:'flv',   //(视频类型:非必传-默认'flv')
-            isLive:true,  //(是否直播流:非必传-默认true)
-            url:"http://192.168.1.88:8230/rtp/440102004920000000010064_34020000001320000064.flv"        //(视频地址:必传)
-          },
-          {
-            id:3,        //(ID:非必传-默认随机生成)
-            width:470,    //(宽度:非必传-默认600)
-            height:280,   //(高度:非必传-默认338)
-            type:'flv',   //(视频类型:非必传-默认'flv')
-            isLive:true,  //(是否直播流:非必传-默认true)
-            url:"http://192.168.1.88:8230/rtp/440102004920000000010064_34020000001320000064.flv"        //(视频地址:必传)
-          },
-          {
-            id:4,        //(ID:非必传-默认随机生成)
-            width:470,    //(宽度:非必传-默认600)
-            height:280,   //(高度:非必传-默认338)
-            type:'flv',   //(视频类型:非必传-默认'flv')
-            isLive:true,  //(是否直播流:非必传-默认true)
-            url:"http://192.168.1.88:8230/rtp/440102004920000000010064_34020000001320000064.flv"        //(视频地址:必传)
-          },
-        ],
+        demoList:[],
       }
     },
     created(){
@@ -73,8 +41,46 @@
     mounted(){
       // this.laboratoryLabScreenScreenConfigGet();
       // this.pollTimer = setInterval(this.laboratoryLabScreenScreenConfigGet, 5 * 60 * 1000)
+
+      this.initialize();
     },
     methods:{
+      /* 测试方法开始 */
+
+      initialize() {
+        let self = this;
+        self.$set(self, 'videoType', false);
+        self.$set(self, 'videoList', []);
+        // type 1.楼栋 2.楼层 3.楼道 4.实验室
+        let obj = {
+          page:'1',
+          pageSize:'10',
+          buildId:'',
+          floorId:'',
+          passageway:'',
+          subIds:['101093843117597270'],
+          protocol:window.location.href.indexOf('https') !== -1?'wss':'ws',
+          streamType:1,
+          source:1,
+        };
+        iotCameraFindByCondition(obj).then(response => {
+          let list = [];
+          for(let i=0;i<response.data.records.length;i++){
+            list.push(
+                {
+                  width: this.width, //(宽度:非必传-默认600)
+                  height: this.height, //(高度:非必传-默认338)
+                  url: response.data.records[i].streamUrl,
+                  cameraIndexCode: response.data.records[i].deviceNo,
+                }
+            )
+          }
+          this.$set(this,'demoList',list)
+        });
+      },
+      /* 测试方法结束 */
+
+
       //指定视频
       async iotDeviceList(){
         let obj = {