officePicture.ftl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>PDF图片预览</title>
  6. <#include "*/commonHeader.ftl">
  7. <script src="js/lazyload.js"></script>
  8. <style>
  9. body {
  10. background-color: #404040;
  11. }
  12. .container {
  13. width: 100%;
  14. height: 100%;
  15. }
  16. .img-area {
  17. text-align: center;
  18. }
  19. .my-photo {
  20. max-width: 98%;
  21. margin:0 auto;
  22. border-radius:3px;
  23. box-shadow:rgba(0,0,0,0.15) 0 0 8px;
  24. background:#FBFBFB;
  25. border:1px solid #ddd;
  26. margin:1px auto;
  27. padding:5px;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <div class="container">
  33. <#list imgUrls as img>
  34. <div class="img-area">
  35. <img class="my-photo" alt="loading" data-src="${img}" src="images/loading.gif">
  36. </div>
  37. </#list>
  38. </div>
  39. <#if "false" == switchDisabled>
  40. <img src="images/pdf.svg" width="48" height="48" style="position: fixed; cursor: pointer; top: 40%; right: 48px; z-index: 999;" alt="使用PDF预览" title="使用PDF预览" onclick="changePreviewType('pdf')"/>
  41. </#if>
  42. <script>
  43. window.onload = function () {
  44. /*初始化水印*/
  45. initWaterMark();
  46. checkImgs();
  47. };
  48. window.onscroll = throttle(checkImgs);
  49. function changePreviewType(previewType) {
  50. var url = window.location.href;
  51. if (url.indexOf("officePreviewType=image") !== -1) {
  52. url = url.replace("officePreviewType=image", "officePreviewType="+previewType);
  53. } else {
  54. url = url + "&officePreviewType="+previewType;
  55. }
  56. if ('allImages' === previewType) {
  57. window.open(url)
  58. } else {
  59. window.location.href = url;
  60. }
  61. }
  62. </script>
  63. </body>
  64. </html>