浏览代码

Merge pull request #6298 from wenzhixin/fix/6121

Fix/6121
Dustin Utecht 3 年之前
父节点
当前提交
f1e97c4f12
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 1 1
      src/bootstrap-table.js
  2. 4 1
      src/extensions/filter-control/bootstrap-table-filter-control.js

+ 1 - 1
src/bootstrap-table.js

@@ -210,7 +210,7 @@ class BootstrapTable {
 
 
     this.options.columns.forEach((columns, i) => {
     this.options.columns.forEach((columns, i) => {
       columns.forEach((_column, j) => {
       columns.forEach((_column, j) => {
-        const column = $.extend({}, BootstrapTable.COLUMN_DEFAULTS, _column)
+        const column = $.extend({}, BootstrapTable.COLUMN_DEFAULTS, _column, { passed: _column })
 
 
         if (typeof column.fieldIndex !== 'undefined') {
         if (typeof column.fieldIndex !== 'undefined') {
           this.columns[column.fieldIndex] = column
           this.columns[column.fieldIndex] = column

+ 4 - 1
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -290,7 +290,10 @@ $.BootstrapTable = class extends $.BootstrapTable {
   isValueExpected (searchValue, value, column, key) {
   isValueExpected (searchValue, value, column, key) {
     let tmpItemIsExpected = false
     let tmpItemIsExpected = false
 
 
-    if (column.filterStrictSearch) {
+    if (
+      column.filterStrictSearch ||
+      (column.filterControl === 'select' && column.passed.filterStrictSearch !== false)
+    ) {
       tmpItemIsExpected = value.toString().toLowerCase() === searchValue.toString().toLowerCase()
       tmpItemIsExpected = value.toString().toLowerCase() === searchValue.toString().toLowerCase()
     } else if (column.filterStartsWithSearch) {
     } else if (column.filterStartsWithSearch) {
       tmpItemIsExpected = (`${value}`).toLowerCase().indexOf(searchValue) === 0
       tmpItemIsExpected = (`${value}`).toLowerCase().indexOf(searchValue) === 0