Commit aa5338a33ac47ae1d12d5f5c70fb4638ad07ea13
1 parent
99e29e94
每页显示数量修改后自动刷新
Showing
5 changed files
with
147 additions
and
7 deletions
src/main/resources/templates/page/comment.html
| @@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
| 129 | <label for="start_date" class="control-label cb-toolbar">时间:</label> | 129 | <label for="start_date" class="control-label cb-toolbar">时间:</label> |
| 130 | <div class="input-group col-md-9 date"> | 130 | <div class="input-group col-md-9 date"> |
| 131 | <input class="form-control date" name="start_date" type="text" | 131 | <input class="form-control date" name="start_date" type="text" |
| 132 | - id="start_date" th:value="${param.start_date}"> | 132 | + id="start_date" > |
| 133 | <span class="input-group-addon"> | 133 | <span class="input-group-addon"> |
| 134 | <span class="glyphicon glyphicon-calendar"></span> | 134 | <span class="glyphicon glyphicon-calendar"></span> |
| 135 | </span> | 135 | </span> |
| @@ -139,7 +139,7 @@ | @@ -139,7 +139,7 @@ | ||
| 139 | <label for="start_date" class="control-label cb-toolbar">至</label> | 139 | <label for="start_date" class="control-label cb-toolbar">至</label> |
| 140 | <div class="input-group col-md-9 date"> | 140 | <div class="input-group col-md-9 date"> |
| 141 | <input class="form-control date" name="end_date" type="text" | 141 | <input class="form-control date" name="end_date" type="text" |
| 142 | - th:value="${param.end_date}"> | 142 | + id="end_date" > |
| 143 | <span class="input-group-addon"> | 143 | <span class="input-group-addon"> |
| 144 | <span class="glyphicon glyphicon-calendar"></span> | 144 | <span class="glyphicon glyphicon-calendar"></span> |
| 145 | </span> | 145 | </span> |
| @@ -340,7 +340,7 @@ | @@ -340,7 +340,7 @@ | ||
| 340 | <div class="fixed-table-pagination" style="display: block;"> | 340 | <div class="fixed-table-pagination" style="display: block;"> |
| 341 | <div class="pull-left pagination-detail"> | 341 | <div class="pull-left pagination-detail"> |
| 342 | <span class="pagination-info" th:text="'共 '+${commentPage.total}+' 条记录,每页显示'">总共 0 条记录</span> | 342 | <span class="pagination-info" th:text="'共 '+${commentPage.total}+' 条记录,每页显示'">总共 0 条记录</span> |
| 343 | - <select class="" id="pageSize" name="pageSize"> | 343 | + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()"> |
| 344 | <option value="10" th:selected="${pageSize==10}">10</option> | 344 | <option value="10" th:selected="${pageSize==10}">10</option> |
| 345 | <option value="20" th:selected="${pageSize==20}">20</option> | 345 | <option value="20" th:selected="${pageSize==20}">20</option> |
| 346 | <option value="50" th:selected="${pageSize==50}">50</option> | 346 | <option value="50" th:selected="${pageSize==50}">50</option> |
| @@ -440,6 +440,33 @@ | @@ -440,6 +440,33 @@ | ||
| 440 | 440 | ||
| 441 | }) | 441 | }) |
| 442 | 442 | ||
| 443 | + //选择每页数量触发函数 | ||
| 444 | + function selectPageSize(){ | ||
| 445 | + var pageSize=$("#pageSize").val(); | ||
| 446 | + var param = location.search; | ||
| 447 | + if (param.indexOf("pageSize=") != -1) { | ||
| 448 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 449 | + var split = se.split("&"); | ||
| 450 | + var h = ""; | ||
| 451 | + for (var i = 0; i < split.length; i++) { | ||
| 452 | + var s = split[i]; | ||
| 453 | + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 454 | + } | ||
| 455 | + h = h.substring(1, h.length); | ||
| 456 | + window.location.href = "/comments/page?" + h + "&pageSize=" + pageSize; | ||
| 457 | + } else { | ||
| 458 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 459 | + var split = se.split("&"); | ||
| 460 | + var h = ""; | ||
| 461 | + for (var i = 0; i < split.length; i++) { | ||
| 462 | + var s = split[i]; | ||
| 463 | + if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 464 | + } | ||
| 465 | + h = h.substring(1, h.length); | ||
| 466 | + window.location.href = "/comments/page?" + h + "&pageSize=" + pageSize; | ||
| 467 | + } | ||
| 468 | + } | ||
| 469 | + | ||
| 443 | //翻页函数 | 470 | //翻页函数 |
| 444 | function fanye(page) { | 471 | function fanye(page) { |
| 445 | var param = location.search; | 472 | var param = location.search; |
| @@ -451,6 +478,7 @@ | @@ -451,6 +478,7 @@ | ||
| 451 | var s = split[i]; | 478 | var s = split[i]; |
| 452 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | 479 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; |
| 453 | } | 480 | } |
| 481 | + h = h.substring(1, h.length); | ||
| 454 | window.location.href = "/comments/page?" + h + "&page=" + page; | 482 | window.location.href = "/comments/page?" + h + "&page=" + page; |
| 455 | } else { | 483 | } else { |
| 456 | param = param.substring(1, param.length); | 484 | param = param.substring(1, param.length); |
src/main/resources/templates/page/content.html
| @@ -284,7 +284,7 @@ | @@ -284,7 +284,7 @@ | ||
| 284 | <div class="fixed-table-pagination" style="display: block;"> | 284 | <div class="fixed-table-pagination" style="display: block;"> |
| 285 | <div class="pull-left pagination-detail"> | 285 | <div class="pull-left pagination-detail"> |
| 286 | <span class="pagination-info" th:text="'共 '+${contentPage.total}+' 条记录,每页显示'">共 0 条记录</span> | 286 | <span class="pagination-info" th:text="'共 '+${contentPage.total}+' 条记录,每页显示'">共 0 条记录</span> |
| 287 | - <select class="" id="pageSize" name="pageSize"> | 287 | + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()"> |
| 288 | <option value="10" th:selected="${pageSize==10}">10</option> | 288 | <option value="10" th:selected="${pageSize==10}">10</option> |
| 289 | <option value="20" th:selected="${pageSize==20}">20</option> | 289 | <option value="20" th:selected="${pageSize==20}">20</option> |
| 290 | <option value="50" th:selected="${pageSize==50}">50</option> | 290 | <option value="50" th:selected="${pageSize==50}">50</option> |
| @@ -366,12 +366,40 @@ | @@ -366,12 +366,40 @@ | ||
| 366 | var s = split[i]; | 366 | var s = split[i]; |
| 367 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | 367 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; |
| 368 | } | 368 | } |
| 369 | + h = h.substring(1, h.length); | ||
| 369 | window.location.href = "/content/page?" + h + "&page=" + page; | 370 | window.location.href = "/content/page?" + h + "&page=" + page; |
| 370 | } else { | 371 | } else { |
| 371 | param = param.substring(1, param.length); | 372 | param = param.substring(1, param.length); |
| 372 | window.location.href = "/content/page?" + param + "&page=" + page; | 373 | window.location.href = "/content/page?" + param + "&page=" + page; |
| 373 | } | 374 | } |
| 374 | } | 375 | } |
| 376 | + | ||
| 377 | + //选择每页数量触发函数 | ||
| 378 | + function selectPageSize(){ | ||
| 379 | + var pageSize=$("#pageSize").val(); | ||
| 380 | + var param = location.search; | ||
| 381 | + if (param.indexOf("pageSize=") != -1) { | ||
| 382 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 383 | + var split = se.split("&"); | ||
| 384 | + var h = ""; | ||
| 385 | + for (var i = 0; i < split.length; i++) { | ||
| 386 | + var s = split[i]; | ||
| 387 | + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 388 | + } | ||
| 389 | + h = h.substring(1, h.length); | ||
| 390 | + window.location.href = "/content/page?" + h + "&pageSize=" + pageSize; | ||
| 391 | + } else { | ||
| 392 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 393 | + var split = se.split("&"); | ||
| 394 | + var h = ""; | ||
| 395 | + for (var i = 0; i < split.length; i++) { | ||
| 396 | + var s = split[i]; | ||
| 397 | + if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 398 | + } | ||
| 399 | + h = h.substring(1, h.length); | ||
| 400 | + window.location.href = "/content/page?" + h + "&pageSize=" + pageSize; | ||
| 401 | + } | ||
| 402 | + } | ||
| 375 | 403 | ||
| 376 | //导出excel | 404 | //导出excel |
| 377 | function daochu() { | 405 | function daochu() { |
src/main/resources/templates/page/live.html
| @@ -305,7 +305,7 @@ | @@ -305,7 +305,7 @@ | ||
| 305 | <div class="fixed-table-pagination" style="display: block;"> | 305 | <div class="fixed-table-pagination" style="display: block;"> |
| 306 | <div class="pull-left pagination-detail"> | 306 | <div class="pull-left pagination-detail"> |
| 307 | <span class="pagination-info" th:text="'共 '+${livePage.total}+' 条记录,每页显示'">共 0 条记录</span> | 307 | <span class="pagination-info" th:text="'共 '+${livePage.total}+' 条记录,每页显示'">共 0 条记录</span> |
| 308 | - <select class="" id="pageSize" name="pageSize"> | 308 | + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()"> |
| 309 | <option value="20" th:selected="${pageSize==20}">20</option> | 309 | <option value="20" th:selected="${pageSize==20}">20</option> |
| 310 | <option value="40" th:selected="${pageSize==40}">40</option> | 310 | <option value="40" th:selected="${pageSize==40}">40</option> |
| 311 | <option value="60" th:selected="${pageSize==60}">60</option> | 311 | <option value="60" th:selected="${pageSize==60}">60</option> |
| @@ -688,12 +688,40 @@ | @@ -688,12 +688,40 @@ | ||
| 688 | var s = split[i]; | 688 | var s = split[i]; |
| 689 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | 689 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; |
| 690 | } | 690 | } |
| 691 | + h = h.substring(1, h.length); | ||
| 691 | window.location.href = "/live/page?" + h + "&page=" + page; | 692 | window.location.href = "/live/page?" + h + "&page=" + page; |
| 692 | } else { | 693 | } else { |
| 693 | param = param.substring(1, param.length); | 694 | param = param.substring(1, param.length); |
| 694 | window.location.href = "/live/page?" + param + "&page=" + page; | 695 | window.location.href = "/live/page?" + param + "&page=" + page; |
| 695 | } | 696 | } |
| 696 | } | 697 | } |
| 698 | + | ||
| 699 | + //选择每页数量触发函数 | ||
| 700 | + function selectPageSize(){ | ||
| 701 | + var pageSize=$("#pageSize").val(); | ||
| 702 | + var param = location.search; | ||
| 703 | + if (param.indexOf("pageSize=") != -1) { | ||
| 704 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 705 | + var split = se.split("&"); | ||
| 706 | + var h = ""; | ||
| 707 | + for (var i = 0; i < split.length; i++) { | ||
| 708 | + var s = split[i]; | ||
| 709 | + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 710 | + } | ||
| 711 | + h = h.substring(1, h.length); | ||
| 712 | + window.location.href = "/live/page?" + h + "&pageSize=" + pageSize; | ||
| 713 | + } else { | ||
| 714 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 715 | + var split = se.split("&"); | ||
| 716 | + var h = ""; | ||
| 717 | + for (var i = 0; i < split.length; i++) { | ||
| 718 | + var s = split[i]; | ||
| 719 | + if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 720 | + } | ||
| 721 | + h = h.substring(1, h.length); | ||
| 722 | + window.location.href = "/live/page?" + h + "&pageSize=" + pageSize; | ||
| 723 | + } | ||
| 724 | + } | ||
| 697 | 725 | ||
| 698 | 726 | ||
| 699 | 727 |
src/main/resources/templates/page/site.html
| @@ -127,7 +127,7 @@ | @@ -127,7 +127,7 @@ | ||
| 127 | <div class="fixed-table-pagination" style="display: block;"> | 127 | <div class="fixed-table-pagination" style="display: block;"> |
| 128 | <div class="pull-left pagination-detail"> | 128 | <div class="pull-left pagination-detail"> |
| 129 | <span class="pagination-info" th:text="'共 '+${sitePage.total}+' 条记录,每页显示'">共 0 条记录</span> | 129 | <span class="pagination-info" th:text="'共 '+${sitePage.total}+' 条记录,每页显示'">共 0 条记录</span> |
| 130 | - <select class="" id="pageSize" name="pageSize"> | 130 | + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()"> |
| 131 | <option value="10" th:selected="${pageSize==10}">10</option> | 131 | <option value="10" th:selected="${pageSize==10}">10</option> |
| 132 | <option value="20" th:selected="${pageSize==20}">20</option> | 132 | <option value="20" th:selected="${pageSize==20}">20</option> |
| 133 | <option value="50" th:selected="${pageSize==50}">50</option> | 133 | <option value="50" th:selected="${pageSize==50}">50</option> |
| @@ -248,6 +248,7 @@ | @@ -248,6 +248,7 @@ | ||
| 248 | var s = split[i]; | 248 | var s = split[i]; |
| 249 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | 249 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; |
| 250 | } | 250 | } |
| 251 | + h = h.substring(1, h.length); | ||
| 251 | window.location.href = "/sites/page?" + h + "&page=" + page; | 252 | window.location.href = "/sites/page?" + h + "&page=" + page; |
| 252 | } else { | 253 | } else { |
| 253 | param = param.substring(1, param.length); | 254 | param = param.substring(1, param.length); |
| @@ -255,6 +256,33 @@ | @@ -255,6 +256,33 @@ | ||
| 255 | } | 256 | } |
| 256 | } | 257 | } |
| 257 | 258 | ||
| 259 | + //选择每页数量触发函数 | ||
| 260 | + function selectPageSize(){ | ||
| 261 | + var pageSize=$("#pageSize").val(); | ||
| 262 | + var param = location.search; | ||
| 263 | + if (param.indexOf("pageSize=") != -1) { | ||
| 264 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 265 | + var split = se.split("&"); | ||
| 266 | + var h = ""; | ||
| 267 | + for (var i = 0; i < split.length; i++) { | ||
| 268 | + var s = split[i]; | ||
| 269 | + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 270 | + } | ||
| 271 | + h = h.substring(1, h.length); | ||
| 272 | + window.location.href = "/sites/page?" + h + "&pageSize=" + pageSize; | ||
| 273 | + } else { | ||
| 274 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 275 | + var split = se.split("&"); | ||
| 276 | + var h = ""; | ||
| 277 | + for (var i = 0; i < split.length; i++) { | ||
| 278 | + var s = split[i]; | ||
| 279 | + if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 280 | + } | ||
| 281 | + h = h.substring(1, h.length); | ||
| 282 | + window.location.href = "/sites/page?" + h + "&pageSize=" + pageSize; | ||
| 283 | + } | ||
| 284 | + } | ||
| 285 | + | ||
| 258 | //搜索 | 286 | //搜索 |
| 259 | $('#site_query').click(function () { | 287 | $('#site_query').click(function () { |
| 260 | var keyword = $("#keyword").val(); | 288 | var keyword = $("#keyword").val(); |
src/main/resources/templates/page/video.html
| @@ -271,7 +271,7 @@ | @@ -271,7 +271,7 @@ | ||
| 271 | <div class="fixed-table-pagination" style="display: block;"> | 271 | <div class="fixed-table-pagination" style="display: block;"> |
| 272 | <div class="pull-left pagination-detail"> | 272 | <div class="pull-left pagination-detail"> |
| 273 | <span class="pagination-info" th:text="'共 '+${videoPage.total}+' 条记录,每页显示'">共 0 条记录</span> | 273 | <span class="pagination-info" th:text="'共 '+${videoPage.total}+' 条记录,每页显示'">共 0 条记录</span> |
| 274 | - <select class="" id="pageSize" name="pageSize"> | 274 | + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()"> |
| 275 | <option value="10" th:selected="${pageSize==10}">10</option> | 275 | <option value="10" th:selected="${pageSize==10}">10</option> |
| 276 | <option value="20" th:selected="${pageSize==20}">20</option> | 276 | <option value="20" th:selected="${pageSize==20}">20</option> |
| 277 | <option value="50" th:selected="${pageSize==50}">50</option> | 277 | <option value="50" th:selected="${pageSize==50}">50</option> |
| @@ -353,12 +353,40 @@ | @@ -353,12 +353,40 @@ | ||
| 353 | var s = split[i]; | 353 | var s = split[i]; |
| 354 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | 354 | if (s.indexOf("page=") < 0) h = h + "&" + split[i]; |
| 355 | } | 355 | } |
| 356 | + h = h.substring(1, h.length); | ||
| 356 | window.location.href = "/videos/page?" + h + "&page=" + page; | 357 | window.location.href = "/videos/page?" + h + "&page=" + page; |
| 357 | } else { | 358 | } else { |
| 358 | param = param.substring(1, param.length); | 359 | param = param.substring(1, param.length); |
| 359 | window.location.href = "/videos/page?" + param + "&page=" + page; | 360 | window.location.href = "/videos/page?" + param + "&page=" + page; |
| 360 | } | 361 | } |
| 361 | } | 362 | } |
| 363 | + | ||
| 364 | + //选择每页数量触发函数 | ||
| 365 | + function selectPageSize(){ | ||
| 366 | + var pageSize=$("#pageSize").val(); | ||
| 367 | + var param = location.search; | ||
| 368 | + if (param.indexOf("pageSize=") != -1) { | ||
| 369 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 370 | + var split = se.split("&"); | ||
| 371 | + var h = ""; | ||
| 372 | + for (var i = 0; i < split.length; i++) { | ||
| 373 | + var s = split[i]; | ||
| 374 | + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 375 | + } | ||
| 376 | + h = h.substring(1, h.length); | ||
| 377 | + window.location.href = "/videos/page?" + h + "&pageSize=" + pageSize; | ||
| 378 | + } else { | ||
| 379 | + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连 | ||
| 380 | + var split = se.split("&"); | ||
| 381 | + var h = ""; | ||
| 382 | + for (var i = 0; i < split.length; i++) { | ||
| 383 | + var s = split[i]; | ||
| 384 | + if (s.indexOf("page=") < 0) h = h + "&" + split[i]; | ||
| 385 | + } | ||
| 386 | + h = h.substring(1, h.length); | ||
| 387 | + window.location.href = "/videos/page?" + h + "&pageSize=" + pageSize; | ||
| 388 | + } | ||
| 389 | + } | ||
| 362 | 390 | ||
| 363 | //导出excel | 391 | //导出excel |
| 364 | function daochu() { | 392 | function daochu() { |