Browse Source

BI-50878 refactor: BI和物料库中都是用的getGBWidth放到fineui

es6
windy 5 years ago
parent
commit
3d250211d7
  1. 12
      src/core/func/function.js

12
src/core/func/function.js

@ -23,6 +23,18 @@ _.extend(BI.Func, {
}
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

Loading…
Cancel
Save