video1.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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: 50%;height: 100%;float:left;margin-left: -25px;margin-right: 5px;" v-for="task in taskList">
  44. <video autoplay="true" loop="true" muted="muted" id="twoVideo2" v-if="!task.isImg" class="videoType" :src="'/upVedio/ABB/'+task.fileName" controls width="100%" height="100%" > </video>
  45. <img v-if="task.isImg" class="imgType" :src="'/upVedio/ABB/'+task.fileName" width="100%" />
  46. </div>
  47. <div style="width: 49%;height: 100%;float:left;">
  48. <video autoplay="true" loop="true" muted="muted" id="twoVideo" class="videoType" :src="'/upVedio/ABB/'+firstFile" controls width="106%" height="100%" > </video>
  49. <img id="twoImg" class="imgType" :src="'/upVedio/ABB/'+firstFile" width="100%" />
  50. </div>
  51. </div>
  52. <div class="row" v-for="task in taskList" id="one" style="margin-left: -25px">
  53. <video autoplay="true" loop="true" muted="muted" 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="101%" />
  55. </div>
  56. </div>
  57. <!-- <div class="my-container" id="div-main">
  58. <div id="two">
  59. <div style="width: 49%;height: 100%;float:left;margin-left: -20px;margin-right: 10px;">
  60. <video autoplay="true" loop="true" muted="muted" id="twoVideo" class="videoType" :src="'/upVedio/ABB/'+firstFile" controls width="100%" height="100%" > </video>
  61. <img id="twoImg" class="imgType" :src="'/upVedio/ABB/'+firstFile" width="100%" />
  62. </div>
  63. <div style="width: 50%;height: 100%;float:left;" v-for="task in taskList">
  64. <video autoplay="true" loop="true" muted="muted" id="twoVideo2" v-if="!task.isImg" class="videoType" :src="'/upVedio/ABB/'+task.fileName" controls width="100%" height="100%" > </video>
  65. <img v-if="task.isImg" class="imgType" :src="'/upVedio/ABB/'+task.fileName" width="106%" />
  66. </div>
  67. </div>
  68. <div class="row" v-for="task in taskList" id="one" style="margin-left: -25px">
  69. <video autoplay="true" loop="true" muted="muted" v-if="!task.isImg" id="oneVideo" class="videoType" :src="'/upVedio/AAA/'+task.fileName" controls width="100%" height="100%" > </video>
  70. <img v-if="task.isImg" class="imgType" :src="'/upVedio/AAA/'+task.fileName" width="101%" />
  71. </div>
  72. </div> -->
  73. <!-- jQuery -->
  74. <script src="/lib/jquery.min.js"></script>
  75. <script src="/lib/vue.min.js"></script>
  76. <script src="/lib/echarts/echarts.min.js"></script>
  77. <script src="/lib/echarts/theme/macarons.js"></script>
  78. <script src="/js/service/produce-task.js"></script>
  79. <script type="text/javascript">
  80. // setTimeout(ServiceProduceTask.getVedioFileList(),500)
  81. // $(".videoType").height($(window).height()-85);
  82. // $(".imgType").height($(window).height()-85);
  83. $(".videoType").height($(window).height());
  84. $(".imgType").height($(window).height());
  85. var vm = new Vue({
  86. el: '#div-main',
  87. data: {
  88. listInit: ServiceProduceTask.getVedioFileList(),
  89. taskList: [],
  90. timer: '',
  91. pageSize: 1,
  92. pageIndex: 0,
  93. timer: '',
  94. upVideo:'',
  95. firstFile:'',
  96. timer_long: '', // 定时取服务器数据
  97. },
  98. methods: {
  99. // 从服务器加载数据并显示
  100. refreshData: function () {
  101. // 刷新报表
  102. this.listInit=ServiceProduceTask.getVedioFileList();
  103. // alert(1)
  104. this.get();
  105. this.get2();
  106. // this.getVideo();
  107. console.log(ServiceProduceTask.getVedioFileList())
  108. },
  109. get() {
  110. this.upVideo = this.listInit[0].upVideo;
  111. this.firstFile = this.listInit[0].fileName;
  112. if(this.listInit[0].isImg){
  113. $("#twoVideo").hide();
  114. }else{
  115. $("#twoImg").hide();
  116. }
  117. if(this.upVideo == 'AAA'){
  118. $("#two").hide();
  119. }else{
  120. $("#one").hide();
  121. this.listInit.splice(0, 1);
  122. }
  123. },
  124. get2(){
  125. this.taskList = this.listInit.slice(this.pageIndex,this.pageSize);
  126. if(this.pageSize >= this.listInit.length){
  127. this.pageIndex = 0;
  128. this.pageSize = 1;
  129. }else{
  130. this.pageIndex = this.pageIndex + 1;
  131. this.pageSize = this.pageSize + 1;
  132. }
  133. // this.getVideo();
  134. },
  135. getVideo(){
  136. var _video1 = $('#twoVideo')[0];
  137. var _video2 = $('#twoVideo2')[0];
  138. var _video3 = $('#oneVideo')[0];
  139. if($('#twoVideo').is(':hidden') && _video1.paused){
  140. }else{
  141. _video1.play();
  142. }
  143. if($('#twoVideo2').is(':hidden') && _video2.paused){
  144. }else{
  145. _video1.play();
  146. }
  147. if($('#oneVideo').is(':hidden') && _video3.paused){
  148. }else{
  149. _video1.play();
  150. }
  151. }
  152. },
  153. mounted() {
  154. this.get();
  155. this.get2();
  156. this.timer = setInterval(this.get2, 7000);
  157. this.timer_long = setInterval(this.refreshData, 6000);
  158. this.refreshData();
  159. },
  160. beforeDestroy() {
  161. clearInterval(this.timer);
  162. clearInterval(this.timer_long);
  163. }
  164. })
  165. // function getVideo(){
  166. // var _video1 = $('#twoVideo')[0];
  167. // var _video2 = $('#twoVideo2')[0];
  168. // var _video3 = $('#oneVideo')[0];
  169. // if($('#twoVideo').is(':hidden') && _video1.paused){
  170. // }else{
  171. // _video1.play();
  172. // }
  173. // if($('#twoVideo2').is(':hidden') && _video2.paused){
  174. // }else{
  175. // _video1.play();
  176. // }
  177. // if($('#oneVideo').is(':hidden') && _video3.paused){
  178. // }else{
  179. // _video1.play();
  180. // }
  181. // if(_video3.paused){
  182. // _video3.play();
  183. // //_video.pause();//暂停
  184. // }
  185. // }
  186. </script>
  187. </body>
  188. </html>