From 966788397ee3caabc3d0be65c5ca879248a20e17 Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 4 Jun 2019 17:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1,=E5=90=A7BI.get?= =?UTF-8?q?EncodeURL=E6=96=B9=E6=B3=95=E5=86=85=E7=BD=AE=E5=88=B0FineUI?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/2.0/fineui.ie.js | 32 +++++++++++++++----------- dist/2.0/fineui.js | 32 +++++++++++++++----------- dist/base.js | 14 +++-------- dist/bundle.ie.js | 32 +++++++++++++++----------- dist/bundle.js | 32 +++++++++++++++----------- dist/case.js | 2 +- dist/core.js | 15 ++++++++++++ dist/fineui.ie.js | 32 +++++++++++++++----------- dist/fineui.js | 32 +++++++++++++++----------- dist/fineui_without_jquery_polyfill.js | 32 +++++++++++++++----------- dist/utils.js | 15 ++++++++++++ dist/widget.js | 6 ++--- src/core/alias.js | 15 ++++++++++++ 13 files changed, 185 insertions(+), 106 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index 6dac43fab..4465af406 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -15861,6 +15861,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -16116,6 +16117,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; @@ -46997,15 +47012,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, @@ -51839,7 +51845,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, @@ -65839,7 +65845,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -82047,7 +82053,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -83087,7 +83093,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 05187661c..d0b8cf0ba 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -15861,6 +15861,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -16116,6 +16117,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; @@ -47401,15 +47416,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, @@ -52243,7 +52249,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, @@ -66243,7 +66249,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -82451,7 +82457,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -83491,7 +83497,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/dist/base.js b/dist/base.js index 348512dcc..915e7d44b 100644 --- a/dist/base.js +++ b/dist/base.js @@ -612,7 +612,7 @@ BI.Text = BI.inherit(BI.Single, { this.setText(o.value); } if (BI.isKey(o.keyword)) { - this.text.element.__textKeywordMarked__(text, o.keyword, o.py); + this.doRedMark(o.keyword); } if (o.highLight) { this.doHighLight(); @@ -674,7 +674,8 @@ BI.Text = BI.inherit(BI.Single, { } }); -BI.shortcut("bi.text", BI.Text);/** +BI.shortcut("bi.text", BI.Text); +/** * guy * @class BI.BasicButton * @extends BI.Single @@ -11524,15 +11525,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 6dac43fab..4465af406 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -15861,6 +15861,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -16116,6 +16117,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; @@ -46997,15 +47012,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, @@ -51839,7 +51845,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, @@ -65839,7 +65845,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -82047,7 +82053,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -83087,7 +83093,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/dist/bundle.js b/dist/bundle.js index 05187661c..d0b8cf0ba 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -15861,6 +15861,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -16116,6 +16117,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; @@ -47401,15 +47416,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, @@ -52243,7 +52249,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, @@ -66243,7 +66249,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -82451,7 +82457,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -83491,7 +83497,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/dist/case.js b/dist/case.js index f7cdf4c02..91ece2ec6 100644 --- a/dist/case.js +++ b/dist/case.js @@ -1948,7 +1948,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, diff --git a/dist/core.js b/dist/core.js index 9ac7b964f..7469665c8 100644 --- a/dist/core.js +++ b/dist/core.js @@ -15861,6 +15861,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -16116,6 +16117,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 219de80f3..a6e7f542d 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -16106,6 +16106,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -16361,6 +16362,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; @@ -47242,15 +47257,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, @@ -52084,7 +52090,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, @@ -66084,7 +66090,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -82292,7 +82298,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -83332,7 +83338,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/dist/fineui.js b/dist/fineui.js index f1405360b..a27f56189 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -16106,6 +16106,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -16361,6 +16362,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; @@ -47646,15 +47661,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, @@ -52488,7 +52494,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, @@ -66488,7 +66494,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -82696,7 +82702,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -83736,7 +83742,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 9c50cb6b0..ed324ebee 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -15607,6 +15607,7 @@ BI.ShowAction = BI.inherit(BI.Action, { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -15862,6 +15863,20 @@ BI.ShowAction = BI.inherit(BI.Action, { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; @@ -34217,15 +34232,6 @@ BI.Label = BI.inherit(BI.Single, { }); }, - _setEnable: function (enable) { - BI.Label.superclass._setEnable.apply(this, arguments); - if (enable === true) { - this.element.removeClass("base-disabled disabled"); - } else if (enable === false) { - this.element.addClass("base-disabled disabled"); - } - }, - doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, @@ -36716,7 +36722,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return BI.extend(td, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "normal", once: false, @@ -48897,7 +48903,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -65105,7 +65111,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -66145,7 +66151,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/dist/utils.js b/dist/utils.js index 2e507cd80..82e66d7f5 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -12826,6 +12826,7 @@ if (!_global.BI) { return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -13081,6 +13082,20 @@ if (!_global.BI) { })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || ""; diff --git a/dist/widget.js b/dist/widget.js index e796f5c84..b679342c3 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -6027,7 +6027,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -22235,7 +22235,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear return BI.map(item, function (j, td) { return { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, @@ -23275,7 +23275,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static return BI.map(items, function (j, item) { return BI.extend(item, { type: "bi.text_item", - cls: "bi-list-item-active", + cls: "bi-list-item-select", textAlign: "center", whiteSpace: "nowrap", once: false, diff --git a/src/core/alias.js b/src/core/alias.js index 151fa8cb3..f2c7fb205 100644 --- a/src/core/alias.js +++ b/src/core/alias.js @@ -353,6 +353,7 @@ return left; } + BI.cjkEncode = function (text) { // alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的) if (typeof text !== "string") { @@ -608,6 +609,20 @@ })(jo); }; + /** + * 获取编码后的url + * @param urlTemplate url模板 + * @param param 参数 + * @returns {*|String} + * @example + * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a + */ + BI.getEncodeURL = function (urlTemplate, param) { + return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); + }); + }; + BI.encodeURIComponent = function (url) { BI.specialCharsMap = BI.specialCharsMap || {}; url = url || "";