video.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title></title>
  6. <!--引用jquery-->
  7. <script type="text/javascript" src="/js/service.js"></script>
  8. <script type="text/javascript" src="/js/session.js"></script>
  9. <script type="text/javascript" src="/js/getService.js"></script>
  10. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  11. <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
  12. <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
  13. <script type="text/javascript" src="/lib/layer.js"></script>
  14. <script type="text/javascript">
  15. var srcwidth = 900; //整个面板的宽
  16. var currRow = 0; //当前操作的行
  17. document.onkeydown = function (e) { // 回车提交表单
  18. // 兼容FF和IE和Opera
  19. var theEvent = window.event || e;
  20. var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
  21. if (code == 13) {
  22. if($('#frameMain1').is(':hidden')){
  23. if (confirm("确定要保存此页面吗?")) {
  24. // var test=document.getElementsByTagName('html')[0].outerHTML;
  25. // var encodeHtml = HtmlUtil.htmlEncode(test);
  26. var encodeHtml = $("#megshow").html();
  27. encodeHtml = escape(encodeURIComponent(encodeHtml))
  28. var map = '{"account":"' + encodeHtml + '"}';
  29. return getService.methodInsert("/fbsViewAll/fbsViewAll/add",map,aaaa);
  30. }
  31. }else{
  32. if (confirm("确定要删除此页面吗?")) {
  33. const par = getService.methodPost("/fbsViewAll/fbsViewAll/delete");
  34. if(par.success){
  35. window.location.reload()
  36. }
  37. }
  38. }
  39. }
  40. }
  41. function aaaa(data){
  42. // const hm = getService.methodGet("/fbsViewAll/fbsViewAll/list");
  43. // var decodeHtml = HtmlUtil.htmlDecode(hm.allFile);
  44. // window.location.replace('/pages/dashboard/test3.html?pkName=111')
  45. // window.location.replace('/pages/dashboard/test3.html?pkName=111')
  46. // const hm = getService.methodGet("/fbsViewAll/fbsViewAll/list");
  47. // var decodeHtml = HtmlUtil.htmlDecode(hm.allFile);
  48. // var test=document.getElementsByTagName('html')[0].outerHTML;
  49. // // alert(decodeHtml);
  50. // var win;
  51. // win = window.open('/pages/dashboard/test3.html','','scroll:1;status:0;help:0;resizable:1;dialogWidth:800px;dialogHeight:600px');
  52. // win.document.write(test);
  53. }
  54. var HtmlUtil = {
  55. /*1.用浏览器内部转换器实现html转码*/
  56. htmlEncode:function (html){
  57. //1.首先动态创建一个容器标签元素,如DIV
  58. var temp = document.createElement ("div");
  59. //2.然后将要转换的字符串设置为这个元素的innerText(ie支持)或者textContent(火狐,google支持)
  60. (temp.textContent != undefined ) ? (temp.textContent = html) : (temp.innerText = html);
  61. //3.最后返回这个元素的innerHTML,即得到经过HTML编码转换的字符串了
  62. var output = temp.innerHTML;
  63. temp = null;
  64. return output;
  65. },
  66. /*2.用浏览器内部转换器实现html解码*/
  67. htmlDecode:function (text){
  68. //1.首先动态创建一个容器标签元素,如DIV
  69. var temp = document.createElement("div");
  70. //2.然后将要转换的字符串设置为这个元素的innerHTML(ie,火狐,google都支持)
  71. temp.innerHTML = text;
  72. //3.最后返回这个元素的innerText(ie支持)或者textContent(火狐,google支持),即得到经过HTML解码的字符串了。
  73. var output = temp.innerText || temp.textContent;
  74. temp = null;
  75. return output;
  76. }
  77. };
  78. $(function () {
  79. const hm = getService.methodGet("/fbsViewAll/fbsViewAll/list");
  80. if(hm == null){
  81. $("#frameMain1").hide();
  82. }else{
  83. $("#frameMain1").height($(window).height()-110);
  84. $("#megshow").hide();
  85. }
  86. $('#ggkb').bind("click",function(){
  87. if($('#frameMain1').is(':hidden')){
  88. if (confirm("确定要保存此页面吗?")) {
  89. // var test=document.getElementsByTagName('html')[0].outerHTML;
  90. // var encodeHtml = HtmlUtil.htmlEncode(test);
  91. var encodeHtml = $("#megshow").html();
  92. encodeHtml = escape(encodeURIComponent(encodeHtml))
  93. var map = '{"account":"' + encodeHtml + '"}';
  94. return getService.methodInsert("/fbsViewAll/fbsViewAll/add",map,aaaa);
  95. }
  96. }else{
  97. if (confirm("确定要删除此页面吗?")) {
  98. const par = getService.methodPost("/fbsViewAll/fbsViewAll/delete");
  99. if(par.success){
  100. window.location.reload()
  101. }
  102. }
  103. }
  104. });
  105. srcwidth = $(window).width();
  106. const nameAll = document.getElementsByName('testFileName');
  107. //绑定需要拖拽改变大小的元素对象 每行的第一列 暂时支持一行两列
  108. $.each(nameAll, function (i, n) {
  109. bindResize(n);
  110. })
  111. // bindResize(nameAll[0]);
  112. // bindResize(document.getElementById('p10'));
  113. // bindResize(document.getElementById('p20'));
  114. });
  115. function bindResize(el) {
  116. var els = el.style,
  117. x = y = 0;
  118. $(el).mousedown(function (e) {
  119. currRow = el.id;
  120. x = e.clientX - el.offsetWidth,
  121. y = e.clientY - el.offsetHeight;
  122. el.setCapture ? (
  123. el.setCapture(),
  124. el.onmousemove = function (ev) {
  125. mouseMove(ev || event);
  126. },
  127. el.onmouseup = mouseUp
  128. ) : (
  129. $(document).bind("mousemove", mouseMove).bind("mouseup", mouseUp)
  130. );
  131. e.preventDefault();
  132. });
  133. //移动事件
  134. function mouseMove(e) {
  135. els.width = e.clientX - x + 'px',
  136. els.height = e.clientY - y + 'px';
  137. var cx = currRow.substr(1, 1); //当前行
  138. var cy = currRow.substr(2, 1); //当前列
  139. var docCur = $("#p" + cx + cy); //current row colum
  140. docCur.css({ "width": ((parseInt(docCur.css("width").replace("px", ""))) > srcwidth ? srcwidth : (parseInt(docCur.css("width")))) });
  141. var docCurCopy = docCur;
  142. var cya = parseInt(cy) + 1; //当前列+1
  143. var docNCol = $("#p" + cx + cya); //next colum
  144. if (docNCol != null) {
  145. docNCol.css({ "left": (parseInt(docCur.css("left").replace("px", ""))) + (parseInt(docCur.css("width").replace("px", ""))) });
  146. docNCol.css({ "width": (srcwidth - (parseInt(docCur.css("width").replace("px", "")))) });
  147. docNCol.css({ "top": (docCur.css("top")) });
  148. docNCol.css({ "height": docCur.css("height") });
  149. }
  150. for (var i = 1; i < 4; i++) {
  151. var cxa = parseInt(cx) + i; //当前行+1
  152. var docNRow = $("#p" + cxa + cy); //next row
  153. if (docNRow != null) {
  154. docNRow.css({ "left": (parseInt(docCurCopy.css("left").replace("px", ""))) });
  155. docNRow.css({ "top": (parseInt(docCurCopy.css("top").replace("px", ""))) + (parseInt(docCurCopy.css("height").replace("px", ""))) });
  156. var docNCol = $("#p" + cxa + 1); //next colum
  157. if (docNCol != null) {
  158. docNCol.css({ "left": (parseInt(docNRow.css("left").replace("px", ""))) + (parseInt(docNRow.css("width").replace("px", ""))) });
  159. docNCol.css({ "width": (srcwidth - (parseInt(docNRow.css("width").replace("px", "")))) });
  160. docNCol.css({ "top": (docNRow.css("top")) });
  161. docNCol.css({ "height": docNRow.css("height") });
  162. }
  163. }
  164. docCurCopy = docNRow;
  165. }
  166. $("#megshow").html("#p" + els.width + els.height);
  167. }
  168. //停止事件
  169. function mouseUp() {
  170. el.releaseCapture ? (
  171. el.releaseCapture(),
  172. el.onmousemove = el.onmouseup = null
  173. ) : (
  174. $(document).unbind("mousemove", mouseMove).unbind("mouseup", mouseUp)
  175. );
  176. }
  177. }
  178. </script>
  179. <style type="text/css">
  180. #p00 { top: 100px; left: 200px; background: #f1f1f1; margin-bottom: 3px;;float:left;
  181. text-align: center; line-height: 100px; border: 1px solid #CCC; cursor: se-resize; }
  182. #p10 { top: 400px; left: 100px; background: #f1f1f1; margin-bottom: 3px;float:left;
  183. text-align: center; line-height: 100px; border: 1px solid #CCC; cursor: se-resize; }
  184. #p20 { top: 400px; left: 100px; background: #f1f1f1; margin-bottom: 3px;float: left;;
  185. text-align: center; line-height: 100px; border: 1px solid #CCC; cursor: se-resize; }
  186. </style>
  187. </head>
  188. <body>
  189. <div class="row no-padding head-bar" style="height:81px">
  190. <div class="col-lg-1 col-md-1">
  191. </div>
  192. <div class="col-lg-4 col-md-4 page-title"><span id="ggkb">公告看板</span>
  193. </div>
  194. <div class="col-lg-4 col-md-4">
  195. </div>
  196. </div>
  197. <div id="frameMain1" style="width: 100%;height:100%;">
  198. <iframe id="frameMain" width="100%" height="100%" border="0" frameborder="0" v-bind:src="filepath" style="background-color:#ffffff"></iframe>
  199. </div>
  200. <div id="megshow" style="width: 100%;height:97%;">
  201. <div id="div-main" >
  202. <div class="col-lg-2 col-md-2 center no-padding" style="width:100%;height:100%;"></div>
  203. </div>
  204. <span v-for="task in taskList">
  205. <div id="p00" name="testFileName" v-if="task.isImg">
  206. <img id="imgType" :src="'/upVedio/'+task.fileName" width="100%" height="100%" />
  207. </div>
  208. <div id="p10" name="testFileName" v-if="!task.isImg">
  209. <video id="videoType" :src="'/upVedio/'+task.fileName" controls width="100%" height="100%" > </video>
  210. </div>
  211. </span>
  212. </div>
  213. <script src="/lib/echarts/echarts.min.js"></script>
  214. <script src="/lib/echarts/theme/macarons.js"></script>
  215. <script src="/lib/vue.min.js"></script>
  216. <script src="/js/service/produce-task.js"></script>
  217. <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
  218. <link href="/css/dashboard.css" rel="stylesheet" />
  219. <script type="text/javascript">
  220. const taskList = ServiceProduceTask.getVedioFileList();
  221. var vm = new Vue({
  222. el: '#megshow',
  223. data: {
  224. taskList: taskList,
  225. num:'00000'
  226. }
  227. })
  228. var vm2 = new Vue({
  229. el: '#frameMain1',
  230. data: {
  231. filepath:"/pages/dashboard/videoFile.html"
  232. }
  233. })
  234. </script>
  235. </body>
  236. </html>