暂无描述

seeDetail.html 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../../Script/Common/huayi.load.js"></script>
  6. <script src="../../Script/Common/huayi.config.js"></script>
  7. <link rel="stylesheet" href="../../css/init.css" />
  8. <link rel="stylesheet" href="../css/seeDetail.css" />
  9. <link href="//vjs.zencdn.net/7.3.0/video-js.min.css" rel="stylesheet">
  10. <title>知识库查询</title>
  11. </head>
  12. <body>
  13. <!--查看弹出内容-->
  14. <table class="table-bordered table">
  15. <tbody>
  16. <tr>
  17. <th>标题:</th>
  18. <td colspan="3" class="addTitle explancon"></td>
  19. </tr>
  20. <tr>
  21. <th>关键字:</th>
  22. <td colspan="3" class="addKey explancon"></td>
  23. </tr>
  24. <tr>
  25. <th>内容:</th>
  26. <td colspan="3" class="addCon explancon"></td>
  27. </tr>
  28. <tr>
  29. <th>附件:</th>
  30. <td colspan="3">
  31. <ul id="fileList" class="clearfix">
  32. </ul>
  33. </td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </body>
  38. <script src="../../js/download/download.js"></script>
  39. <script src="../../js/mousewheel/jquery.mousewheel.js"></script>
  40. <script src="../../js/WorkOrder/jquery.drag.js"></script>
  41. <script>
  42. var token = $.cookie("token");
  43. var changeGetid = helper.request.queryString("changeGetid");
  44. var otext = helper.request.queryString("otext");
  45. $(function() {
  46. if (changeGetid) {
  47. getChangeBox();
  48. }
  49. });
  50. function getChangeBox() {
  51. $.ajax({
  52. type: "post",
  53. url: huayi.config.callcenter_url + "Knowledge/GetInfo",
  54. async: false,
  55. dataType: 'json',
  56. data: {
  57. infoid: changeGetid,
  58. token: token
  59. },
  60. success: function(data) {
  61. var con = data.data;
  62. if (con) {
  63. debugger
  64. $('.addTitle').html(con.F_Title);
  65. $('.addKey').html(con.F_KeyWords);
  66. $('.addCon').html(helper.filter.content(con.F_Content));
  67. var proimglist = con.FileUrls;
  68. if (proimglist && proimglist.length > 0) {
  69. $(proimglist).each(function(i, n) {
  70. var fileType = n.F_FileType.split("\/")[0];
  71. if (fileType === 'image') {
  72. $('<div class="img-box">' +
  73. '<span class="img_mask"><span onclick=downloadFile("'+ n.F_FileUrl + '","' + n.F_FileName + '","' + n.F_FileType +
  74. '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
  75. '<img layer-src="' + n.F_FileUrl + '" src="' + n.F_FileUrl + '" alt="' + n.F_FileName +
  76. '" class="image-item" /><div>').appendTo("#fileList");
  77. }else if(fileType === 'video'){
  78. $('<div class="img-box">' +
  79. '<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' + n.F_FileUrl + '","' + n.F_FileName +
  80. '","' + n.F_FileType +
  81. '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
  82. '<span class="img_filename" onclick="playVideo(\''+ n.F_FileUrl + '\' , \'' + n.F_FileType + '\')">' + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
  83. } else {
  84. $('<div class="img-box">' +
  85. '<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' + n.F_FileUrl + '","' + n.F_FileName +
  86. '","' + n.F_FileType +
  87. '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
  88. '<span class="img_filename">'+n.F_OriName + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
  89. }
  90. });
  91. layer.photos({
  92. photos: '#fileList',
  93. anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
  94. title: '查看图片',
  95. move: '.layui-layer-title',
  96. shadeClose: false,
  97. closeBtn: 1,
  98. area: ['80%', '90%'],
  99. tab: function(pic, layero) {
  100. $('.layui-layer-content').on("mousewheel", function(e, d) {
  101. helper.methods.zoomImg($('#layui-layer-photos').find('img[alt="' + pic.alt + '"]'), d);
  102. $('#layui-layer-photos').find('img[alt="' + pic.alt + '"]').dragging({
  103. move: "both", //拖动方向,x y both
  104. randomPosition: false //初始位置是否随机
  105. });
  106. return false;
  107. });
  108. helper.methods.initLayerPhotos('#layui-layer-photos', pic, layero);
  109. },
  110. });
  111. $('.explancon').GL({
  112. ocolor: 'red', //设置关键词高亮颜色
  113. oshuru: otext //设置要显示的关键词
  114. });
  115. }
  116. }
  117. }
  118. });
  119. }
  120. //下载
  121. function downloadFile(data, strFileName, strMimeType) {
  122. event.preventDefault();
  123. //详细见文档 http://danml.com/download.html
  124. var x = new XMLHttpRequest();
  125. x.open("GET", data, true);
  126. x.responseType = 'blob';
  127. x.onload = function(e) {
  128. download(x.response, strFileName, strMimeType);
  129. }
  130. x.send();
  131. }
  132. /**
  133. * 播放视频
  134. * @playUrl 视频地址
  135. * @fileType 视屏类型
  136. * */
  137. function playVideo(playUrl, fileType){
  138. layer.open({
  139. maxmin: true, //开启最大化最小化按钮
  140. type: 2,
  141. content: "./playVideo.html?playUrl=" + encodeURIComponent(playUrl) + "&fileType=" + encodeURIComponent(fileType), //iframe的url,no代表不显示滚动条
  142. title: ' ',
  143. area: ['90%', '90%'], //宽高
  144. });
  145. }
  146. (function($) {
  147. $.fn.GL = function(options) {
  148. var dataop = {
  149. ocolor: 'red',
  150. oshuru: '',
  151. };
  152. var chuancan = $.extend(dataop, options);
  153. $(this).each(function() {
  154. var _this = $(this)
  155. _this.find($(".glnow")).each(function() {
  156. $(this).css({
  157. color: ""
  158. });
  159. });
  160. });
  161. if(chuancan.oshuru == '') {
  162. return false;
  163. } else {
  164. var regExp = new RegExp("(" + chuancan.oshuru.replace(/[(){}.+*?^$|\\\[\]]/g, "\\$&") + ")", "ig");
  165. $(this).each(function() {
  166. var _this1 = $(this)
  167. var html = _this1.html();
  168. var newHtml = html.replace(regExp, '<span class="glnow" style="color:' + chuancan.ocolor + '">' + chuancan.oshuru + '</span>');
  169. _this1.html(newHtml);
  170. });
  171. }
  172. }
  173. })(jQuery);
  174. </script>
  175. </html>