From e4cb165c3551e412d40136e70bcc837f41d71094 Mon Sep 17 00:00:00 2001 From: Karson Date: Mon, 17 Apr 2023 12:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复重置SelectPage不生效的问题 修改搜索文字 --- .../assets/js/bootstrap-table-commonsearch.js | 24 +++++++++++++++---- public/assets/less/backend.less | 12 ++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js index 6a6fe270..8091961c 100644 --- a/public/assets/js/bootstrap-table-commonsearch.js +++ b/public/assets/js/bootstrap-table-commonsearch.js @@ -43,7 +43,7 @@ setTimeout(function () { that.onCommonSearch(); - }, 0); + }, 10); }); }; @@ -208,13 +208,23 @@ } else { value = process ? process(obj.val()) : obj.val(); } - if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) { + if (removeempty && (value === '' || value == null || ($.isArray(value) && value.length === 0)) && !sym.match(/null/i)) { return true; } op[name] = sym; filter[name] = value; }); + if (that.options.searchCountTips) { + var count = 0; + $.each(filter, function (key, value) { + if ((value === '' || value == null || ($.isArray(value) && value.length === 0))) { + return true; + } + count++; + }); + that.$toolbar.find(".btn-commonsearch > span").text(count).toggleClass("hidden", count === 0); + } return {op: op, filter: filter}; }; @@ -244,6 +254,7 @@ actionForm: "", searchFormTemplate: "", searchFormVisible: true, + searchCountTips: true, searchClass: 'searchit', showSearch: true, renderDefault: true, @@ -268,7 +279,7 @@ return "Common search"; }, formatCommonSubmitButton: function () { - return "Submit"; + return "Search"; }, formatCommonResetButton: function () { return "Reset"; @@ -311,8 +322,11 @@ html = []; if (that.options.showSearch) { html.push(sprintf('
', this.options.buttonsAlign, this.options.buttonsAlign)); - html.push(sprintf('
'); } if (that.$toolbar.find(".pull-right").length > 0) { diff --git a/public/assets/less/backend.less b/public/assets/less/backend.less index e3c30256..5371f922 100755 --- a/public/assets/less/backend.less +++ b/public/assets/less/backend.less @@ -979,6 +979,18 @@ form.form-horizontal .control-label { } } +.bootstrap-table { + .btn-commonsearch { + position: relative; + + > span { + position: absolute; + top: -10px; + right: -10px; + } + } +} + .bootstrap-table .table:not(.table-condensed) > tbody > tr > th, .bootstrap-table .table:not(.table-condensed) > tfoot > tr > th, .bootstrap-table .table:not(.table-condensed) > thead > tr > td,