template_file_edit.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>新增模板文件</title>
  7. </head>
  8. <body layout:fragment="content">
  9. <article class="page-container">
  10. <form class="form form-horizontal" id="form-templateFile-edit">
  11. <input type="hidden" id="id" th:value="${template.id}" th:name="id"/>
  12. <input type="hidden" id="typeId" th:value="${template.type_id}" th:name="type_id"/>
  13. <input type="hidden" id="itemId" th:value="${template.item_id}" th:name="item_id"/>
  14. <div class="row cl">
  15. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>模板名称:</label>
  16. <div class="formControls col-xs-8 col-sm-9">
  17. <input type="text" class="input-text" required th:value="${template.name}" th:id="name" th:name="name"/>
  18. </div>
  19. </div>
  20. <div class="row cl">
  21. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span><span>有效标记:</span></label>
  22. <div class="formControls col-xs-8 col-sm-9">
  23. <input type="radio" name="is_active" th:checked="${template.is_active==true}" value="1">是</input>
  24. <input type="radio" name="is_active" th:checked="${template.is_active==false}" value="0">否</input>
  25. </div>
  26. </div>
  27. <div class="row cl">
  28. <label class="form-label col-xs-4 col-sm-2"><span>模板文件:</span></label>
  29. <div class="formControls col-xs-8 col-sm-9">
  30. <div class="uploader-thum-container">
  31. <div id="fileListPre" class="uploader-list">
  32. <th:block th:unless="${template.fileDown} == null">
  33. <th:block th:unless="${template.fileDown.file_url} == null">
  34. <a th:href="${fileUrl} + ${template.fileDown.file_url}" target="_blank">[[${template.fileDown.file_name}]]</a>
  35. </th:block>
  36. </th:block>
  37. </div>
  38. <div id="filePicker">选择文件</div>
  39. <th:block th:unless="${template.fileDown} == null">
  40. <input type="hidden" name="file_url" id="img" th:value="${template.fileDown.file_url}"/>
  41. </th:block>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="row cl">
  46. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  47. <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i>保存</button>
  48. <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>
  49. </div>
  50. </div>
  51. </form>
  52. </article>
  53. <script type="text/javascript" th:src="@{/js/super/template/template_edit.js}"></script>
  54. <script th:inline="javascript">
  55. /**
  56. * 初始化上传控件
  57. */
  58. var options = {
  59. uploadBtnId: '#filePicker',
  60. picturePreId: 'fileListPre',
  61. hiddenPictureUrl: 'img',
  62. hiddenPictureName: 'imgName',
  63. // accept : {
  64. // title : 'Images',
  65. // extensions : 'gif,jpg,jpeg,bmp,png',
  66. // mimeTypes : 'image/gif,image/jpg,image/jpeg,image/bmp,image/png'
  67. // },
  68. width: 81,
  69. height: 81,
  70. fileSizeLimit: 100 * 1024 * 1024,
  71. fileSingleSizeLimit: 100 * 1024 * 1024
  72. // fileNumLimit: 1
  73. };
  74. var webUploadDoc = new $WebUploadDoc(options);
  75. webUploadDoc.init();
  76. /**
  77. * 取消
  78. */
  79. function removeIframe() {
  80. var index = parent.layer.getFrameIndex(window.name);
  81. parent.layer.close(index);
  82. }
  83. </script>
  84. </body>
  85. </html>