video1.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=0.5">
  6. <title>云看板</title>
  7. <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
  8. <link href="/css/dashboard.css" rel="stylesheet" />
  9. <script type="text/javascript" src="/js/service.js"></script>
  10. <script type="text/javascript" src="/js/session.js"></script>
  11. <script type="text/javascript" src="/js/getService.js"></script>
  12. <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
  13. <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
  14. </head>
  15. <body id="container" class="container-fluid">
  16. <style>
  17. body{
  18. overflow-y: hidden;
  19. overflow-x: hidden;
  20. }
  21. </style>
  22. <!-- <div class="row no-padding head-bar" style="height:81px"> -->
  23. <!-- <div class="col-lg-1 col-md-1">
  24. </div>
  25. <div class="col-lg-4 col-md-4 page-title">
  26. 云看板
  27. </div> -->
  28. <!-- <div class="col-lg-3 col-md-3 block-padding">
  29. <button type="button" class="btn btn-warning"
  30. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  31. <button type="button" class="btn btn-warning"
  32. onclick="window.location.replace('/pages/dashboard/produce.html');">制造看板</button>
  33. <button type="button" class="btn btn-warning"
  34. onclick="window.location.replace('/pages/dashboard/line.html');">产线看板</button>
  35. <button type="button" class="btn btn-warning"
  36. onclick="window.location.replace('/pages/dashboard/quality.html');">品质看板</button>
  37. </div> -->
  38. <!-- <div class="col-lg-4 col-md-4">
  39. </div>-->
  40. <!-- </div> -->
  41. <div class="my-container" id="div-main">
  42. <div id="two">
  43. <div style="width: 49%;height: 100%;float:left;margin-left: -20px;margin-right: 10px;">
  44. <video id="twoVideo" class="videoType" :src="'/upVedio/ABB/'+firstFile" controls width="100%" height="100%" > </video>
  45. <img id="twoImg" class="imgType" :src="'/upVedio/ABB/'+firstFile" width="100%" />
  46. </div>
  47. <div style="width: 50%;height: 100%;float:left;" v-for="task in taskList">
  48. <video id="twoVideo2" v-if="!task.isImg" class="videoType" :src="'/upVedio/ABB/'+task.fileName" controls width="100%" height="100%" > </video>
  49. <img v-if="task.isImg" class="imgType" :src="'/upVedio/ABB/'+task.fileName" width="110%" />
  50. </div>
  51. </div>
  52. <div class="row" v-for="task in taskList" id="one">
  53. <video v-if="!task.isImg" id="oneVideo" class="videoType" :src="'/upVedio/AAA/'+task.fileName" controls width="100%" height="100%" > </video>
  54. <img v-if="task.isImg" class="imgType" :src="'/upVedio/AAA/'+task.fileName" width="100%" />
  55. </div>
  56. </div>
  57. <!-- jQuery -->
  58. <script src="/lib/jquery.min.js"></script>
  59. <script src="/lib/vue.min.js"></script>
  60. <script src="/lib/echarts/echarts.min.js"></script>
  61. <script src="/lib/echarts/theme/macarons.js"></script>
  62. <script src="/js/service/produce-task.js"></script>
  63. <script type="text/javascript">
  64. // $(".videoType").height($(window).height()-85);
  65. // $(".imgType").height($(window).height()-85);
  66. $(".videoType").height($(window).height());
  67. $(".imgType").height($(window).height());
  68. var vm = new Vue({
  69. el: '#div-main',
  70. data: {
  71. taskList: [],
  72. cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
  73. imer_long: '', // 定时取服务器数据
  74. timer_short: '', // 数据超长定时轮播
  75. upVideo:'',
  76. firstFile:''
  77. },
  78. methods: {
  79. // 从服务器加载数据并显示
  80. refreshData: function () {
  81. // 关闭定时器
  82. // clearInterval(this.timer_short);
  83. this.loadData();
  84. // 开启定时器
  85. this.timer_short = setTimeout(this.scrollData, 3000);
  86. }, // 轮播数据
  87. scrollData: function () {
  88. for (var key in this.cacheDataObject) {
  89. const dataList = this.cacheDataObject[key].data;
  90. const pagesize = this.cacheDataObject[key].pagesize;
  91. var pageindex = this.cacheDataObject[key].pageindex + 1;
  92. if (dataList.length > pagesize) {
  93. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  94. pagesize > 0 ? 1 : 0);
  95. if (pageindex >= pagesum)
  96. pageindex = 0;
  97. this.cacheDataObject[key].pageindex = pageindex;
  98. const startIndex = pageindex * pagesize;
  99. const remainSum = dataList.length - startIndex;
  100. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  101. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  102. if(keyPar.length < 1){
  103. continue;
  104. }
  105. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  106. }
  107. }
  108. }, // 从服务器加载数据
  109. loadData: function () {
  110. this.cacheDataObject = {};
  111. const taskList = ServiceProduceTask.getVedioFileList();
  112. this.upVideo = taskList[0].upVideo;
  113. if(this.upVideo == 'AAA'){
  114. $("#two").hide();
  115. }else{
  116. $("#one").hide();
  117. }
  118. this.firstFile = taskList[0].fileName;
  119. if(taskList[0].isImg){
  120. $("#twoVideo").hide();
  121. }else{
  122. $("#twoImg").hide();
  123. }
  124. taskList.splice(0, 1);
  125. this.cacheDataObject.taskList = {
  126. data: taskList,
  127. pagesize: 1,
  128. pageindex: 0
  129. }
  130. this.taskList = taskList.slice(0, this.cacheDataObject.taskList.pagesize);
  131. getVideo();
  132. }
  133. },
  134. mounted() {
  135. this.timer_long = setInterval(this.refreshData, 10000);
  136. this.refreshData();
  137. },
  138. beforeDestroy() {
  139. clearInterval(this.timer_long);
  140. // clearInterval(this.timer_short);
  141. }
  142. })
  143. // $(function () {
  144. // if(taskList != null){
  145. // var file = taskList[0].fileType;
  146. // if (file=='jpg' || file=='jpeg' || file=='png'){
  147. // $("#videoType").hide();
  148. // $("#imgType").attr('src',"/upVedio/"+taskList[0].fileName);
  149. // }else{
  150. // $("#imgType").hide();
  151. // $("#videoType").attr('src',"/upVedio/"+taskList[0].fileName);
  152. // setInterval(function () { getVideo(); }, 3000);
  153. // }
  154. // }
  155. // })
  156. function getVideo(){
  157. var _video1 = $('#twoVideo')[0];
  158. var _video2 = $('#twoVideo2')[0];
  159. var _video3 = $('#oneVideo')[0];
  160. if($('#twoVideo').is(':hidden') && _video1.paused){
  161. }else{
  162. _video1.play();
  163. }
  164. if($('#twoVideo2').is(':hidden') && _video2.paused){
  165. }else{
  166. _video1.play();
  167. }
  168. if($('#oneVideo').is(':hidden') && _video3.paused){
  169. }else{
  170. _video1.play();
  171. }
  172. // if(_video3.paused){
  173. // _video3.play();
  174. // //_video.pause();//暂停
  175. // }
  176. }
  177. </script>
  178. </body>
  179. </html>