Procházet zdrojové kódy

添加视频回放列表

tremble před 4 roky
rodič
revize
0af3a662af
3 změnil soubory, kde provedl 73 přidání a 3 odebrání
  1. 32 1
      css/hardware.css
  2. 5 0
      index.html
  3. 36 2
      js/showHardware.js

+ 32 - 1
css/hardware.css

@@ -276,7 +276,7 @@
 }
 
 .m-con{
-  width: 800px;
+  width: 1100px;
   padding: 0;
 }
 
@@ -313,4 +313,35 @@
 .m-con .monitorbody .calendar{
   width: 50%!important;
   background: #fff;
+}
+
+.m-con .monitorbody .histcon{
+  color: #fff;
+  height: 100%;
+  align-self: flex-start;
+  padding: 10px 0;
+  min-width: 250px;
+  text-align: center;
+}
+
+.histcon > h3{
+  font-size: 18px;
+}
+
+.histcon > ul{
+  margin-top: 10px;
+  height: 100%;
+  max-height: 500px;
+  overflow-y: auto;
+  overflow-x: hidden;
+}
+
+.histcon > ul li{
+  line-height: 48px;
+  height: 48px;
+  cursor: pointer;
+}
+
+.histcon > ul li:hover{
+  background: #24D0B8;
 }

+ 5 - 0
index.html

@@ -143,6 +143,11 @@
                     <video id="monitor" controls></video>
                 </div>
                 <div id="calendar"></div>
+                <div class="histcon">
+                    <h3>当前日期历史视频时间片段</h3>
+                    <ul id="hislist">
+                    </ul>
+                </div>
             </div>
         </div>
     </div>

+ 36 - 2
js/showHardware.js

@@ -413,8 +413,25 @@ $(function () {
       return ret
   }
 
+  window.loadHistoryList = function (params={}) {
+    let {data=[],clickItem=()=>{}} =  params
+    let html = ''
+
+    for (let i = 0; i < data.length; i++) {
+      const element = data[i];
+      html += `<li data-val=${i}>${element.startTime.split(" ")[1]} ~ ${element.endTime.split(" ")[1]}</li>`
+    }
+
+    $('#hislist').html(html) 
+    $('#hislist').on('click','li',function(e){
+      let i = $(e.target).data('val')
+      clickItem(data[i])
+    })
+
+  }
+
   
-  /* let ret = window.loadCalendar({
+  let ret = window.loadCalendar({
     data:[{
         'startDate': "2021-05-18",//有监控的日期
         id:'传对应的id'
@@ -431,10 +448,27 @@ $(function () {
       console.log(nextMonth);
     } 
  
-  }) */
+  })
  
     
   
+  window.loadHistoryList({
+    data:[{
+      startTime:'2021-05-13 11:00:08',
+      endTime:'2021-05-13 11:00:08'
+    },{
+      startTime:'2021-05-13 11:00:0811',
+      endTime:'2021-05-13 11:00:08'
+    },{
+      startTime:'2021-05-13 11:00:082',
+      endTime:'2021-05-13 11:00:082'
+    }],
+    //点击时间
+    clickItem:(data)=>{
+      console.log(data);
+    }
+  })
+