add.html 2.7 KB

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