edit.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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-config-edit" th:object="${config}">
  9. <input id="configId" name="configId" th:field="*{configId}" type="hidden">
  10. <div class="form-group">
  11. <label class="col-sm-3 control-label">参数名称:</label>
  12. <div class="col-sm-8">
  13. <input id="configName" name="configName" th:field="*{configName}" class="form-control" type="text" required>
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="col-sm-3 control-label">参数键名:</label>
  18. <div class="col-sm-8">
  19. <input id="configKey" name="configKey" th:field="*{configKey}" class="form-control" type="text" required>
  20. </div>
  21. </div>
  22. <div class="form-group">
  23. <label class="col-sm-3 control-label">参数键值:</label>
  24. <div class="col-sm-8">
  25. <input id="configValue" name="configValue" th:field="*{configValue}" class="form-control" type="text" required>
  26. </div>
  27. </div>
  28. <div class="form-group">
  29. <label class="col-sm-3 control-label">系统内置:</label>
  30. <div class="col-sm-8">
  31. <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
  32. <input type="radio" th:id="${dict.dictCode}" name="configType" th:value="${dict.dictValue}" th:field="*{configType}">
  33. <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-sm-3 control-label">备注:</label>
  39. <div class="col-sm-8">
  40. <textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
  41. </div>
  42. </div>
  43. </form>
  44. </div>
  45. <th:block th:include="include :: footer" />
  46. <script type="text/javascript">
  47. var prefix = ctx + "system/config";
  48. $("#form-config-edit").validate({
  49. onkeyup: false,
  50. rules: {
  51. configKey: {
  52. remote: {
  53. url: prefix + "/checkConfigKeyUnique",
  54. type: "post",
  55. dataType: "json",
  56. data: {
  57. "configId": function() {
  58. return $("#configId").val();
  59. },
  60. "configKey": function() {
  61. return $.common.trim($("#configKey").val());
  62. }
  63. },
  64. dataFilter: function(data, type) {
  65. return $.validate.unique(data);
  66. }
  67. }
  68. },
  69. },
  70. messages: {
  71. "configKey": {
  72. remote: "参数键名已经存在"
  73. }
  74. },
  75. focusCleanup: true
  76. });
  77. function submitHandler() {
  78. if ($.validate.form()) {
  79. $.operate.save(prefix + "/edit", $('#form-config-edit').serialize());
  80. }
  81. }
  82. </script>
  83. </body>
  84. </html>