From b65452c7c33c5229a4166516d501056e345b0253 Mon Sep 17 00:00:00 2001 From: Karson Date: Sat, 30 Jun 2018 16:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=94=A8=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=9C=A8=E5=90=AF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=97=B6=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/lang/zh-cn.php | 2 ++ public/assets/js/bootstrap-table-commonsearch.js | 11 ++++++----- public/assets/js/require-backend.min.js | 11 ++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php index a8f57cc8..e64084ba 100755 --- a/application/admin/lang/zh-cn.php +++ b/application/admin/lang/zh-cn.php @@ -95,6 +95,8 @@ return [ 'Flag' => '标志', 'Drag to sort' => '拖动进行排序', 'Redirect now' => '立即跳转', + 'Key' => '键', + 'Value' => '值', 'Common search' => '普通搜索', 'Search %s' => '搜索 %s', 'View %s' => '查看 %s', diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js index a4dd0a71..90242bb6 100644 --- a/public/assets/js/bootstrap-table-commonsearch.js +++ b/public/assets/js/bootstrap-table-commonsearch.js @@ -178,14 +178,15 @@ if (obj.size() == 0) return true; var vObjCol = ColumnsForSearch[i]; + var process = !that.options.searchFormTemplate && vObjCol && typeof vObjCol.process == 'function' ? vObjCol.process : null; if (obj.size() > 1) { if (/BETWEEN$/.test(sym)) { var value_begin = $.trim($("[name='" + name + "']:first", that.$commonsearch).val()), value_end = $.trim($("[name='" + name + "']:last", that.$commonsearch).val()); if (value_begin.length || value_end.length) { - if (typeof vObjCol.process === 'function') { - value_begin = vObjCol.process(value_begin, 'begin'); - value_end = vObjCol.process(value_end, 'end'); + if (process) { + value_begin = process(value_begin, 'begin'); + value_end = process(value_end, 'end'); } value = value_begin + ',' + value_end; } else { @@ -197,10 +198,10 @@ } } else { value = $("[name='" + name + "']:checked", that.$commonsearch).val(); - value = (vObjCol && typeof vObjCol.process === 'function') ? vObjCol.process(value) : value; + value = process ? process(value) : value; } } else { - value = (vObjCol && typeof vObjCol.process === 'function') ? vObjCol.process(obj.val()) : obj.val(); + value = process ? process(obj.val()) : obj.val(); } if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) { return true; diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js index 28053db7..4d62c078 100644 --- a/public/assets/js/require-backend.min.js +++ b/public/assets/js/require-backend.min.js @@ -9068,14 +9068,15 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef if (obj.size() == 0) return true; var vObjCol = ColumnsForSearch[i]; + var process = !that.options.searchFormTemplate && vObjCol && typeof vObjCol.process == 'function' ? vObjCol.process : null; if (obj.size() > 1) { if (/BETWEEN$/.test(sym)) { var value_begin = $.trim($("[name='" + name + "']:first", that.$commonsearch).val()), value_end = $.trim($("[name='" + name + "']:last", that.$commonsearch).val()); if (value_begin.length || value_end.length) { - if (typeof vObjCol.process === 'function') { - value_begin = vObjCol.process(value_begin, 'begin'); - value_end = vObjCol.process(value_end, 'end'); + if (process) { + value_begin = process(value_begin, 'begin'); + value_end = process(value_end, 'end'); } value = value_begin + ',' + value_end; } else { @@ -9087,10 +9088,10 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef } } else { value = $("[name='" + name + "']:checked", that.$commonsearch).val(); - value = (vObjCol && typeof vObjCol.process === 'function') ? vObjCol.process(value) : value; + value = process ? process(value) : value; } } else { - value = (vObjCol && typeof vObjCol.process === 'function') ? vObjCol.process(obj.val()) : obj.val(); + value = process ? process(obj.val()) : obj.val(); } if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) { return true;