bi仪表板打分系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

2 years ago
const REGULAR_STRING = {
HTML_STYLE_TAG: '<[^<>]+>',
ENTER: '[\n\r]',
};
Utils = {
htmlDecode: function (text) {
return !text ? "" : (text + "").replaceAll("&amp;|&dollar;|&lcub;|&rcub;|&quot;|&lt;|&gt;|&nbsp;", function (v) {
switch (v) {
case "&amp;":
return "&";
case "&dollar;":
return "$";
case "&lcub;":
return "{";
case "&rcub;":
return "}";
case "&quot;":
return "\"";
case "&lt;":
return "<";
case "&gt;":
return ">";
case "&nbsp;":
default:
return " ";
}
});
},
getPlainText: function (name) {
return Utils.htmlDecode(
name.replace(new RegExp(REGULAR_STRING.HTML_STYLE_TAG, "gm"), '').replace(new RegExp(REGULAR_STRING.ENTER, "gm"), '')
)
}
}