Browse Source

Merge pull request #1135 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '3d250211d713d6bec7e08fe130f127df239c89dc':
  BI-50878 refactor: BI和物料库中都是用的getGBWidth放到fineui
es6
windy 5 years ago
parent
commit
be6fdd0189
  1. 12
      src/core/func/function.js

12
src/core/func/function.js

@ -23,6 +23,18 @@ _.extend(BI.Func, {
} }
return name; return name;
}, },
/**
* 获取字符宽度
* @param str
* @return {number}
*/
getGBWidth: function (str) {
str = str + "";
str = str.replace(/[^\x00-\xff]/g, "xx");
return Math.ceil(str.length / 2);
},
/** /**
* 获取搜索结果 * 获取搜索结果
* @param items * @param items

Loading…
Cancel
Save