upload.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <th:block th:include="include :: header('文件上传')" />
  5. <th:block th:include="include :: bootstrap-fileinput-css" />
  6. </head>
  7. <body class="gray-bg">
  8. <div class="wrapper wrapper-content animated fadeInRight">
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="ibox float-e-margins">
  12. <div class="ibox-title">
  13. <h5>文件上传控件 <small>https://github.com/kartik-v/bootstrap-fileinput</small></h5>
  14. </div>
  15. <div class="ibox-content">
  16. <div class="form-group">
  17. <label class="font-noraml">简单示例</label>
  18. <div class="file-loading">
  19. <input class="file" type="file" multiple data-min-file-count="1" data-theme="fas">
  20. </div>
  21. </div>
  22. <div class="form-group">
  23. <label class="font-noraml">多文件上传</label>
  24. <div class="file-loading">
  25. <input id="fileinput-demo-1" type="file" multiple>
  26. </div>
  27. </div>
  28. <hr>
  29. <div class="form-group">
  30. <label class="font-noraml">相关参数详细信息</label>
  31. <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-fileinput" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-fileinput</a></div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <th:block th:include="include :: footer" />
  39. <th:block th:include="include :: bootstrap-fileinput-js" />
  40. <script type="text/javascript">
  41. $(document).ready(function () {
  42. $("#fileinput-demo-1").fileinput({
  43. 'theme': 'explorer-fas',
  44. 'uploadUrl': '#',
  45. overwriteInitial: false,
  46. initialPreviewAsData: true,
  47. initialPreview: [
  48. "/img/profile.jpg"
  49. ]
  50. });
  51. $("#fileinput-demo-1").on("fileuploaded", function(event, data, proviewId, index) {
  52. console.info(event);
  53. console.info(data);
  54. console.info(proviewId);
  55. console.info(index);
  56. });
  57. });
  58. </script>
  59. </body>
  60. </html>