block_punish.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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-notice-add" th:object="${users}">
  9. <input type="hidden" name="blockId" th:value="${id}"/>
  10. <div class="form-group" id="chargeErBanNo">
  11. <label class="col-sm-2 control-label">卿卿号:</label>
  12. <div class="col-sm-10">
  13. <input id="erbanNo" name="erbanNo" readonly="readonly" class="form-control" th:field="*{erbanNo}" type="text" placeholder="请输入封禁卿卿号"/>
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="col-sm-2 control-label">封禁原因:</label>
  18. <div class="col-sm-10">
  19. <input id="blockDesc" name="blockDesc" class="form-control" type="text" placeholder="请输入封禁原因" required/>
  20. </div>
  21. </div>
  22. <div class="form-group" id="chargeBlockIp">
  23. <label class="col-sm-2 control-label">封禁IP:</label>
  24. <div class="col-sm-10">
  25. <input id="blockIp" name="blockIp" class="form-control" type="text" placeholder="请输入封禁IP"/>
  26. </div>
  27. </div>
  28. <div class="form-group">
  29. <label class="col-sm-2 control-label">封禁类型:</label>
  30. <div class="col-sm-10">
  31. <select name="blockType" id="blockType" class="form-control m-b" th:with="type=${@dict.getType('block_type')}">
  32. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  33. </select>
  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="blockTime" id="blockTime" class="form-control m-b" th:with="type=${@dict.getType('banned_time')}">
  40. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  41. </select>
  42. </div>
  43. </div>
  44. </form>
  45. </div>
  46. <th:block th:include="include :: footer" />
  47. <th:block th:include="include :: summernote-js" />
  48. <script type="text/javascript">
  49. var prefix = ctx + "review/avatar";
  50. $("#form-notice-add").validate({
  51. focusCleanup: true
  52. });
  53. $(function(){
  54. $("#chargeBlockIp").hide();
  55. $("#chargeErBanNo").show();
  56. $('input[name="erbanNo"]').attr("required", "true");
  57. $('input[name="blockIp"]').attr("required", "false");
  58. });
  59. $("#blockType").on("change", function (){
  60. var val = $(this).val();
  61. if(val == 3){
  62. $("#chargeBlockIp").show();
  63. $("#chargeErBanNo").hide();
  64. $('input[name="erbanNo"]').attr("required", "false");
  65. $('input[name="blockIp"]').attr("required", "true");
  66. }else{
  67. $("#chargeBlockIp").hide();
  68. $("#chargeErBanNo").show();
  69. $('input[name="erbanNo"]').attr("required", "true");
  70. $('input[name="blockIp"]').attr("required", "false");
  71. }
  72. });
  73. function submitHandler() {
  74. if ($.validate.form()) {
  75. $.operate.save(prefix + "/block/punish", $('#form-notice-add').serialize());
  76. }
  77. }
  78. </script>
  79. </body>
  80. </html>