edit.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <meta charset="utf-8">
  4. <head th:include="include :: header"></head>
  5. <body class="white-bg">
  6. <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7. <form class="form-horizontal m" id="form-config-edit" th:object="${config}">
  8. <input id="configId" name="configId" th:field="*{configId}" type="hidden">
  9. <div class="form-group">
  10. <label class="col-sm-3 control-label">参数名称:</label>
  11. <div class="col-sm-8">
  12. <input id="configName" name="configName" th:field="*{configName}" class="form-control" type="text">
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <label class="col-sm-3 control-label">参数键名:</label>
  17. <div class="col-sm-8">
  18. <input id="configKey" name="configKey" th:field="*{configKey}" class="form-control" type="text">
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <label class="col-sm-3 control-label">参数键值:</label>
  23. <div class="col-sm-8">
  24. <input id="configValue" name="configValue" th:field="*{configValue}" class="form-control" type="text">
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="col-sm-3 control-label">系统内置:</label>
  29. <div class="col-sm-8">
  30. <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
  31. <input type="radio" th:id="${dict.dictCode}" name="configType" th:value="${dict.dictValue}" th:field="*{configType}">
  32. <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="form-group">
  37. <label class="col-sm-3 control-label">备注:</label>
  38. <div class="col-sm-8">
  39. <textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <div class="form-control-static col-sm-offset-9">
  44. <button type="submit" class="btn btn-primary">提交</button>
  45. <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  46. </div>
  47. </div>
  48. </form>
  49. </div>
  50. <div th:include="include::footer"></div>
  51. <script type="text/javascript">
  52. var prefix = ctx + "system/config"
  53. $("#form-config-edit").validate({
  54. rules: {
  55. configKey: {
  56. required: true,
  57. remote: {
  58. url: prefix + "/checkConfigKeyUnique",
  59. type: "post",
  60. dataType: "json",
  61. data: {
  62. "configId": function() {
  63. return $("#configId").val();
  64. },
  65. "configKey": function() {
  66. return $.common.trim($("#configKey").val());
  67. }
  68. },
  69. dataFilter: function(data, type) {
  70. return $.validate.unique(data);
  71. }
  72. }
  73. },
  74. configName: {
  75. required: true
  76. },
  77. configValue: {
  78. required: true
  79. },
  80. },
  81. messages: {
  82. "configKey": {
  83. remote: "参数键名已经存在"
  84. }
  85. },
  86. submitHandler: function(form) {
  87. $.operate.save(prefix + "/edit", $('#form-config-edit').serialize());
  88. }
  89. });
  90. </script>
  91. </body>
  92. </html>