Kaynağa Gözat

生物安防

xsh 3 yıl önce
ebeveyn
işleme
4180401479

+ 9 - 0
src/utils/api.js

@@ -115,6 +115,15 @@ export function getVideo(data) {
   })
 }
 
+/** 拿到特定视频 **/
+export function getBaseVideo(data) {
+  return axios({
+    url: '/video/baseSpecificVideo/listSpecif',
+    method: 'get',
+    params: data
+  })
+}
+
 /** 车辆通行图标**/
 export function getCar(data) {
   return axios({

+ 29 - 4
src/views/BioSafety/BioSafety.vue

@@ -9,7 +9,7 @@
         </div>
         <div class="bio-video">
           <div class="kuang">
-            <iframe  :src="'static/jinm/index.html?'+'1'+','+ cameraOne +','+ cameraTwo + ',' +'100%' + ',' + '0'" style="width: 95%; height: 100%;" frameborder="0"  allowfullscreen="true"></iframe>
+            <iframe v-if="isVideo"  :src="'static/jinm/index.html?'+'1'+','+ cameraOne +','+ cameraTwo + ',' +'100%' + ',' + '0'" style="width: 95%; height: 100%;" frameborder="0"  allowfullscreen="true"></iframe>
           </div>
         </div>
         <div class="bio-out">
@@ -321,7 +321,19 @@
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
 import 'swiper/css/swiper.css'
 import ChartBar from "@/views/BioSafety/chart/ChartBar";
-import {getCar, getRecord, getSizhu, getCarList, getPersonList, getSizhuList, getHoure, getDoor, getCarWashVideo, getAlarmAndPig} from "@/utils/api";
+import {
+  getCar,
+  getRecord,
+  getSizhu,
+  getCarList,
+  getPersonList,
+  getSizhuList,
+  getHoure,
+  getDoor,
+  getCarWashVideo,
+  getAlarmAndPig,
+  getBaseVideo
+} from "@/utils/api";
 import axios from "axios";
 import {timeDate} from "@/utils";
 import { mapState } from "vuex";
@@ -410,8 +422,9 @@ export default {
         SevenDayGate: '0',
         tadayGate: '0',
       },
-      cameraOne: 'ws://36.26.62.70:9080/camera_relay?tcpaddr=admin%3Ahmkj6688%40172.16.3.180',
-      cameraTwo: 'rtsp://admin:hmkj6688@172.16.3.180/cam/realmonitor?channel=1&subtype=0',
+      cameraOne: '',
+      cameraTwo: '',
+      isVideo: false,
     }
   },
   computed: {
@@ -612,6 +625,18 @@ export default {
         }
       })
 
+
+      // 拿到特定视频
+      let params2 = {
+        type: 1,
+      }
+      getBaseVideo(params2).then(res => {
+        this.isVideo = true;
+        if(res.code === 10000) {
+          this.cameraOne = res.data[0].wsUrl;
+          this.cameraTwo = res.data[0].rtspUrl;
+        }
+      })
     },
     // 打开img
     open(item, num) {

+ 20 - 29
src/views/Environment/Environment.vue

@@ -34,7 +34,7 @@
     <div class="env-certain">
       <div class="env-certain-top">
         <div class="kuang">
-          <iframe  :src="'static/jinm/index.html?'+'1'+','+ cameraOne +','+ cameraTwo + ',' +'100%' + ',' + '0'" style="width: 100%; height: 100%;" frameborder="0"  allowfullscreen="true"></iframe>
+          <iframe v-if="isVideo"  :src="'static/jinm/index.html?'+'1'+','+ wsUrl +','+ rtspUrl + ',' +'100%' + ',' + '0'" style="width: 100%; height: 100%;" frameborder="0"  allowfullscreen="true"></iframe>
         </div>
       </div>
 
@@ -90,7 +90,7 @@
 <script>
 import ProBoard from '../Production/board/ProBoard.vue'
 import ChartDashboard from './charts/ChartDashboard.vue'
-import { getEnvList } from "@/utils/api";
+import { getEnvList, getBaseVideo } from "@/utils/api";
 
 export default {
   name: "Environment",
@@ -137,32 +137,12 @@ export default {
         unit: 'mg/L'
       },
       costLoading: true,
-      cameraOne: 'ws://36.26.62.70:9080/camera_relay?tcpaddr=admin%3Ahmkj6688%40172.16.3.201',
-      cameraTwo: 'rtsp://admin:hmkj6688@172.16.3.201/cam/realmonitor?channel=1&subtype=0',
-      list: [
-        {
-          id: 1,
-          cameraOne: 'ws://36.26.62.70:9080/camera_relay?tcpaddr=admin%3Ahmkj6688%40172.16.3.201',
-          cameraTwo: 'rtsp://admin:hmkj6688@172.16.3.201/cam/realmonitor?channel=1&subtype=0',
-        },
-        {
-          id: 2,
-          cameraOne: 'ws://36.26.62.70:9080/camera_relay?tcpaddr=admin%3Ahmkj6688%40172.16.3.198',
-          cameraTwo: 'rtsp://admin:hmkj6688@172.16.3.198/cam/realmonitor?channel=1&subtype=0',
-        },
-        {
-          id: 3,
-          cameraOne: 'ws://36.26.62.70:9080/camera_relay?tcpaddr=admin%3Ahmkj6688%40172.16.3.197',
-          cameraTwo: 'rtsp://admin:hmkj6688@172.16.3.197/cam/realmonitor?channel=1&subtype=0',
-        },
-        {
-          id: 4,
-          cameraOne: 'ws://36.26.62.70:9080/camera_relay?tcpaddr=admin%3Ahmkj6688%40172.16.3.203',
-          cameraTwo: 'rtsp://admin:hmkj6688@172.16.3.203/cam/realmonitor?channel=1&subtype=0',
-        },
-      ],
+      wsUrl: '',
+      rtspUrl: '',
+      list: [],
       timer: null,
-      num: 1
+      num: 1,
+      isVideo: false
     }
   },
   methods: {
@@ -176,6 +156,17 @@ export default {
         }
         this.costLoading = false;
       })
+      let params = {
+        type: 2
+      }
+      getBaseVideo(params).then(res => {
+        this.isVideo = true;
+        if(res.code === 10000) {
+          this.list = res.data;
+          this.wsUrl = res.data[0].wsUrl;
+          this.rtspUrl = res.data[0].rtspUrl;
+        }
+      })
     }
   },
   mounted() {
@@ -185,8 +176,8 @@ export default {
       if(that.num > 3) {
         that.num = 0;
       }
-      that.cameraOne = that.list[that.num].cameraOne;
-      that.cameraTwo = that.list[that.num].cameraTwo;
+      that.wsUrl = that.list[that.num].wsUrl;
+      that.rtspUrl = that.list[that.num].rtspUrl;
       that.num++;
     }, 60000)
   },