ltao 3 سال پیش
والد
کامیت
a1ae198cc5
1فایلهای تغییر یافته به همراه21 افزوده شده و 5 حذف شده
  1. 21 5
      src/views/monitoring/camera/index.vue

+ 21 - 5
src/views/monitoring/camera/index.vue

@@ -230,7 +230,12 @@
       </el-col>
       <el-col :span="1.5" class="isSubmit">
         <!-- <el-radio-group v-model="queryParams.type" @change="caoZuoTypefun"> -->
-        <button @click="one" id="onevideos" class="single" :class="this.btn == 0 ? 'bg' : ''">
+        <button
+          @click="one"
+          id="onevideos"
+          class="single"
+          :class="this.btn == 0 ? 'bg' : ''"
+        >
           单屏
         </button>
         <!-- <button
@@ -667,12 +672,23 @@ export default {
         this.destoryVideo(this.flvPlayerList1[0]);
         this.flvPlayerList1.shift();
       }
-      for (var i = 0; i < this.fourvideo; i++) {
-        this.url1 = this.cameraList[i].caddr;
-        // 报错原因是这个地址没有视频
-        console.log(this.url1);
+      console.log(this.cameraList)
+      if(this.cameraList.length<this.fourvideo){
+        for (var i = 0; i < this.cameraList.length; i++) {
+          this.url1 = this.cameraList[i].caddr;
+          // 报错原因是这个地址没有视频
+          // console.log(this.url1);
         this.singleplayvideo("flvPlayer" + i, this.url1, i);
       }
+      }else{
+         for (var i = 0; i < this.fourvideo; i++) {
+          this.url1 = this.cameraList[i].caddr;
+          // 报错原因是这个地址没有视频
+          // console.log(this.url1);
+        this.singleplayvideo("flvPlayer" + i, this.url1, i);
+      }
+      }
+      
     },
     /** 查询安防监控列表 */
     getList(a) {