瀏覽代碼

监控添加判断条件

半生瓜 1 年之前
父節點
當前提交
506921ccf2
共有 3 個文件被更改,包括 21 次插入16 次删除
  1. 5 3
      public/config.js
  2. 8 13
      src/components/right.vue
  3. 8 0
      src/request/http.js

+ 5 - 3
public/config.js

@@ -1,14 +1,16 @@
1
 /*
1
 /*
2
  * @Author: zy1125 1515706227@qq.com
2
  * @Author: zy1125 1515706227@qq.com
3
  * @Date: 2023-11-08 20:40:07
3
  * @Date: 2023-11-08 20:40:07
4
- * @LastEditors: zy1125 1515706227@qq.com
5
- * @LastEditTime: 2023-12-20 17:22:21
4
+ * @LastEditors: 半生瓜 1515706227@qq.com
5
+ * @LastEditTime: 2024-01-15 11:11:02
6
  * @FilePath: \v3_yyz\public\config.js
6
  * @FilePath: \v3_yyz\public\config.js
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
  */
8
  */
9
 window.g = {
9
 window.g = {
10
     // 获取数据请求地址
10
     // 获取数据请求地址
11
-    BASE_API: "https://test.lqkj.top//cmioc3-server",
11
+    BASE_API: "https://weizhi.huanghuai.edu.cn/yyzioc-server/",
12
+    
13
+
12
     // BASE_API: "http://192.168.4.219:12397/ioc-server",
14
     // BASE_API: "http://192.168.4.219:12397/ioc-server",
13
     // UE_IP: "http://192.168.4.159"
15
     // UE_IP: "http://192.168.4.159"
14
     UE_IP: "http://127.0.0.1:80"
16
     UE_IP: "http://127.0.0.1:80"

+ 8 - 13
src/components/right.vue

@@ -252,7 +252,6 @@ export default ({
252
             // })
252
             // })
253
 
253
 
254
             let res = await getDevice()
254
             let res = await getDevice()
255
-            console.log('s12312123', res);
256
             if (res.code !== 200) {
255
             if (res.code !== 200) {
257
                 ElMessage.error("数据请求出错");
256
                 ElMessage.error("数据请求出错");
258
             }
257
             }
@@ -268,32 +267,28 @@ export default ({
268
 
267
 
269
             monitor.map((res) => {
268
             monitor.map((res) => {
270
                 console.log('sadhi2', res.activeMonitor);
269
                 console.log('sadhi2', res.activeMonitor);
271
-
272
-                res.activeMonitor.array.map(array => {
273
-
270
+                if(res.activeMonitor.array){
271
+                    res.activeMonitor.array.map(array => {
274
                     //视频转码
272
                     //视频转码
275
                     getvideo({
273
                     getvideo({
276
                         "rtsp": array.src,
274
                         "rtsp": array.src,
277
                     }).then((res) => {
275
                     }).then((res) => {
278
-                        console.log('sadnuq21', res.data);
279
-                        console.log('sadnuq2121', res.data.httpFlv);
280
                         // array.src = 'http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
276
                         // array.src = 'http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
281
-                           array.src=res.data.httpFlv
277
+                        array.src=res.data.httpFlv
282
                     })
278
                     })
283
-
284
-
285
-                })
286
-                res.activeMonitor.array1.map(array1 => {
287
-                    console.log('asdui1231', array1);
279
+                    })
280
+                }
281
+                if ( res.activeMonitor.array1) {
282
+                    res.activeMonitor.array1.map(array1 => {
288
                     //视频转码
283
                     //视频转码
289
                     getvideo({
284
                     getvideo({
290
                         "rtsp": array1.src,
285
                         "rtsp": array1.src,
291
                     }).then((res) => {
286
                     }).then((res) => {
292
-                        console.log('sadnuq212123s2', res.data);
293
                         // array1.src = 'http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
287
                         // array1.src = 'http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
294
                            array1.src=res.data.httpFlv
288
                            array1.src=res.data.httpFlv
295
                     })
289
                     })
296
                 })
290
                 })
291
+                }
297
 
292
 
298
 
293
 
299
             })
294
             })

+ 8 - 0
src/request/http.js

@@ -1,3 +1,11 @@
1
+/*
2
+ * @Author: 半生瓜 1515706227@qq.com
3
+ * @Date: 2023-10-18 10:46:30
4
+ * @LastEditors: 半生瓜 1515706227@qq.com
5
+ * @LastEditTime: 2024-01-09 09:12:35
6
+ * @FilePath: \v3_yyz\src\request\http.js
7
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
+ */
1
 import axios from 'axios'
9
 import axios from 'axios'
2
 import { ElMessage } from 'element-plus';
10
 import { ElMessage } from 'element-plus';
3
 
11