other.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  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" id="form-demo-1">
  9. <div class="form-group">
  10. <label class="col-sm-2 control-label">用户名称:</label>
  11. <div class="col-sm-10">
  12. <input type="text" class="form-control" name="userName" placeholder="请输入用户名称">
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <label class="col-sm-2 control-label">手机号码:</label>
  17. <div class="col-sm-10">
  18. <input type="text" class="form-control" name="phonenumber" maxlength="11" placeholder="请输入手机号码">
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <div class="col-sm-offset-2 col-sm-10">
  23. <button type="button" class="btn btn-sm btn-primary" onclick="submit1()"><i class="fa fa-check"></i>保 存(不刷新当前页)</button>&nbsp;
  24. </div>
  25. </div>
  26. </form>
  27. <hr/>
  28. <form class="form-horizontal" id="form-demo-2">
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label">用户名称:</label>
  31. <div class="col-sm-10">
  32. <input type="text" class="form-control" name="userName" placeholder="请输入用户名称">
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-sm-2 control-label">手机号码:</label>
  37. <div class="col-sm-10">
  38. <input type="text" class="form-control" name="phonenumber" maxlength="11" placeholder="请输入手机号码">
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <div class="col-sm-offset-2 col-sm-10">
  43. <button type="button" class="btn btn-sm btn-primary" onclick="submit2()"><i class="fa fa-check"></i>保 存(刷新当前页)</button>&nbsp;
  44. </div>
  45. </div>
  46. </form>
  47. </div>
  48. <th:block th:include="include :: footer" />
  49. <script type="text/javascript">
  50. var prefix = ctx + "demo/operate";
  51. function submit1(){
  52. $.operate.saveModal(prefix + "/edit", $('#form-demo-1').serialize());
  53. }
  54. function submit2(){
  55. $.ajax({
  56. url: prefix + "/edit",
  57. data: $('#form-demo-2').serialize(),
  58. type: "post",
  59. success: function(result) {
  60. if (result.code == web_status.SUCCESS) {
  61. layer.msg("保存成功,正在刷新数据请稍后……", {
  62. icon: 1,
  63. time: 500,
  64. shade: [0.1, '#8F8F8F']
  65. },function() {
  66. location.reload();
  67. });
  68. } else {
  69. alert(result.msg);
  70. }
  71. }
  72. })
  73. }
  74. </script>
  75. </body>
  76. </html>