add.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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-add" name="form-config-add">
  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" class="form-control" type="text" required>
  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" class="form-control" type="text" required>
  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" class="form-control" type="text" required>
  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:checked="${dict.isDefault == 'Y' ? true : false}">
  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"></textarea>
  40. </div>
  41. </div>
  42. </form>
  43. </div>
  44. <th:block th:include="include :: footer" />
  45. <script type="text/javascript">
  46. var prefix = ctx + "system/config";
  47. $("#form-config-add").validate({
  48. onkeyup: false,
  49. rules: {
  50. configKey: {
  51. remote: {
  52. url: prefix + "/checkConfigKeyUnique",
  53. type: "post",
  54. dataType: "json",
  55. data: {
  56. "configKey": function() {
  57. return $.common.trim($("#configKey").val());
  58. }
  59. },
  60. dataFilter: function(data, type) {
  61. return $.validate.unique(data);
  62. }
  63. }
  64. },
  65. },
  66. messages: {
  67. "configKey": {
  68. remote: "参数键名已经存在"
  69. }
  70. },
  71. focusCleanup: true
  72. });
  73. function submitHandler() {
  74. if ($.validate.form()) {
  75. $.operate.save(prefix + "/add", $('#form-config-add').serialize());
  76. }
  77. }
  78. </script>
  79. </body>
  80. </html>