From c032bed1faaac88013936e42715fa9fb0f75c577 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 5 Apr 2017 11:18:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/core.js | 77 --------------------------------------- dist/core.js | 77 --------------------------------------- src/core/func/function.js | 77 --------------------------------------- 3 files changed, 231 deletions(-) diff --git a/bi/core.js b/bi/core.js index 87caeb5115..34724f77bb 100644 --- a/bi/core.js +++ b/bi/core.js @@ -16931,23 +16931,6 @@ $(function () { BI.Func = {}; var formulas = {}; BI.extend(BI.Func, { - /** - * 创建唯一的名字 - * @param array - * @param name - * @returns {*} - */ - createDistinctName: function (array, name) { - var src = name, idx = 1; - name = name || ""; - while (true) { - if (!ArrayUtils.getItemByName(array, name)) { - break; - } - name = src + (idx++); - } - return name; - }, /** * 获取搜索结果 @@ -16995,60 +16978,6 @@ $(function () { finded: finded } }, - - /** - * 公式合法性验证 - */ - checkFormulaValidation: function (str) { - if (!BI.isEmptyString(str)) { - if (BI.has(formulas, str)) { - return formulas[str]; - } - formulas[str] = false; - var response = BI.requestSync("fr_bi_base", "check_validation_of_expression", {expression: str}); - if (response.validation === "invalid") { - formulas[str] = false; - } else if (response.validation === "valid") { - formulas[str] = true; - } - return formulas[str]; - } else { - return true; - } - }, - - getFormulaStringFromFormulaValue: function (formulaValue) { - var formulaString = ""; - var regx = /\$[\{][^\}]*[\}]|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)/g; - var result = formulaValue.match(regx); - BI.each(result, function (i, item) { - var fieldRegx = /\$[\{][^\}]*[\}]/; - var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { - formulaString = formulaString + str[0].substring(2, item.length - 1); - } else { - formulaString = formulaString + item; - } - }); - return formulaString; - }, - - formatAddress: function (address) { - var temp = ''; - var url1 = /[a-zA-z]+:\/\/[^\s]*/; - var url2 = /\/[^\s]*/; - if (address.match(url1) || address.match(url2)) { - temp = address; - } else if (BI.isNotEmptyString(address)) { - temp = "http://" + address; - } - return temp; - }, - - getCompleteImageUrl: function (url) { - return BI.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + url; - } - }); /** @@ -17101,12 +17030,6 @@ $(function () { }); }, - getImageWidthAndHeight: function (src) { - return BI.requestSync("fr_bi_base", "get_image_size", { - src: src - }); - }, - isDarkColor: function (hex) { if (!hex) { return false; diff --git a/dist/core.js b/dist/core.js index 2c41386b7d..de470e664f 100644 --- a/dist/core.js +++ b/dist/core.js @@ -22555,23 +22555,6 @@ $(function () { BI.Func = {}; var formulas = {}; BI.extend(BI.Func, { - /** - * 创建唯一的名字 - * @param array - * @param name - * @returns {*} - */ - createDistinctName: function (array, name) { - var src = name, idx = 1; - name = name || ""; - while (true) { - if (!ArrayUtils.getItemByName(array, name)) { - break; - } - name = src + (idx++); - } - return name; - }, /** * 获取搜索结果 @@ -22619,60 +22602,6 @@ $(function () { finded: finded } }, - - /** - * 公式合法性验证 - */ - checkFormulaValidation: function (str) { - if (!BI.isEmptyString(str)) { - if (BI.has(formulas, str)) { - return formulas[str]; - } - formulas[str] = false; - var response = BI.requestSync("fr_bi_base", "check_validation_of_expression", {expression: str}); - if (response.validation === "invalid") { - formulas[str] = false; - } else if (response.validation === "valid") { - formulas[str] = true; - } - return formulas[str]; - } else { - return true; - } - }, - - getFormulaStringFromFormulaValue: function (formulaValue) { - var formulaString = ""; - var regx = /\$[\{][^\}]*[\}]|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)/g; - var result = formulaValue.match(regx); - BI.each(result, function (i, item) { - var fieldRegx = /\$[\{][^\}]*[\}]/; - var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { - formulaString = formulaString + str[0].substring(2, item.length - 1); - } else { - formulaString = formulaString + item; - } - }); - return formulaString; - }, - - formatAddress: function (address) { - var temp = ''; - var url1 = /[a-zA-z]+:\/\/[^\s]*/; - var url2 = /\/[^\s]*/; - if (address.match(url1) || address.match(url2)) { - temp = address; - } else if (BI.isNotEmptyString(address)) { - temp = "http://" + address; - } - return temp; - }, - - getCompleteImageUrl: function (url) { - return BI.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + url; - } - }); /** @@ -22725,12 +22654,6 @@ $(function () { }); }, - getImageWidthAndHeight: function (src) { - return BI.requestSync("fr_bi_base", "get_image_size", { - src: src - }); - }, - isDarkColor: function (hex) { if (!hex) { return false; diff --git a/src/core/func/function.js b/src/core/func/function.js index 8e2256a93b..aa594e3a82 100644 --- a/src/core/func/function.js +++ b/src/core/func/function.js @@ -6,23 +6,6 @@ $(function () { BI.Func = {}; var formulas = {}; BI.extend(BI.Func, { - /** - * 创建唯一的名字 - * @param array - * @param name - * @returns {*} - */ - createDistinctName: function (array, name) { - var src = name, idx = 1; - name = name || ""; - while (true) { - if (!ArrayUtils.getItemByName(array, name)) { - break; - } - name = src + (idx++); - } - return name; - }, /** * 获取搜索结果 @@ -70,60 +53,6 @@ $(function () { finded: finded } }, - - /** - * 公式合法性验证 - */ - checkFormulaValidation: function (str) { - if (!BI.isEmptyString(str)) { - if (BI.has(formulas, str)) { - return formulas[str]; - } - formulas[str] = false; - var response = BI.requestSync("fr_bi_base", "check_validation_of_expression", {expression: str}); - if (response.validation === "invalid") { - formulas[str] = false; - } else if (response.validation === "valid") { - formulas[str] = true; - } - return formulas[str]; - } else { - return true; - } - }, - - getFormulaStringFromFormulaValue: function (formulaValue) { - var formulaString = ""; - var regx = /\$[\{][^\}]*[\}]|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)/g; - var result = formulaValue.match(regx); - BI.each(result, function (i, item) { - var fieldRegx = /\$[\{][^\}]*[\}]/; - var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { - formulaString = formulaString + str[0].substring(2, item.length - 1); - } else { - formulaString = formulaString + item; - } - }); - return formulaString; - }, - - formatAddress: function (address) { - var temp = ''; - var url1 = /[a-zA-z]+:\/\/[^\s]*/; - var url2 = /\/[^\s]*/; - if (address.match(url1) || address.match(url2)) { - temp = address; - } else if (BI.isNotEmptyString(address)) { - temp = "http://" + address; - } - return temp; - }, - - getCompleteImageUrl: function (url) { - return BI.servletURL + "?op=fr_bi&cmd=get_uploaded_image&image_id=" + url; - } - }); /** @@ -176,12 +105,6 @@ $(function () { }); }, - getImageWidthAndHeight: function (src) { - return BI.requestSync("fr_bi_base", "get_image_size", { - src: src - }); - }, - isDarkColor: function (hex) { if (!hex) { return false;