diff --git a/bi/base.js b/bi/base.js index 277706be2..1aee93a59 100644 --- a/bi/base.js +++ b/bi/base.js @@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, { setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; - this.text.element.html((text + "").replaceAll(" ", " ")); + this.text.element.html(BI.Func.formatSpecialCharInHtml(text)); } }); @@ -30515,6 +30515,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, { this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + this.topLeftGrid.setColumnCount(freezeColLength); + this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + this.bottomLeftGrid.setColumnCount(freezeColLength); + this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + var items = this.contextLayout.attr("items"); items[1].left = regionSize; items[2].top = this._getFreezeHeaderHeight(); diff --git a/bi/case.js b/bi/case.js index 8322524ba..43167282c 100644 --- a/bi/case.js +++ b/bi/case.js @@ -7555,7 +7555,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, { BI.createWidget({ type: 'bi.right_vertical_adapt', element: south, - hgap: 5, + lgap: 10, items: [this.cancel, this.sure] }); }, diff --git a/bi/core.js b/bi/core.js index 63b17fcd5..d7bcab9a5 100644 --- a/bi/core.js +++ b/bi/core.js @@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, { */ __textKeywordMarked__: function (text, keyword, py) { if (!BI.isKey(keyword) || (text + "").length > 100) { - return this.html((text + "").replaceAll(" ", " ")); + return this.html(BI.Func.formatSpecialCharInHtml(text)); } keyword = keyword + ""; keyword = BI.toUpperCase(keyword); @@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, { if (tidx >= 0) { this.append(textLeft.substr(0, tidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(tidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length)))); textLeft = textLeft.substr(tidx + keyword.length); if (py != null) { @@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, { } else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) { this.append(textLeft.substr(0, pidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(pidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length)))); if (py != null) { py = py.substr(pidx + keyword.length); } @@ -19915,6 +19915,27 @@ BI.extend(BI.Func, { matched: matched, finded: finded } + }, + + /** + * 将字符串中的尖括号等字符encode成html能解析的形式 + * @param str + */ + formatSpecialCharInHtml: function (str) { + return (str + "").replaceAll("\\s|<=?|>=?", function (str) { + switch (str) { + case "<": + return "<"; + case "<=": + return "≤"; + case ">": + return ">"; + case ">=": + return "≥"; + default: + return " "; + } + }); } }); diff --git a/bi/widget.js b/bi/widget.js index 2c0271975..383509ac3 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -7364,6 +7364,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { this.textButton.setEnable(false); } }, + + _checkValueValid: function (value) { + return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value); + }, + setValue: function (v) { this.storeValue = v; var self = this, date; @@ -7419,7 +7424,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { self._setInnerValue(this.day); break; default: - if (BI.isNull(value) || BI.isEmptyObject(value)) { + if (!this._checkValueValid(value)) { var date = new Date(); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.ymd.setValue({ @@ -11836,7 +11841,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { element: this, items: [{ el: this.searcher, - height: 30 + height: 24 }, { el: this.adapter, height: "fill" @@ -18500,9 +18505,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, { allowBlank: false, validationChecker: function (v) { return self._checkValidation(v); - }, - quitChecker: function (v) { - return self._checkValidation(v); } }); this.label.element.hover(function () { diff --git a/demo/js/widget/slider/demo.slider.js b/demo/js/widget/slider/demo.slider.js index 231904469..b2d5224cd 100644 --- a/demo/js/widget/slider/demo.slider.js +++ b/demo/js/widget/slider/demo.slider.js @@ -62,6 +62,7 @@ Demo.Slider = BI.inherit(BI.Widget, { var intervalSlider = BI.createWidget({ type: "bi.interval_slider", width: o.width, + digit: 0, cls: "layout-bg-white" }); intervalSlider.setMinAndMax({ diff --git a/dist/base.js b/dist/base.js index 277706be2..1aee93a59 100644 --- a/dist/base.js +++ b/dist/base.js @@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, { setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; - this.text.element.html((text + "").replaceAll(" ", " ")); + this.text.element.html(BI.Func.formatSpecialCharInHtml(text)); } }); @@ -30515,6 +30515,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, { this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + this.topLeftGrid.setColumnCount(freezeColLength); + this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + this.bottomLeftGrid.setColumnCount(freezeColLength); + this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + var items = this.contextLayout.attr("items"); items[1].left = regionSize; items[2].top = this._getFreezeHeaderHeight(); diff --git a/dist/bundle.js b/dist/bundle.js index 28efbce0c..efac72270 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, { */ __textKeywordMarked__: function (text, keyword, py) { if (!BI.isKey(keyword) || (text + "").length > 100) { - return this.html((text + "").replaceAll(" ", " ")); + return this.html(BI.Func.formatSpecialCharInHtml(text)); } keyword = keyword + ""; keyword = BI.toUpperCase(keyword); @@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, { if (tidx >= 0) { this.append(textLeft.substr(0, tidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(tidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length)))); textLeft = textLeft.substr(tidx + keyword.length); if (py != null) { @@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, { } else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) { this.append(textLeft.substr(0, pidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(pidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length)))); if (py != null) { py = py.substr(pidx + keyword.length); } @@ -19915,6 +19915,27 @@ BI.extend(BI.Func, { matched: matched, finded: finded } + }, + + /** + * 将字符串中的尖括号等字符encode成html能解析的形式 + * @param str + */ + formatSpecialCharInHtml: function (str) { + return (str + "").replaceAll("\\s|<=?|>=?", function (str) { + switch (str) { + case "<": + return "<"; + case "<=": + return "≤"; + case ">": + return ">"; + case ">=": + return "≥"; + default: + return " "; + } + }); } }); @@ -26435,7 +26456,7 @@ BI.Text = BI.inherit(BI.Single, { setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; - this.text.element.html((text + "").replaceAll(" ", " ")); + this.text.element.html(BI.Func.formatSpecialCharInHtml(text)); } }); @@ -56369,6 +56390,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, { this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + this.topLeftGrid.setColumnCount(freezeColLength); + this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + this.bottomLeftGrid.setColumnCount(freezeColLength); + this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + var items = this.contextLayout.attr("items"); items[1].left = regionSize; items[2].top = this._getFreezeHeaderHeight(); @@ -68991,7 +69017,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, { BI.createWidget({ type: 'bi.right_vertical_adapt', element: south, - hgap: 5, + lgap: 10, items: [this.cancel, this.sure] }); }, @@ -82567,6 +82593,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { this.textButton.setEnable(false); } }, + + _checkValueValid: function (value) { + return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value); + }, + setValue: function (v) { this.storeValue = v; var self = this, date; @@ -82622,7 +82653,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { self._setInnerValue(this.day); break; default: - if (BI.isNull(value) || BI.isEmptyObject(value)) { + if (!this._checkValueValid(value)) { var date = new Date(); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.ymd.setValue({ @@ -87039,7 +87070,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { element: this, items: [{ el: this.searcher, - height: 30 + height: 24 }, { el: this.adapter, height: "fill" @@ -93703,9 +93734,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, { allowBlank: false, validationChecker: function (v) { return self._checkValidation(v); - }, - quitChecker: function (v) { - return self._checkValidation(v); } }); this.label.element.hover(function () { diff --git a/dist/case.js b/dist/case.js index 8322524ba..43167282c 100644 --- a/dist/case.js +++ b/dist/case.js @@ -7555,7 +7555,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, { BI.createWidget({ type: 'bi.right_vertical_adapt', element: south, - hgap: 5, + lgap: 10, items: [this.cancel, this.sure] }); }, diff --git a/dist/core.js b/dist/core.js index 9c19934cd..994bcde92 100644 --- a/dist/core.js +++ b/dist/core.js @@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, { */ __textKeywordMarked__: function (text, keyword, py) { if (!BI.isKey(keyword) || (text + "").length > 100) { - return this.html((text + "").replaceAll(" ", " ")); + return this.html(BI.Func.formatSpecialCharInHtml(text)); } keyword = keyword + ""; keyword = BI.toUpperCase(keyword); @@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, { if (tidx >= 0) { this.append(textLeft.substr(0, tidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(tidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length)))); textLeft = textLeft.substr(tidx + keyword.length); if (py != null) { @@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, { } else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) { this.append(textLeft.substr(0, pidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(pidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length)))); if (py != null) { py = py.substr(pidx + keyword.length); } @@ -19915,6 +19915,27 @@ BI.extend(BI.Func, { matched: matched, finded: finded } + }, + + /** + * 将字符串中的尖括号等字符encode成html能解析的形式 + * @param str + */ + formatSpecialCharInHtml: function (str) { + return (str + "").replaceAll("\\s|<=?|>=?", function (str) { + switch (str) { + case "<": + return "<"; + case "<=": + return "≤"; + case ">": + return ">"; + case ">=": + return "≥"; + default: + return " "; + } + }); } }); diff --git a/dist/demo.js b/dist/demo.js index 10e944d1a..8fff39d74 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -13216,6 +13216,7 @@ Demo.Slider = BI.inherit(BI.Widget, { var intervalSlider = BI.createWidget({ type: "bi.interval_slider", width: o.width, + digit: 0, cls: "layout-bg-white" }); intervalSlider.setMinAndMax({ diff --git a/dist/widget.js b/dist/widget.js index 2c0271975..383509ac3 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -7364,6 +7364,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { this.textButton.setEnable(false); } }, + + _checkValueValid: function (value) { + return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value); + }, + setValue: function (v) { this.storeValue = v; var self = this, date; @@ -7419,7 +7424,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { self._setInnerValue(this.day); break; default: - if (BI.isNull(value) || BI.isEmptyObject(value)) { + if (!this._checkValueValid(value)) { var date = new Date(); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.ymd.setValue({ @@ -11836,7 +11841,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { element: this, items: [{ el: this.searcher, - height: 30 + height: 24 }, { el: this.adapter, height: "fill" @@ -18500,9 +18505,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, { allowBlank: false, validationChecker: function (v) { return self._checkValidation(v); - }, - quitChecker: function (v) { - return self._checkValidation(v); } }); this.label.element.hover(function () { diff --git a/src/base/single/text.js b/src/base/single/text.js index b2ce5430e..1c3eb5527 100644 --- a/src/base/single/text.js +++ b/src/base/single/text.js @@ -114,7 +114,7 @@ BI.Text = BI.inherit(BI.Single, { setText: function (text) { BI.Text.superclass.setText.apply(this, arguments); this.options.text = text; - this.text.element.html((text + "").replaceAll(" ", " ")); + this.text.element.html(BI.Func.formatSpecialCharInHtml(text)); } }); diff --git a/src/base/table/table.grid.quick.js b/src/base/table/table.grid.quick.js index 46f979468..daa1243fc 100644 --- a/src/base/table/table.grid.quick.js +++ b/src/base/table/table.grid.quick.js @@ -169,6 +169,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, { this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0); this.bottomRightGrid.setEstimatedRowSize(o.rowSize); + this.topLeftGrid.setColumnCount(freezeColLength); + this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + this.bottomLeftGrid.setColumnCount(freezeColLength); + this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength); + var items = this.contextLayout.attr("items"); items[1].left = regionSize; items[2].top = this._getFreezeHeaderHeight(); diff --git a/src/case/floatbox/floatboxsection.bar.js b/src/case/floatbox/floatboxsection.bar.js index 4b6a6b152..e565b86c8 100644 --- a/src/case/floatbox/floatboxsection.bar.js +++ b/src/case/floatbox/floatboxsection.bar.js @@ -41,7 +41,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, { BI.createWidget({ type: 'bi.right_vertical_adapt', element: south, - hgap: 5, + lgap: 10, items: [this.cancel, this.sure] }); }, diff --git a/src/core/func/dom.js b/src/core/func/dom.js index 976045063..51e6503e7 100644 --- a/src/core/func/dom.js +++ b/src/core/func/dom.js @@ -20,7 +20,7 @@ BI.extend(jQuery.fn, { */ __textKeywordMarked__: function (text, keyword, py) { if (!BI.isKey(keyword) || (text + "").length > 100) { - return this.html((text + "").replaceAll(" ", " ")); + return this.html(BI.Func.formatSpecialCharInHtml(text)); } keyword = keyword + ""; keyword = BI.toUpperCase(keyword); @@ -43,7 +43,7 @@ BI.extend(jQuery.fn, { if (tidx >= 0) { this.append(textLeft.substr(0, tidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(tidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length)))); textLeft = textLeft.substr(tidx + keyword.length); if (py != null) { @@ -52,7 +52,7 @@ BI.extend(jQuery.fn, { } else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) { this.append(textLeft.substr(0, pidx)); this.append($("").addClass("bi-keyword-red-mark") - .html(textLeft.substr(pidx, keyword.length).replaceAll(" ", " "))); + .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length)))); if (py != null) { py = py.substr(pidx + keyword.length); } diff --git a/src/core/func/function.js b/src/core/func/function.js index f58fc6f9e..58a9d22a2 100644 --- a/src/core/func/function.js +++ b/src/core/func/function.js @@ -68,6 +68,27 @@ BI.extend(BI.Func, { matched: matched, finded: finded } + }, + + /** + * 将字符串中的尖括号等字符encode成html能解析的形式 + * @param str + */ + formatSpecialCharInHtml: function (str) { + return (str + "").replaceAll("\\s|<=?|>=?", function (str) { + switch (str) { + case "<": + return "<"; + case "<=": + return "≤"; + case ">": + return ">"; + case ">=": + return "≥"; + default: + return " "; + } + }); } }); diff --git a/src/widget/multidate/multidate.popup.js b/src/widget/multidate/multidate.popup.js index cbdae7fcc..93e4814ba 100644 --- a/src/widget/multidate/multidate.popup.js +++ b/src/widget/multidate/multidate.popup.js @@ -214,6 +214,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { this.textButton.setEnable(false); } }, + + _checkValueValid: function (value) { + return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value); + }, + setValue: function (v) { this.storeValue = v; var self = this, date; @@ -269,7 +274,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, { self._setInnerValue(this.day); break; default: - if (BI.isNull(value) || BI.isEmptyObject(value)) { + if (!this._checkValueValid(value)) { var date = new Date(); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.ymd.setValue({ diff --git a/src/widget/multiselecttree/multiselecttree.js b/src/widget/multiselecttree/multiselecttree.js index 54653c10f..3b3e4ef5a 100644 --- a/src/widget/multiselecttree/multiselecttree.js +++ b/src/widget/multiselecttree/multiselecttree.js @@ -95,7 +95,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { element: this, items: [{ el: this.searcher, - height: 30 + height: 24 }, { el: this.adapter, height: "fill" diff --git a/src/widget/singleslider/singleslider.js b/src/widget/singleslider/singleslider.js index aaee50786..92e455ffc 100644 --- a/src/widget/singleslider/singleslider.js +++ b/src/widget/singleslider/singleslider.js @@ -82,9 +82,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, { allowBlank: false, validationChecker: function (v) { return self._checkValidation(v); - }, - quitChecker: function (v) { - return self._checkValidation(v); } }); this.label.element.hover(function () {