edit.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('编辑版本信息')" />
  5. </head>
  6. <body class="white-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  8. <form class="form-horizontal m" id="form-dict-edit" th:object="${appVersion}">
  9. <input name="id" type="hidden" th:field="*{versionId}" />
  10. <div class="form-group">
  11. <label class="col-sm-2 control-label">系统:</label>
  12. <div class="col-sm-10">
  13. <select name="os" id="os" class="form-control m-b" th:with="type=${@dict.getType('os_type')}">
  14. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{os}"></option>
  15. </select>
  16. </div>
  17. </div>
  18. <div class="form-group" >
  19. <label class="col-sm-2 control-label">平台:</label>
  20. <div class="col-sm-10">
  21. <input id="platform" name="platform" class="form-control" type="text" readonly='true' th:field="*{platform}"/>
  22. </div>
  23. </div>
  24. <div class="form-group" >
  25. <label class="col-sm-2 control-label">appid:</label>
  26. <div class="col-sm-10">
  27. <input id="appid" name="appid" class="form-control" type="text" th:field="*{appid}"/>
  28. </div>
  29. </div>
  30. <div class="form-group" >
  31. <label class="col-sm-2 control-label">版本:</label>
  32. <div class="col-sm-10">
  33. <input id="version" name="version" class="form-control" type="text" required th:field="*{version}"/>
  34. </div>
  35. </div>
  36. <div class="form-group" >
  37. <label class="col-sm-2 control-label">状态:</label>
  38. <div class="col-sm-10">
  39. <select name="status" id="status" class="form-control m-b" th:with="type=${@dict.getType('version_status')}">
  40. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
  41. </select>
  42. </div>
  43. </div>
  44. <div class="form-group" >
  45. <label class="col-sm-2 control-label">版本描述:</label>
  46. <div class="col-sm-10">
  47. <textarea name="versionDesc" id="versionDesc" class="form-control" rows="3" placeholder="请输入描述" th:field="*{versionDesc}"></textarea>
  48. </div>
  49. </div>
  50. <div class="form-group select-time" >
  51. <label class="col-sm-2 control-label">发布时间:</label>
  52. <div class="col-sm-10">
  53. <input id="time" name="publishTime" class="form-control time-input" type="text" required th:field="*{displayPublishTime}"/>
  54. </div>
  55. </div>
  56. <div class="form-group" >
  57. <label class="col-sm-2 control-label">上传包:</label>
  58. <div class="col-sm-10">
  59. <input type="file" id="picUploadFile" name="uploadFile" accept="apk">
  60. <button class="btn btn-success" type="button" id="picUploadBtn">上传</button>
  61. <input type="hidden" id="downloadUrl" name="downloadUrl" class="form-control validate[required]" th:field="*{downloadUrl}"/>
  62. </div>
  63. </div>
  64. </form>
  65. </div>
  66. <th:block th:include="include :: footer" />
  67. <script type="text/javascript">
  68. var prefix = ctx + "system/version";
  69. $("#form-dict-edit").validate({
  70. focusCleanup: true
  71. });
  72. function submitHandler() {
  73. if ($.validate.form()) {
  74. $.operate.save(prefix + "/edit", $('#form-dict-edit').serialize());
  75. }
  76. }
  77. /**
  78. * 文件上传
  79. */
  80. $('#picUploadBtn').on('click',function () {
  81. if($('#picUploadFile').get(0).files[0]==undefined){
  82. $.modal.alertError("请选择要上传的文件!");
  83. return;
  84. }
  85. var formData = new FormData();
  86. formData.append("file", $('#picUploadFile').get(0).files[0]);
  87. $.ajax({
  88. url: ctx + "file/upload",
  89. data: formData,
  90. type: "post",
  91. processData: false,
  92. contentType: false,
  93. success: function(result) {
  94. $("input[name='downloadUrl']").val(result.data);
  95. }
  96. })
  97. });
  98. </script>
  99. </body>
  100. </html>