From eb74366381a842c8f7992cbeebe69f83e0b8d0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=98=E4=BF=97=E4=BA=8C=E5=B8=88=E5=85=84?= <505097558@qq.com> Date: Tue, 26 May 2026 01:58:53 +0000 Subject: [PATCH] =?UTF-8?q?update=20public/assets/js/bootstrap-table-commo?= =?UTF-8?q?nsearch.js.=20=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BB=A5=E5=8F=8A=E9=BB=98=E8=AE=A4=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 还俗二师兄 <505097558@qq.com> --- public/assets/js/bootstrap-table-commonsearch.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js index 094906db..7a7d02d9 100644 --- a/public/assets/js/bootstrap-table-commonsearch.js +++ b/public/assets/js/bootstrap-table-commonsearch.js @@ -294,7 +294,7 @@ var isAjax = typeof list === 'object' && typeof list.then === 'function'; if (isFunction) { list = list(); - } else if (isAjax) { + } else if (isAjax && vObjCol) { $.when(list).done(function (ret) { // 兼容旧版本在data中返回searchlist if (typeof ret.data.searchlist !== 'undefined') { @@ -306,10 +306,12 @@ $.each(list, function (key, val) { if (typeof val !== 'undefined' && val.constructor === Object) { key = val.id; - val = val[vObjCol.nameKey || 'name']; + vObjCol.nameKey = typeof vObjCol.nameKey === 'undefined' ? 'name' : vObjCol.nameKey + val = val[vObjCol.nameKey]; } else { key = isArray ? val : key; } + vObjCol.defaultValue = typeof vObjCol.defaultValue === 'undefined' ? '' : vObjCol.defaultValue optionList.push(sprintf("", key == vObjCol.defaultValue && vObjCol.defaultValue !='' ? 'selected' : '')); }); $("form.form-commonsearch select[name='" + vObjCol.field + "']", that.$container).append(optionList.join('')).trigger("change");