edit.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-user-edit" th:object="${user}">
  9. <input name="userId" type="hidden" th:field="*{userId}" />
  10. <div class="form-group">
  11. <label class="col-sm-3 control-label">用户编号:</label>
  12. <div class="col-sm-8">
  13. <input class="form-control" type="text" name="userCode" id="userCode" th:field="*{userCode}" 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 class="form-control" type="text" name="userName" id="userName" th:field="*{userName}" 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. <div class="input-group" style="width: 100%">
  26. <select name="userSex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
  27. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userSex}"></option>
  28. </select>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label class="col-sm-3 control-label">用户手机:</label>
  34. <div class="col-sm-8">
  35. <input class="form-control" type="text" name="userPhone" th:field="*{userPhone}" id="userPhone">
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. <label class="col-sm-3 control-label">用户邮箱:</label>
  40. <div class="col-sm-8">
  41. <input class="form-control" type="text" name="userEmail" th:field="*{userEmail}" id="userEmail">
  42. </div>
  43. </div>
  44. <div class="form-group">
  45. <label class="col-sm-3 control-label">用户状态:</label>
  46. <div class="col-sm-8">
  47. <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
  48. <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
  49. <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
  50. </div>
  51. </div>
  52. </div>
  53. </form>
  54. </div>
  55. <th:block th:include="include :: footer" />
  56. <script type="text/javascript">
  57. var prefix = ctx + "demo/operate";
  58. $("#form-user-add").validate({
  59. onkeyup: false,
  60. rules:{
  61. userPhone:{
  62. isPhone:true
  63. },
  64. userEmail:{
  65. email:true
  66. },
  67. },
  68. focusCleanup: true
  69. });
  70. function submitHandler() {
  71. if ($.validate.form()) {
  72. $.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
  73. }
  74. }
  75. </script>
  76. </body>
  77. </html>