updateZipUpload.jsp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>上传更新包</title>
  7. <link rel="stylesheet" type="text/css" href="/main/dev/updateWeb/plugin/layui/css/layui.css" />
  8. <link rel="stylesheet" type="text/css" charset="UTF-8" href="/main/dev/updateWeb/plugin/sui/css/sui.min.css" />
  9. <link rel="stylesheet" type="text/css" charset="UTF-8"
  10. href="/main/dev/updateWeb/plugin/sui/css/sui-append.min.css" />
  11. <script src="/main/dev/updateWeb/plugin/jq/jquery-3.0.0.min.js" type="text/javascript" charset="utf-8"></script>
  12. <script src="/main/dev/updateWeb/plugin/vue/vue.min.js" type="text/javascript" charset="utf-8"></script>
  13. <style>
  14. html,
  15. body {
  16. background-color: #fff;
  17. }
  18. .wraper {
  19. width: 100%;
  20. height: 100%;
  21. }
  22. /* 更新包管理-上传更新包 */
  23. .upload-pop {
  24. width: 400px;
  25. height: 220px;
  26. border: 1px dashed #c0c4cc;
  27. text-align: center;
  28. border-radius: 6px;
  29. position: relative;
  30. margin: 52px auto 8px;
  31. cursor: pointer;
  32. }
  33. .upload-pop>div {
  34. position: absolute;
  35. top: 60%;
  36. left: 50%;
  37. transform: translate(-50%, -50%);
  38. }
  39. .upload-pop i {
  40. font-size: 80px;
  41. color: #c0c4cc;
  42. }
  43. .upload-pop:hover {
  44. color: #07C160;
  45. border-color: #07C160;
  46. }
  47. .upload-pop:hover i {
  48. color: #07C160;
  49. }
  50. .upload-desc {
  51. text-align: center;
  52. font-size: 12px;
  53. }
  54. .upload-val {
  55. text-align: center;
  56. margin: 15px 0;
  57. }
  58. .upload-val .upload-btn {
  59. margin-top: 50px;
  60. }
  61. .upload-success {
  62. text-align: center;
  63. }
  64. .upload-success i {
  65. font-size: 80px;
  66. color: #07C160;
  67. }
  68. .upload-success p {
  69. margin-top: 10px;
  70. }
  71. .upload-zipImg {
  72. width: 140px;
  73. margin: 0 auto;
  74. }
  75. .upload-zipImg img {
  76. width: 100%;
  77. }
  78. </style>
  79. </head>
  80. <body>
  81. <div class="wraper layui-anim layui-anim-fadein" id="space-content">
  82. <form id="myForm" method="POST" action="${uploadZipURL}" enctype="multipart/form-data">
  83. <div class="upload-pop" @click="selectFileClick" v-show="uZipVal.length<=0">
  84. <div>
  85. <i class="layui-icon layui-icon-upload-drag"></i>
  86. <p>点击选择更新包</p>
  87. <input type="file" id="u_zip" name="uzip" accept=".zip,aplication/zip" v-model="uZipVal" style="display: none;" />
  88. </div>
  89. </div>
  90. <div class="upload-zipImg" v-show="uZipVal.length>0">
  91. <img src="/main/dev/updateWeb/images/zip.png" alt="">
  92. </div>
  93. <div class="upload-val" v-show="uZipVal.length>0">
  94. {{uZipVal}}
  95. <p class="upload-btn">
  96. <button type="button" @click="uBtnClick" class="sui-btn btn-xlarge btn-primary">上传</button>
  97. </p>
  98. </div>
  99. <div class="upload-desc">
  100. 只能上传zip类型的文件,且大小不能超过2G
  101. </div>
  102. </form>
  103. </div>
  104. </body>
  105. <script type="text/javascript">
  106. var space = {
  107. appContent: "#space-content"
  108. };
  109. space.vue = new Vue({
  110. el: space.appContent,
  111. data: function () {
  112. return {
  113. uZipVal: '',
  114. }
  115. },
  116. methods: {
  117. selectFileClick: function () { //点击选择
  118. $("#u_zip").click();
  119. },
  120. uBtnClick: function () { //上传
  121. $("#myForm").submit();
  122. },
  123. }
  124. })
  125. </script>
  126. </html>