Quellcode durchsuchen

Merge branch 'master' of http://192.168.0.115:3000/chenzhiguang/scene_wisdom

tremble vor 4 Jahren
Ursprung
Commit
a0892c18a1
2 geänderte Dateien mit 47 neuen und 48 gelöschten Zeilen
  1. 35 44
      js/main_2020_show.js
  2. 12 4
      js/showHardware.js

+ 35 - 44
js/main_2020_show.js

@@ -15802,7 +15802,7 @@ window.Modernizr = function(n, e, t) {
                                                 id: "monitor",
                                                 url: data2.data.external.hls //'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8'
                                             })
-                                        }
+                                        } 
                                     }
                                     , "获取视频地址失败")
                                     var calendar;
@@ -15848,60 +15848,51 @@ window.Modernizr = function(n, e, t) {
                                                                     }, 
                                                                     (data3)=>{
                                                                         console.log(data3) 
-                                                                        if(data3.code == 0){
-                                                                            
-                                                                            /* address: null
-                                                                            creationTime: null
-                                                                            deviceId: null
-                                                                            endTime: "2021-05-13 12:00:01"
-                                                                            filePath: null
-                                                                            fileSize: null
-                                                                            id: null
-                                                                            name: null
-                                                                            secrecy: null
-                                                                            startTime: "2021-05-13 11:00:08"
-                                                                            sumNum: null
-                                                                            type: null */
+                                                                        if(data3.code == 0){ 
                                                                             var timeList = data3.data;
                                                                             if(timeList){ 
-                                                                                /* channelId: "34020000001320010059"
-                                                                                endTime: "2021-05-13 13:00:01"
-                                                                                startTime: "2021-05-13 12:00:01" */
-                                                                                
-                                                                                getAjax(`/api/device/camera/playBack`, {
-                                                                                    "channelId": hardware.code,
-                                                                                    "endTime": "2021-05-13 13:00:01",
-                                                                                    "startTime": "2021-05-13 12:00:01"
-                                                                                },(data4)=>{
-                                                                                    if (data4.code == 0) {
-                                                                                        loadMonitor({
-                                                                                            id: "monitor",
-                                                                                            url: data4.result.external.hls //'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8'
-                                                                                        })
-                                                                                    }
+                                                                                window.loadHistoryList({ 
+                                                                                    data:timeList, 
+                                                                                    clickItem:(item)=>{//点击时间
+                                                                                        console.log(item);
+                                                                                        getAjax(`/api/device/camera/playBack`, {
+                                                                                            "channelId": hardware.code,
+                                                                                            "endTime": item.endTime,//"2021-05-13 13:00:01",
+                                                                                            "startTime": item.startTime,//"2021-05-13 12:00:01"
+                                                                                        },(data4)=>{
+                                                                                            if (data4.code == 0) {
+                                                                                                loadMonitor({
+                                                                                                    id: "monitor",
+                                                                                                    url: data4.data.external.hls //'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8'
+                                                                                                })
+                                                                                            }
                                                                                     
-                                                                                }, "获取视频地址失败")
+                                                                                        }, "获取视频回放地址失败", 'POST')
+                                                                                    }
+                                                                                }) 
+                                                                                
                                                                             }
-                                                                        }
-                                                                            
-                                                                            
-                                                                            
+                                                                        }     
                                                                     
                                                                     }, '获取视频日历day失败', 'POST'
                                                                 )
-                                                                
                                                                  
+                                                            }else{
+                                                                window.loadHistoryList()
+                                                                loadMonitor({id: "monitor", url:null })
                                                             }
                                                         }
                                                         ,
-                                                        monthCb: (item)=>{
-                                                            console.log(item); 
-                                                            console.log(calendar.options.currentDate)
-                                                            //getCalendar(item)
-                                                            
-
-                                                        }
-                                                      
+                                                        monthCb: (month)=>{
+                                                            console.log(month); 
+                                                            //console.log(calendar.options.currentDate)
+                                                            getCalendar(year, month) 
+                                                        },
+                                                        yearSelect: (yearText)=> {
+                                                            console.log(yearText);
+                                                            //console.log(calendar.options.currentDate)
+                                                            getCalendar(yearText, month) 
+                                                        },
                                                     })
                                             }
                                         }, "获取视频日历month失败", 'POST')

+ 12 - 4
js/showHardware.js

@@ -368,6 +368,12 @@ $(function () {
     let {id,url} = params 
     console.log(id,url);
     var video = document.getElementById(id);
+    if(!params.url){
+        video.src = '';  video.pause();
+        return;
+    }
+    
+    
       if (Hls.isSupported()) {
         var hls = new Hls();
         hls.loadSource(url||'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8');
@@ -417,6 +423,8 @@ $(function () {
     let {data=[],clickItem=()=>{}} =  params
     if (!data||data.length<=0) {
       return $('.histcon').hide()
+    }else{
+        $('.histcon').show()
     }
     let html = ''
 
@@ -435,7 +443,7 @@ $(function () {
   }
 
   
-  let ret = window.loadCalendar({
+  /* let ret = window.loadCalendar({
     data:[{
         'startDate': "2021-05-18",//有监控的日期
         id:'传对应的id'
@@ -452,11 +460,11 @@ $(function () {
       console.log(nextMonth);
     } 
  
-  })
+  }) */
  
     
   
-  window.loadHistoryList({
+ /*  window.loadHistoryList({
     data:[{
       startTime:'2021-05-13 11:00:08',
       endTime:'2021-05-13 11:00:08'
@@ -472,7 +480,7 @@ $(function () {
       console.log(data);
     }
   })
-  
+   */