rptFile.jsp 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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. .right_title{
  64. margin-bottom: 20px;
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <div id="app"></div>
  70. <input type="hidden" id="subId" value="${subId}"/>
  71. <template id="template">
  72. <div style="padding: 0 20px">
  73. <%-- <div class="right_title">--%>
  74. <%-- <div class="layui-collapse">--%>
  75. <%-- <h2 class="layui-colla-title" style="padding-right:0">--%>
  76. <%-- </h2>--%>
  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">
  90. <div class="imgTab">
  91. <%-- <img :alt="item.time" :lay-src="'${domain}/static/file/'+item.fileAddre+'/showfile'" :src="'${domain}/static/file/'+item.fileAddre+'/showfile'">--%>
  92. <img :alt="item.time" :lay-src="'${domain}/static/file/'+item.fileAddre+'/showfile'" :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="showImg">
  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(){
  162. layer.photos({
  163. photos: '.imgUl',
  164. shadeClose: true,
  165. closeBtn: 2,
  166. anim: 5
  167. })
  168. },
  169. getImgForm: function(){
  170. var subId = $("#subId").val();
  171. if(subId == ""){
  172. App.msg.warn("请从正规页面进入");
  173. return;
  174. }else{
  175. var self = this;
  176. App.postJson("/api/rptCont/pageFileBySub",{pageNo: this.imagePageNo, pageSize: this.imagePageSize, subId : subId, type: "IMAGE"}, function(res){
  177. if(res.success){
  178. self.imageList = res.rows || [];
  179. self.loadImagePage(res.total);
  180. setTimeout(function() {
  181. layui.form.render();
  182. }, 200);
  183. }
  184. });
  185. }
  186. },
  187. loadImagePage : function(totalCount){
  188. var self = this;
  189. layui.laypage.render({
  190. elem: 'imagePagination',
  191. count: totalCount,
  192. curr : self.imagePageNo,
  193. limit : self.imagePageSize,
  194. layout: ['count', 'prev', 'page', 'next', 'skip'],
  195. jump: function(obj, first) {
  196. //首次不执行
  197. console.log(first);
  198. console.log(obj.curr);
  199. if(!first) {
  200. self.imagePageNo = obj.curr;
  201. self.getImgForm();
  202. }
  203. }
  204. });
  205. },
  206. getVedioForm: function(){
  207. var subId = $("#subId").val();
  208. if(subId == ""){
  209. App.msg.warn("请从正规页面进入");
  210. return;
  211. }else{
  212. var self = this;
  213. App.postJson("/api/rptCont/pageFileBySub",{pageNo: this.vedioPageNo, pageSize: this.vedioPageSize, subId : subId, type: "VEDIO"}, function(res){
  214. if(res.success){
  215. self.vedioList = res.rows || [];
  216. self.loadVedioPage(res.total);
  217. setTimeout(function() {
  218. layui.form.render();
  219. }, 200);
  220. }
  221. });
  222. }
  223. },
  224. loadVedioPage : function(totalCount){
  225. var self = this;
  226. layui.laypage.render({
  227. elem: 'vedioPagination',
  228. count: totalCount,
  229. curr : self.vedioPageNo,
  230. limit : self.vedioPageSize,
  231. layout: ['count', 'prev', 'page', 'next', 'skip'],
  232. jump: function(obj, first) {
  233. //首次不执行
  234. if(!first) {
  235. self.vedioPageNo = obj.curr;
  236. self.getVedioForm();
  237. }
  238. }
  239. });
  240. },
  241. backHis(){
  242. if(${layer}){
  243. App.closeCurrentLayer();
  244. }else {
  245. window.location.href = "${lastUrl}";
  246. }
  247. },
  248. }
  249. })
  250. </script>
  251. </body>
  252. </html>