detail.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <jsp:include page="../common/common-meta-include.jsp"></jsp:include>
  8. <jsp:include page="../common/common-js-include.jsp"></jsp:include>
  9. <jsp:include page="../common/common-css-include.jsp"></jsp:include>
  10. <!--[if lt IE 9]>
  11. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  12. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  13. <![endif]-->
  14. <style type="text/css">
  15. .layui-colla-content {
  16. border-width: 0px;
  17. left: 11px;
  18. top: 0px;
  19. width: -webkit-fill-available;
  20. height: 522px;
  21. background: inherit;
  22. background-color: rgba(255, 255, 255, 0.996078431372549);
  23. border: none;
  24. border-radius: 12px;
  25. -moz-box-shadow: none;
  26. -webkit-box-shadow: none;
  27. box-shadow: none;
  28. }
  29. .imgUl{
  30. display: inline-flex;
  31. flex-wrap: wrap;
  32. gap:20px;
  33. }
  34. .media-box{
  35. width:calc(25% - 15px);
  36. }
  37. .imgUl li {
  38. width: 30%;
  39. padding-top: 20px;
  40. }
  41. .imgTab{
  42. border: 1px solid black;
  43. max-height: 300px;
  44. max-width: 300px;
  45. margin:0 auto 20px;
  46. }
  47. .imgUl img{
  48. max-height: 280px;
  49. max-width: 300px;
  50. width:100%;
  51. height:100%;
  52. /* height: 300px;
  53. width: 300px; */
  54. }
  55. .imgTab video{
  56. max-height: 240px;
  57. max-width: 300px;
  58. width:100%;
  59. height:100%;
  60. /* height: 270px;
  61. width: 300px; */
  62. }
  63. </style>
  64. </head>
  65. <body>
  66. <div id="app"></div>
  67. <input type="hidden" id="subId" value="${subId}"/>
  68. <template id="template">
  69. <div>
  70. <div class="right_title">
  71. <div class="layui-collapse">
  72. <div class="layui-colla-item">
  73. <h2 class="layui-colla-title return">
  74. <button class="btn" @click="backHis">返回</button>
  75. </h2>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="layui-tab" lay-filter="formData">
  80. <ul class="layui-tab-title">
  81. <li class="layui-this">图片</li>
  82. <li>视频</li>
  83. </ul>
  84. <div class="layui-tab-content">
  85. <div class="layui-tab-item layui-show">
  86. <div class="layui-colla-content layui-show" style="height: auto;">
  87. <div class="table_box" style="padding-top: 0;">
  88. <div class="imgUl">
  89. <div v-for="(item, index) in imageList" class="media-box" @click="showImg(index)" >
  90. <div class="imgTab">
  91. <%-- <img :id="idTemp(index)" :alt="item.time" :lay-src="'${domain}/static/file/'+item.fileAddre+'/showfile'" :src="'${domain}/static/file/'+item.fileAddre+'/showfile'">--%>
  92. <img :id="idTemp(index)" :alt="item.time" :lay-src="'${domain}/static/file/'+item.fileAddre+'/showfileFgw'" :src="picShow(item.fileAddre,item.fileType)">
  93. <span>{{item.time}}</span>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="pagination-box" id="imagePagination"></div>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="layui-tab-item">
  102. <div class="layui-colla-content layui-show" style="height: auto;">
  103. <div class="table_box" style="padding-top: 0;">
  104. <div class="imgUl">
  105. <div v-for="(item, index) in vedioList" class="media-box" @click="showVideo">
  106. <div class="imgTab">
  107. <video controls="controls" loop="loop" preload="auto">
  108. <%-- <source :src="'${domain}/static/file/'+item.fileAddre+'/watch'">--%>
  109. <source :src="picShow(item.fileAddre,item.fileType)">
  110. </video>
  111. <span>{{item.time}}</span>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="pagination-box" id="vedioPagination"></div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </template>
  123. <script type="text/javascript">
  124. new Vue({
  125. el : "#app",
  126. template: "#template",
  127. data : {
  128. tabActive : 9,
  129. vedioList: [],
  130. imageList: [],
  131. vedioPageNo: 1,
  132. vedioPageSize: 8,
  133. imagePageNo: 1,
  134. imagePageSize: 8,
  135. closeMark : false
  136. },
  137. mounted : function() {
  138. this.init();
  139. },
  140. methods : {
  141. picShow(fileId, type) {
  142. var tempId = "#" + fileId;
  143. if (type == 8) {
  144. return "${WebSite.asset}/css/images/pdf.png";
  145. } else if (type == null || type == "") {
  146. } else if (type == 101 || type == 102 || type == 103 || type == 104 || type == 105) {
  147. return "${domain}/static/file/" + fileId + "/showfileFgw";
  148. } else if (type == 4 || type == 5) {
  149. return "${WebSite.asset}/css/images/excel.png";
  150. } else if (type == 2 || type == 3) {
  151. return "${WebSite.asset}/css/images/word.png";
  152. } else if (type == 203) {
  153. return "${WebSite.asset}/css/images/video.png";
  154. }
  155. },
  156. init : function() {
  157. var self = this;
  158. this.getImgForm();
  159. this.getVedioForm();
  160. },
  161. showImg: function(index){
  162. var idName="img"+index;
  163. var imageUrl=document.getElementById(idName).getAttribute('src');
  164. layer.photos({
  165. photos: {
  166. "title":"",
  167. "id": "",
  168. "start": 0,
  169. "data": [
  170. {
  171. "alt": "",
  172. "pid": "",
  173. "src": imageUrl,
  174. "thumb": imageUrl
  175. }
  176. ]
  177. },
  178. anim: 5,
  179. closeBtn :"1",
  180. success: function() {
  181. //以鼠标位置为中心的图片滚动放大缩小
  182. $(document).on("mousewheel",".layui-layer-photos",function(ev){
  183. var oImg = this;
  184. var ev = event || window.event;//返回WheelEvent
  185. //ev.preventDefault();
  186. var delta = ev.detail ? ev.detail > 0 : ev.wheelDelta < 0;
  187. var ratioL = (ev.clientX - oImg.offsetLeft) / oImg.offsetWidth,
  188. ratioT = (ev.clientY - oImg.offsetTop) / oImg.offsetHeight,
  189. ratioDelta = !delta ? 1 + 0.1 : 1 - 0.1,
  190. w = parseInt(oImg.offsetWidth * ratioDelta),
  191. h = parseInt(oImg.offsetHeight * ratioDelta),
  192. l = Math.round(ev.clientX - (w * ratioL)),
  193. t = Math.round(ev.clientY - (h * ratioT));
  194. $(".layui-layer-photos").css({
  195. width: w, height: h
  196. ,left: l, top: t
  197. });
  198. $("#layui-layer-photos").css({width: w, height: h});
  199. $("#layui-layer-photos>img").css({width: w, height: h});
  200. });
  201. }
  202. ,end: function(){ //销毁回调
  203. }
  204. });
  205. },
  206. idTemp: function (index){
  207. return "img"+index;
  208. },
  209. showVideo: function (){
  210. layer.photos({
  211. photos: '.imgUl',
  212. shadeClose: true,
  213. closeBtn: 2,
  214. anim: 5
  215. })
  216. },
  217. getImgForm: function(){
  218. var subId = $("#subId").val();
  219. if(subId == ""){
  220. App.msg.warn("请从正规页面进入");
  221. return;
  222. }else{
  223. var self = this;
  224. App.postJson("/api/rptCont/pageFileBySub",{pageNo: this.imagePageNo, pageSize: this.imagePageSize, subId : subId, type: "IMAGE"}, function(res){
  225. if(res.success){
  226. self.imageList = res.rows || [];
  227. self.loadImagePage(res.total);
  228. setTimeout(function() {
  229. layui.form.render();
  230. }, 200);
  231. }
  232. });
  233. }
  234. },
  235. loadImagePage : function(totalCount){
  236. var self = this;
  237. layui.laypage.render({
  238. elem: 'imagePagination',
  239. count: totalCount,
  240. curr : self.imagePageNo,
  241. limit : self.imagePageSize,
  242. layout: ['count', 'prev', 'page', 'next', 'skip'],
  243. jump: function(obj, first) {
  244. //首次不执行
  245. if(!first) {
  246. self.imgPageNo = obj.curr;
  247. self.getImgForm();
  248. }
  249. }
  250. });
  251. },
  252. getVedioForm: function(){
  253. var subId = $("#subId").val();
  254. if(subId == ""){
  255. App.msg.warn("请从正规页面进入");
  256. return;
  257. }else{
  258. var self = this;
  259. App.postJson("/api/rptCont/pageFileBySub",{pageNo: this.vedioPageNo, pageSize: this.vedioPageSize, subId : subId, type: "VEDIO"}, function(res){
  260. if(res.success){
  261. self.vedioList = res.rows || [];
  262. self.loadVedioPage(res.total);
  263. setTimeout(function() {
  264. layui.form.render();
  265. }, 200);
  266. }
  267. });
  268. }
  269. },
  270. loadVedioPage : function(totalCount){
  271. var self = this;
  272. layui.laypage.render({
  273. elem: 'vedioPagination',
  274. count: totalCount,
  275. curr : self.vedioPageNo,
  276. limit : self.vedioPageSize,
  277. layout: ['count', 'prev', 'page', 'next', 'skip'],
  278. jump: function(obj, first) {
  279. //首次不执行
  280. if(!first) {
  281. self.vedioPageNo = obj.curr;
  282. self.getVedioForm();
  283. }
  284. }
  285. });
  286. },
  287. backHis(){
  288. App.closeCurrentLayer();
  289. },
  290. }
  291. })
  292. </script>
  293. </body>
  294. </html>