edit.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <html xmlns:th="http://www.thymeleaf.org">
  2. <head>
  3. <title>私塾家</title>
  4. <script th:include="sys/common/metaCSS" th:remove="tag"></script>
  5. <script th:include="sys/common/metaJS" th:remove="tag"></script>
  6. <script src="sys/js/jquery.validate.min.js" th:src="@{/static/sys/js/jquery.validate.min.js}"></script>
  7. <script src="sys/js/jquery-validation/messages_zh.js" th:src="@{/static/sys/js/jquery-validation/messages_zh.js}"></script>
  8. <style>
  9. .clearfix:after {
  10. visibility: hidden;
  11. display: block;
  12. font-size: 0;
  13. content: " ";
  14. clear: both;
  15. height: 0;
  16. }
  17. .clearfix { display: inline-table; }
  18. * html .clearfix { height: 1%; }
  19. .clearfix { display: block; }
  20. .fl{display:inline;float:left}
  21. clearfix >control-label-error{display:inline;float:left;marign-left:10px}
  22. label.control-label-error {
  23. color: Red;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div class="place">
  29. <span>位置:</span>
  30. <ul class="placeul">
  31. <li><a href="#">系统参数管理</a></li>
  32. <li><a href="#">参数管理</a></li>
  33. </ul>
  34. </div>
  35. <div class="formbody">
  36. <form id="roleFrom" method="post" class="form-horizontal form-validate">
  37. <input type="hidden" id="id" th:if="${config.id}" th:value="${config.id}" name="id">
  38. <ul class="forminfo">
  39. <li class="clearfix">
  40. <label class="fl">参数编码<b>*</b></label>
  41. <input type="text" th:value="${config.paramCode}" class="dfinput fl" name="paramCode">
  42. </li>
  43. <li class="clearfix">
  44. <label class="fl">参数内容<b>*</b></label>
  45. <input type="text" th:value="${config.paramVal}" class="dfinput fl" name="paramVal">
  46. </li>
  47. <li class="clearfix">
  48. <label class="fl">参数说明<b>*</b></label>
  49. <input type="text" th:value="${config.paramDesc}" class="dfinput fl" name="paramDesc">
  50. </li>
  51. <li>
  52. <label>&nbsp;</label>
  53. <button type="submit" class="btn">保存</button>
  54. <button type="button" class="btn" onclick="window.history.go(-1);">取消</button>
  55. </li>
  56. </ul>
  57. </form>
  58. </div>
  59. </body>
  60. <script type="text/javascript">
  61. $(function(){
  62. $("#roleFrom").validate({
  63. rules : {
  64. paramCode : {
  65. required : true
  66. },
  67. paramVal : {
  68. required : true
  69. },
  70. paramDesc : {
  71. required : true
  72. }
  73. },
  74. messages: {
  75. paramCode : {
  76. required : "请输入参数编码"
  77. },
  78. paramVal : {
  79. required : "请输入参数内容"
  80. },
  81. paramDesc : {
  82. required : "请输入参数说明"
  83. }
  84. },
  85. errorPlacement : function(error, element) {
  86. error.appendTo(element.parent());
  87. },
  88. submitHandler : function(form) {
  89. roleFrom();
  90. }
  91. });
  92. });
  93. function roleFrom(){
  94. var url="[[${sysUrl}]]/sys/config/saveConfig";
  95. var params = $("#roleFrom").serialize();
  96. $.post(url,params,function(data){
  97. if(data != null){
  98. if(data.meta.success){
  99. layer.msg("操作成功!",{icon:1});
  100. setTimeout(function(){
  101. window.location.href ='[[${sysUrl}]]/sys/config/list.html';
  102. },1000);
  103. }else{
  104. layer.msg(data.meta.message,{icon:11});
  105. }
  106. }
  107. });
  108. }
  109. </script>
  110. </html>