Commit c35ba20b374be16b48d6440903381b4250db6f87

Authored by 王言钊
1 parent a0269079

修复日志模块搜索框回车错误

src/main/resources/templates/page/log.html
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 </div> 36 </div>
37 </div> 37 </div>
38 <div class="columns columns-right btn-group pull-right"> 38 <div class="columns columns-right btn-group pull-right">
39 - <button class="btn btn-default" type="button" name="refresh" title="搜索" id="site_query">刷新</button> 39 + <button class="btn btn-default" type="button" name="refresh" title="搜索" id="log_query">刷新</button>
40 <ul class="dropdown-menu" role="menu"> 40 <ul class="dropdown-menu" role="menu">
41 <li><label><input type="checkbox" data-field="sp_id" value="0" 41 <li><label><input type="checkbox" data-field="sp_id" value="0"
42 checked="checked"> 视频ID</label></li> 42 checked="checked"> 视频ID</label></li>
@@ -54,9 +54,9 @@ @@ -54,9 +54,9 @@
54 </div> 54 </div>
55 </div> 55 </div>
56 <div class="pull-right search"> 56 <div class="pull-right search">
57 - <form id="searchForm"> 57 +<!-- <form id="searchForm">-->
58 <input class="form-control" type="text" placeholder="刷新" id="keyword" name="keyword" th:value="${param.keyword}"> 58 <input class="form-control" type="text" placeholder="刷新" id="keyword" name="keyword" th:value="${param.keyword}">
59 - </form> 59 +<!-- </form>-->
60 </div> 60 </div>
61 </div> 61 </div>
62 <div class="fixed-table-container" style="padding-bottom: 0px;"> 62 <div class="fixed-table-container" style="padding-bottom: 0px;">
@@ -225,12 +225,19 @@ @@ -225,12 +225,19 @@
225 } 225 }
226 226
227 //搜索 227 //搜索
228 - $('#site_query').click(function () { 228 + $('#log_query').click(function () {
229 var keyword = $("#keyword").val(); 229 var keyword = $("#keyword").val();
230 var pageSize = $("#pageSize").val(); 230 var pageSize = $("#pageSize").val();
231 window.location.href = "/log/page?keyword=" + keyword + "&pageNum=" + 1 + "&pageSize=" + pageSize; 231 window.location.href = "/log/page?keyword=" + keyword + "&pageNum=" + 1 + "&pageSize=" + pageSize;
232 }); 232 });
233 233
  234 + //鼠标回车事件
  235 + $(document).keyup(function (event) {
  236 + if (event.keyCode == 13) {
  237 + $("#log_query").trigger("click");
  238 + }
  239 + });
  240 +
234 </script> 241 </script>
235 242
236 <footer th:replace="../templates/common/foot::foot" ></footer> 243 <footer th:replace="../templates/common/foot::foot" ></footer>