Browse Source

BI-59128 style:不允许小数时修改错误提示文案

master
Tangjinxia 4 years ago
parent
commit
ca740ca88a
  1. 10
      src/widget/singleslider/singleslider.js

10
src/widget/singleslider/singleslider.js

@ -16,8 +16,7 @@ BI.SingleSlider = BI.inherit(BI.Single, {
props: { props: {
baseCls: "bi-single-slider bi-slider-track", baseCls: "bi-single-slider bi-slider-track",
digit: false, digit: false,
unit: "", unit: ""
errorText: ""
}, },
render: function () { render: function () {
@ -323,11 +322,12 @@ BI.SingleSlider = BI.inherit(BI.Single, {
if (!isNaN(this.min) && !isNaN(this.max)) { if (!isNaN(this.min) && !isNaN(this.max)) {
this._setVisible(true); this._setVisible(true);
this.enable = true; this.enable = true;
if (BI.isNotEmptyString(o.errorText)) { if (o.digit) {
this.label.setErrorText(o.errorText);
} else {
this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between", this.min, this.max)); this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between", this.min, this.max));
} else {
this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Integer_Number_Between", this.min, this.max));
} }
if (BI.isNumeric(this.value) || BI.isNotEmptyString(this.value)) { if (BI.isNumeric(this.value) || BI.isNotEmptyString(this.value)) {
this.label.setValue(this.value); this.label.setValue(this.value);
this._setAllPosition(this._getPercentByValue(this.value)); this._setAllPosition(this._getPercentByValue(this.value));

Loading…
Cancel
Save