Browse Source

Merge remote-tracking branch 'remotes/origin/BI4.1'

# Conflicts:
#	dist/bundle.min.js
es6
guy 7 years ago
parent
commit
fc1fc31701
  1. 7
      bi/base.js
  2. 2
      bi/case.js
  3. 27
      bi/core.js
  4. 12
      bi/widget.js
  5. 1
      demo/js/widget/slider/demo.slider.js
  6. 7
      dist/base.js
  7. 48
      dist/bundle.js
  8. 2
      dist/case.js
  9. 27
      dist/core.js
  10. 1
      dist/demo.js
  11. 12
      dist/widget.js
  12. 2
      src/base/single/text.js
  13. 5
      src/base/table/table.grid.quick.js
  14. 2
      src/case/floatbox/floatboxsection.bar.js
  15. 6
      src/core/func/dom.js
  16. 21
      src/core/func/function.js
  17. 7
      src/widget/multidate/multidate.popup.js
  18. 2
      src/widget/multiselecttree/multiselecttree.js
  19. 3
      src/widget/singleslider/singleslider.js

7
bi/base.js

@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) { setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments); BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text; 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.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); 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"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();

2
bi/case.js

@ -7555,7 +7555,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({ BI.createWidget({
type: 'bi.right_vertical_adapt', type: 'bi.right_vertical_adapt',
element: south, element: south,
hgap: 5, lgap: 10,
items: [this.cancel, this.sure] items: [this.cancel, this.sure]
}); });
}, },

27
bi/core.js

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/ */
__textKeywordMarked__: function (text, keyword, py) { __textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) { if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", " ")); return this.html(BI.Func.formatSpecialCharInHtml(text));
} }
keyword = keyword + ""; keyword = keyword + "";
keyword = BI.toUpperCase(keyword); keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) { if (tidx >= 0) {
this.append(textLeft.substr(0, tidx)); this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length); textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) { 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)) { } 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(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) { if (py != null) {
py = py.substr(pidx + keyword.length); py = py.substr(pidx + keyword.length);
} }
@ -19915,6 +19915,27 @@ BI.extend(BI.Func, {
matched: matched, matched: matched,
finded: finded finded: finded
} }
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
} }
}); });

12
bi/widget.js

@ -7364,6 +7364,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.textButton.setEnable(false); this.textButton.setEnable(false);
} }
}, },
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
},
setValue: function (v) { setValue: function (v) {
this.storeValue = v; this.storeValue = v;
var self = this, date; var self = this, date;
@ -7419,7 +7424,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;
default: default:
if (BI.isNull(value) || BI.isEmptyObject(value)) { if (!this._checkValueValid(value)) {
var date = new Date(); var date = new Date();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({ this.ymd.setValue({
@ -11836,7 +11841,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, {
element: this, element: this,
items: [{ items: [{
el: this.searcher, el: this.searcher,
height: 30 height: 24
}, { }, {
el: this.adapter, el: this.adapter,
height: "fill" height: "fill"
@ -18500,9 +18505,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
allowBlank: false, allowBlank: false,
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
},
quitChecker: function (v) {
return self._checkValidation(v);
} }
}); });
this.label.element.hover(function () { this.label.element.hover(function () {

1
demo/js/widget/slider/demo.slider.js

@ -62,6 +62,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSlider = BI.createWidget({ var intervalSlider = BI.createWidget({
type: "bi.interval_slider", type: "bi.interval_slider",
width: o.width, width: o.width,
digit: 0,
cls: "layout-bg-white" cls: "layout-bg-white"
}); });
intervalSlider.setMinAndMax({ intervalSlider.setMinAndMax({

7
dist/base.js vendored

@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) { setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments); BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text; this.options.text = text;
this.text.element.html((text + "").replaceAll(" ", "&nbsp;")); 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.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); 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"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();

48
dist/bundle.js vendored

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/ */
__textKeywordMarked__: function (text, keyword, py) { __textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) { if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", "&nbsp;")); return this.html(BI.Func.formatSpecialCharInHtml(text));
} }
keyword = keyword + ""; keyword = keyword + "";
keyword = BI.toUpperCase(keyword); keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) { if (tidx >= 0) {
this.append(textLeft.substr(0, tidx)); this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length); textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) { 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)) { } 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(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) { if (py != null) {
py = py.substr(pidx + keyword.length); py = py.substr(pidx + keyword.length);
} }
@ -19915,6 +19915,27 @@ BI.extend(BI.Func, {
matched: matched, matched: matched,
finded: finded finded: finded
} }
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
} }
}); });
@ -26435,7 +26456,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) { setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments); BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text; this.options.text = text;
this.text.element.html((text + "").replaceAll(" ", "&nbsp;")); 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.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); 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"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();
@ -68991,7 +69017,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({ BI.createWidget({
type: 'bi.right_vertical_adapt', type: 'bi.right_vertical_adapt',
element: south, element: south,
hgap: 5, lgap: 10,
items: [this.cancel, this.sure] items: [this.cancel, this.sure]
}); });
}, },
@ -82567,6 +82593,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.textButton.setEnable(false); this.textButton.setEnable(false);
} }
}, },
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
},
setValue: function (v) { setValue: function (v) {
this.storeValue = v; this.storeValue = v;
var self = this, date; var self = this, date;
@ -82622,7 +82653,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;
default: default:
if (BI.isNull(value) || BI.isEmptyObject(value)) { if (!this._checkValueValid(value)) {
var date = new Date(); var date = new Date();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({ this.ymd.setValue({
@ -87039,7 +87070,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, {
element: this, element: this,
items: [{ items: [{
el: this.searcher, el: this.searcher,
height: 30 height: 24
}, { }, {
el: this.adapter, el: this.adapter,
height: "fill" height: "fill"
@ -93703,9 +93734,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
allowBlank: false, allowBlank: false,
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
},
quitChecker: function (v) {
return self._checkValidation(v);
} }
}); });
this.label.element.hover(function () { this.label.element.hover(function () {

2
dist/case.js vendored

@ -7555,7 +7555,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({ BI.createWidget({
type: 'bi.right_vertical_adapt', type: 'bi.right_vertical_adapt',
element: south, element: south,
hgap: 5, lgap: 10,
items: [this.cancel, this.sure] items: [this.cancel, this.sure]
}); });
}, },

27
dist/core.js vendored

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/ */
__textKeywordMarked__: function (text, keyword, py) { __textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) { if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", "&nbsp;")); return this.html(BI.Func.formatSpecialCharInHtml(text));
} }
keyword = keyword + ""; keyword = keyword + "";
keyword = BI.toUpperCase(keyword); keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) { if (tidx >= 0) {
this.append(textLeft.substr(0, tidx)); this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length); textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) { 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)) { } 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(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) { if (py != null) {
py = py.substr(pidx + keyword.length); py = py.substr(pidx + keyword.length);
} }
@ -19915,6 +19915,27 @@ BI.extend(BI.Func, {
matched: matched, matched: matched,
finded: finded finded: finded
} }
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
} }
}); });

1
dist/demo.js vendored

@ -13216,6 +13216,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSlider = BI.createWidget({ var intervalSlider = BI.createWidget({
type: "bi.interval_slider", type: "bi.interval_slider",
width: o.width, width: o.width,
digit: 0,
cls: "layout-bg-white" cls: "layout-bg-white"
}); });
intervalSlider.setMinAndMax({ intervalSlider.setMinAndMax({

12
dist/widget.js vendored

@ -7364,6 +7364,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.textButton.setEnable(false); this.textButton.setEnable(false);
} }
}, },
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
},
setValue: function (v) { setValue: function (v) {
this.storeValue = v; this.storeValue = v;
var self = this, date; var self = this, date;
@ -7419,7 +7424,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;
default: default:
if (BI.isNull(value) || BI.isEmptyObject(value)) { if (!this._checkValueValid(value)) {
var date = new Date(); var date = new Date();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({ this.ymd.setValue({
@ -11836,7 +11841,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, {
element: this, element: this,
items: [{ items: [{
el: this.searcher, el: this.searcher,
height: 30 height: 24
}, { }, {
el: this.adapter, el: this.adapter,
height: "fill" height: "fill"
@ -18500,9 +18505,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
allowBlank: false, allowBlank: false,
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
},
quitChecker: function (v) {
return self._checkValidation(v);
} }
}); });
this.label.element.hover(function () { this.label.element.hover(function () {

2
src/base/single/text.js

@ -114,7 +114,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) { setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments); BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text; this.options.text = text;
this.text.element.html((text + "").replaceAll(" ", "&nbsp;")); this.text.element.html(BI.Func.formatSpecialCharInHtml(text));
} }
}); });

5
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.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize); 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"); var items = this.contextLayout.attr("items");
items[1].left = regionSize; items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight(); items[2].top = this._getFreezeHeaderHeight();

2
src/case/floatbox/floatboxsection.bar.js

@ -41,7 +41,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({ BI.createWidget({
type: 'bi.right_vertical_adapt', type: 'bi.right_vertical_adapt',
element: south, element: south,
hgap: 5, lgap: 10,
items: [this.cancel, this.sure] items: [this.cancel, this.sure]
}); });
}, },

6
src/core/func/dom.js

@ -20,7 +20,7 @@ BI.extend(jQuery.fn, {
*/ */
__textKeywordMarked__: function (text, keyword, py) { __textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) { if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", "&nbsp;")); return this.html(BI.Func.formatSpecialCharInHtml(text));
} }
keyword = keyword + ""; keyword = keyword + "";
keyword = BI.toUpperCase(keyword); keyword = BI.toUpperCase(keyword);
@ -43,7 +43,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) { if (tidx >= 0) {
this.append(textLeft.substr(0, tidx)); this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length); textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) { 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)) { } 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(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark") this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;"))); .html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) { if (py != null) {
py = py.substr(pidx + keyword.length); py = py.substr(pidx + keyword.length);
} }

21
src/core/func/function.js

@ -68,6 +68,27 @@ BI.extend(BI.Func, {
matched: matched, matched: matched,
finded: finded finded: finded
} }
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
} }
}); });

7
src/widget/multidate/multidate.popup.js

@ -214,6 +214,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.textButton.setEnable(false); this.textButton.setEnable(false);
} }
}, },
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
},
setValue: function (v) { setValue: function (v) {
this.storeValue = v; this.storeValue = v;
var self = this, date; var self = this, date;
@ -269,7 +274,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day); self._setInnerValue(this.day);
break; break;
default: default:
if (BI.isNull(value) || BI.isEmptyObject(value)) { if (!this._checkValueValid(value)) {
var date = new Date(); var date = new Date();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD); this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({ this.ymd.setValue({

2
src/widget/multiselecttree/multiselecttree.js

@ -95,7 +95,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, {
element: this, element: this,
items: [{ items: [{
el: this.searcher, el: this.searcher,
height: 30 height: 24
}, { }, {
el: this.adapter, el: this.adapter,
height: "fill" height: "fill"

3
src/widget/singleslider/singleslider.js

@ -82,9 +82,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
allowBlank: false, allowBlank: false,
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
},
quitChecker: function (v) {
return self._checkValidation(v);
} }
}); });
this.label.element.hover(function () { this.label.element.hover(function () {

Loading…
Cancel
Save