新增搜索数量提示

修复重置SelectPage不生效的问题
修改搜索文字
pull/437/MERGE
Karson 2023-04-17 12:06:25 +08:00
parent c9ef6b9780
commit e4cb165c35
2 changed files with 31 additions and 5 deletions

View File

@ -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('<div class="columns-%s pull-%s" style="margin-top:10px;margin-bottom:10px;">', this.options.buttonsAlign, this.options.buttonsAlign));
html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="commonSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatCommonSearch()));
html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.commonSearchIcon))
html.push(sprintf('<button class="btn btn-default btn-commonsearch %s' + '" type="button" name="commonSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatCommonSearch()));
if (that.options.searchCountTips) {
html.push(sprintf('<span class="label label-danger hidden">0</span>'));
}
html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.commonSearchIcon));
html.push('</button></div>');
}
if (that.$toolbar.find(".pull-right").length > 0) {

View File

@ -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,