Browse Source

Revert "JSY-26063 fix: 前端搜索支持配置大小写敏感"

This reverts commit bb7905bf0f.
research/test
Renzo 2 years ago
parent
commit
fc54af70a7
  1. 6
      src/core/func/function.js
  2. 3
      typescript/core/func/function.ts

6
src/core/func/function.js

@ -40,13 +40,11 @@ BI._.extend(BI.Func, {
* @param items
* @param keyword
* @param param 搜索哪个属性
* @param opt 额外配置caseSensitive: 大小写敏感
*/
getSearchResult: function (items, keyword, param, opt) {
getSearchResult: function (items, keyword, param) {
var isArray = BI.isArray(items);
items = isArray ? BI.flatten(items) : items;
param || (param = "text");
opt || (opt = {caseSensitive: false});
if (!BI.isKey(keyword)) {
return {
find: items,
@ -71,10 +69,8 @@ BI._.extend(BI.Func, {
py = BI.makeFirstPY(text, {
splitChar: "\u200b"
});
if (!opt.caseSensitive) {
text = BI.toUpperCase(text);
py = BI.toUpperCase(py);
}
var pidx;
if (text.indexOf(keyword) > -1) {
if (text === keyword) {

3
typescript/core/func/function.ts

@ -13,9 +13,8 @@ export type _function = {
* @param items
* @param keyword
* @param param
* @param opt caseSensitive: 大小写敏感
*/
getSearchResult: (items: any, keyword: any, param?: string, opt?: {caseSensitive: boolean}) => { find: any[], match: any[] };
getSearchResult: (items: any, keyword: any, param?: string) => { find: any[], match: any[] };
/**
* url

Loading…
Cancel
Save