edit.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
  4. <head th:replace="admin/common/html/tableHead :: tableHead(~{::title},~{::link},~{::style})">
  5. <title th:text=${title}></title>
  6. <!-- 这儿引用单独的css link -->
  7. <!-- Ladda for Bootstrap 3按钮加载进度插件 -->
  8. <link rel="stylesheet" th:href="@{/static/admin/assets/js/button/ladda/ladda.min.css}">
  9. <!-- bootstrap-table表单样式 -->
  10. <link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
  11. <!-- 用户界面自定义css -->
  12. <link th:href="@{/static/admin/user/css/user-add.css}" rel="stylesheet"/>
  13. <style type="text/css"></style>
  14. </head>
  15. <body>
  16. <div class="content-wrap">
  17. <div class="row">
  18. <div class="col-sm-12">
  19. <div class="nest" id="elementClose">
  20. <div class="">
  21. </div>
  22. <div class="body-nest" id="element">
  23. <div class="panel-body">
  24. <form class="form-horizontal m" id="form-edit" th:object="${SysProvince}">
  25. <input id="id" name="id" type="hidden" th:field="*{id}"/>
  26. <div class="form-group">
  27. <label class="col-sm-3 control-label ">省份代码:</label>
  28. <div class="col-sm-8">
  29. <input class="form-control" type="text" id="provinceCode" name="provinceCode" th:value="*{provinceCode}"/>
  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" id="provinceName" name="provinceName" th:value="*{provinceName}"/>
  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" id="shortName" name="shortName" th:value="*{shortName}"/>
  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. <input class="form-control" type="text" id="lng" name="lng" th:value="*{lng}"/>
  48. </div>
  49. </div>
  50. <div class="form-group">
  51. <label class="col-sm-3 control-label ">纬度:</label>
  52. <div class="col-sm-8">
  53. <input class="form-control" type="text" id="lat" name="lat" th:value="*{lat}"/>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <label class="col-sm-3 control-label ">排序:</label>
  58. <div class="col-sm-8">
  59. <input class="form-control" type="number" id="sort" name="sort" th:value="*{sort}"/>
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <label class="col-sm-3 control-label ">创建时间:</label>
  64. <div class="col-sm-8">
  65. <input class="form-control MyDate" type="text" id="gmtCreate" name="gmtCreate" th:value="*{#dates.format(gmtCreate,'yyyy-MM-dd HH:mm:ss')}"/>
  66. </div>
  67. </div>
  68. <div class="form-group">
  69. <label class="col-sm-3 control-label ">修改时间:</label>
  70. <div class="col-sm-8">
  71. <input class="form-control MyDate" type="text" id="gmtModified" name="gmtModified" th:value="*{#dates.format(gmtModified,'yyyy-MM-dd HH:mm:ss')}"/>
  72. </div>
  73. </div>
  74. <div class="form-group">
  75. <label class="col-sm-3 control-label ">备注:</label>
  76. <div class="col-sm-8">
  77. <input class="form-control" type="text" id="memo" name="memo" th:value="*{memo}"/>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label class="col-sm-3 control-label ">状态:</label>
  82. <div class="col-sm-8">
  83. <select name="dataState" id="dataState" class="form-control m-b" th:with="type=${@dict.getType('sys_province_state')}" th:field="*{dataState}">
  84. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  85. </select>
  86. </div>
  87. </div>
  88. <div class="form-group">
  89. <div class="form-control-static col-sm-offset-9">
  90. <button type="submit" class="btn btn-primary">提交</button>
  91. <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  92. </div>
  93. </div>
  94. </form>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <!-- 通用js -->
  102. <div th:include="admin/common/html/js :: onload_js">
  103. </div>
  104. <!-- bootstarp 表格 -->
  105. <script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/bootstrap-table.min.js}" type="text/javascript"></script>
  106. <script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}" type="text/javascript"></script>
  107. <script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>
  108. <!-- 弹窗 -->
  109. <script th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
  110. <!-- 遮罩层 -->
  111. <script th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>
  112. <script type="text/javascript">
  113. $(function(){
  114. $(".MyDate").datetimepicker({
  115. format: "yyyy-mm-dd hh:00:00",
  116. startDate: new Date(),
  117. autoclose: true,
  118. todayBtn: true,
  119. language: 'zh-CN',
  120. initialDate:new Date(),
  121. minView: 1
  122. });
  123. })
  124. $("#form-edit").validate({
  125. submitHandler : function(form) {
  126. edit();
  127. }
  128. });
  129. function edit() {
  130. var dataFormJson = $("#form-edit").serialize();
  131. $.ajax({
  132. cache : true,
  133. type : "POST",
  134. url : rootPath + "/SysProvinceController/edit",
  135. data : dataFormJson,
  136. async : false,
  137. error : function(request) {
  138. $.modal.alertError("系统错误");
  139. },
  140. success : function(data) {
  141. $.operate.saveSuccess(data);
  142. }
  143. });
  144. }
  145. </script>
  146. </body>
  147. </html>