video1.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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" style="background-color: aliceblue;">
  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" style="height: 100%;width: 100%;">
  42. <div id="two" style="height: 100%;width: 100%;">
  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.isVideo" 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. <iframe v-if="task.isPdf" class="pdfType" width="100%" border="0" frameborder="0" v-bind:src="'/lib/pdfjs/web/viewer.html?file=/upVedio/ABB/'+task.fileName" style="background-color:#ffffff"></iframe>
  47. </div>
  48. <div style="width: 49%;height: 100%;float:left;">
  49. <video autoplay="true" loop="true" muted="muted" id="twoVideo" class="videoType" :src="'/upVedio/ABB/'+firstFile" controls width="106%" height="100%" > </video>
  50. <img id="twoImg" class="imgType" :src="'/upVedio/ABB/'+firstFile" width="100%" />
  51. <iframe class="pdfType" id="twoPdf" width="100%" border="0" frameborder="0" v-bind:src="'/lib/pdfjs/web/viewer.html?file=/upVedio/ABB/'+firstFile" style="background-color:#ffffff"></iframe>
  52. </div>
  53. </div>
  54. <div class="row" v-for="task in taskList" id="one" style="margin-left: -25px">
  55. <video v-if="task.isVideo" autoplay="true" loop="true" muted="muted" id="oneVideo" class="videoType" :src="'/upVedio/AAA/'+task.fileName" controls width="100%" height="100%" > </video>
  56. <img v-if="task.isImg" class="imgType" :src="'/upVedio/AAA/'+task.fileName" width="101%" />
  57. <iframe v-if="task.isPdf" class="pdfType" width="100%" border="0" frameborder="0" v-bind:src="'/lib/pdfjs/web/viewer.html?file=/upVedio/AAA/'+task.fileName" style="background-color:#ffffff"></iframe>
  58. </div>
  59. <div id="three" style="max-height: 100%;">
  60. <div style="height: 50%;">
  61. <div class="threeImg" style="width: 50%;float:left;text-align: center;" v-for="task in taskA">
  62. <video v-if="task.isVideo" autoplay="true" loop="true" muted="muted" :src="'/upVedio/CCC/A/'+task.fileName" controls width="100%" height="100%" > </video>
  63. <img v-if="task.isImg" :src="'/upVedio/CCC/A/'+task.fileName" style="max-height: 100%;
  64. max-width: 100%;" />
  65. </div>
  66. <div class="threeImg" style="width: 50%;float:left;text-align: center;" v-for="task in taskB">
  67. <video v-if="task.isVideo" autoplay="true" loop="true" muted="muted" :src="'/upVedio/CCC/B/'+task.fileName" controls width="100%" height="100%" > </video>
  68. <img v-if="task.isImg" :src="'/upVedio/CCC/B/'+task.fileName" style="max-height: 100%;
  69. max-width: 100%;" />
  70. </div>
  71. </div>
  72. <div style="height: 50%;">
  73. <div class="threeImg" style="width: 50%;float:left;text-align: center;" v-for="task in taskC">
  74. <video v-if="task.isVideo" autoplay="true" loop="true" muted="muted" :src="'/upVedio/CCC/C/'+task.fileName" controls width="100%" height="100%" > </video>
  75. <img v-if="task.isImg" :src="'/upVedio/CCC/C/'+task.fileName" style="max-height: 100%;
  76. max-width: 100%;" />
  77. </div>
  78. <div class="threeImg" style="width: 50%;float:left;text-align: center;" v-for="task in taskD">
  79. <video v-if="task.isVideo" autoplay="true" loop="true" muted="muted" :src="'/upVedio/CCC/D/'+task.fileName" controls width="100%" height="100%" > </video>
  80. <img v-if="task.isImg" :src="'/upVedio/CCC/D/'+task.fileName" style="max-height: 100%;
  81. max-width: 100%;"/>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <!-- jQuery -->
  87. <script src="/lib/jquery.min.js"></script>
  88. <script src="/lib/vue.min.js"></script>
  89. <script src="/lib/echarts/echarts.min.js"></script>
  90. <script src="/lib/echarts/theme/macarons.js"></script>
  91. <script src="/js/service/produce-task.js"></script>
  92. <script type="text/javascript">
  93. // setTimeout(ServiceProduceTask.getVedioFileList(),500)
  94. // $(".videoType").height($(window).height()-85);
  95. // $(".imgType").height($(window).height()-85);
  96. $(".videoType").height($(window).height());
  97. $(".imgType").height($(window).height());
  98. $(".pdfType").height($(window).height());
  99. $(".threeImg").height($(window).height()/2);
  100. var vm = new Vue({
  101. el: '#div-main',
  102. data: {
  103. listInit: ServiceProduceTask.getVedioFileList(),
  104. taskList: [],
  105. timer: '',
  106. pageSize: 1,
  107. pageIndex: 0,
  108. timer: '',
  109. upVideo:'',
  110. firstFile:'',
  111. taskA:[],
  112. taskB:[],
  113. taskC:[],
  114. taskD:[],
  115. page:{
  116. pageSizeA: 1,
  117. pageIndexA: 0,
  118. pageSizeB: 1,
  119. pageIndexB: 0,
  120. pageSizeC: 1,
  121. pageIndexC: 0,
  122. pageSizeD: 1,
  123. pageIndexD: 0
  124. }
  125. },
  126. methods: {
  127. get() {
  128. this.upVideo = this.listInit[0].upVideo;
  129. this.firstFile = this.listInit[0].fileName;
  130. if(this.upVideo != 'CCC'){
  131. if(this.listInit[0].isImg){
  132. $("#twoVideo").hide();
  133. $("#twoPdf").hide();
  134. }else if(this.listInit[0].isVideo){
  135. $("#twoImg").hide();
  136. $("#twoPdf").hide();
  137. }else{
  138. $("#twoVideo").hide();
  139. $("#twoImg").hide();
  140. }
  141. }else{
  142. $("#twoVideo").hide();
  143. $("#twoPdf").hide();
  144. $("#twoImg").hide();
  145. }
  146. if(this.upVideo == 'AAA'){
  147. $("#two").hide();
  148. $("#three").hide();
  149. }else if(this.upVideo=='ABB'){
  150. $("#one").hide();
  151. $("#three").hide();
  152. // $("#one").contents().hide();
  153. // console.log($("#one").contents())
  154. // this.listInit.splice(0, 1);
  155. }else{
  156. $("#one").hide();
  157. $("#two").hide();
  158. }
  159. },
  160. get2(){
  161. this.listInit=ServiceProduceTask.getVedioFileList();
  162. console.log(this.upVideo)
  163. if(this.upVideo!='CCC'){
  164. if(this.upVideo != 'AAA'){
  165. this.listInit.splice(0, 1);
  166. }
  167. this.taskList = this.listInit.slice(this.pageIndex,this.pageSize);
  168. if(this.pageSize >= this.listInit.length){
  169. this.pageIndex = 0;
  170. this.pageSize = 1;
  171. }else{
  172. this.pageIndex = this.pageIndex + 1;
  173. this.pageSize = this.pageSize + 1;
  174. }
  175. }else{
  176. this.taskA=this.listInit[0].CCCA.slice(this.page.pageIndexA,this.page.pageSizeA);
  177. if(this.page.pageSizeA >= this.listInit[0].CCCA.length){
  178. this.page.pageIndexA = 0;
  179. this.page.pageSizeA = 1;
  180. }else{
  181. this.page.pageIndexA = this.page.pageIndexA + 1;
  182. this.page.pageSizeA = this.page.pageSizeA + 1;
  183. }
  184. this.taskB=this.listInit[0].CCCB.slice(this.page.pageIndexB,this.page.pageSizeB);
  185. if(this.page.pageSizeB >= this.listInit[0].CCCB.length){
  186. this.page.pageIndexB = 0;
  187. this.page.pageSizeB = 1;
  188. }else{
  189. this.page.pageIndexB = this.page.pageIndexB + 1;
  190. this.page.pageSizeB = this.page.pageSizeB + 1;
  191. }
  192. this.taskC=this.listInit[0].CCCC.slice(this.page.pageIndexC,this.page.pageSizeC);
  193. if(this.page.pageSizeC >= this.listInit[0].CCCC.length){
  194. this.page.pageIndexC = 0;
  195. this.page.pageSizeC = 1;
  196. }else{
  197. this.page.pageIndexC = this.page.pageIndexC + 1;
  198. this.page.pageSizeC = this.page.pageSizeC + 1;
  199. }
  200. this.taskD=this.listInit[0].CCCD.slice(this.page.pageIndexD,this.page.pageSizeD);
  201. if(this.page.pageSizeD >= this.listInit[0].CCCD.length){
  202. this.page.pageIndexD = 0;
  203. this.page.pageSizeD = 1;
  204. }else{
  205. this.page.pageIndexD = this.page.pageIndexD + 1;
  206. this.page.pageSizeD = this.page.pageSizeD + 1;
  207. }
  208. }
  209. // this.getVideo();
  210. },
  211. getVideo(){
  212. var _video1 = $('#twoVideo')[0];
  213. var _video2 = $('#twoVideo2')[0];
  214. var _video3 = $('#oneVideo')[0];
  215. if($('#twoVideo').is(':hidden') && _video1.paused){
  216. }else{
  217. _video1.play();
  218. }
  219. if($('#twoVideo2').is(':hidden') && _video2.paused){
  220. }else{
  221. _video1.play();
  222. }
  223. if($('#oneVideo').is(':hidden') && _video3.paused){
  224. }else{
  225. _video1.play();
  226. }
  227. }
  228. },
  229. mounted() {
  230. this.get();
  231. this.get2();
  232. this.timer = setInterval(this.get2, 25000);
  233. },
  234. beforeDestroy() {
  235. clearInterval(this.timer);
  236. }
  237. })
  238. // function getVideo(){
  239. // var _video1 = $('#twoVideo')[0];
  240. // var _video2 = $('#twoVideo2')[0];
  241. // var _video3 = $('#oneVideo')[0];
  242. // if($('#twoVideo').is(':hidden') && _video1.paused){
  243. // }else{
  244. // _video1.play();
  245. // }
  246. // if($('#twoVideo2').is(':hidden') && _video2.paused){
  247. // }else{
  248. // _video1.play();
  249. // }
  250. // if($('#oneVideo').is(':hidden') && _video3.paused){
  251. // }else{
  252. // _video1.play();
  253. // }
  254. // if(_video3.paused){
  255. // _video3.play();
  256. // //_video.pause();//暂停
  257. // }
  258. // }
  259. </script>
  260. </body>
  261. </html>