Browse Source

BI-116019 fix: 【6.0.4冒烟】区间滑块不绑定字段,鼠标悬浮组件应该会有提示

es6
zsmj 2 years ago
parent
commit
128c819e83
  1. 4
      demo/js/config/widget.js
  2. 19
      src/widget/intervalslider/intervalslider.js

4
demo/js/config/widget.js

@ -192,7 +192,7 @@ Demo.WIDGET_CONFIG = [{
value: "demo.number_interval" value: "demo.number_interval"
}, { }, {
id: 420, id: 420,
text: "滚动sliders", text: "数值滑块sliders",
value: "demo.slider" value: "demo.slider"
}, { }, {
pId: 4, pId: 4,
@ -202,4 +202,4 @@ Demo.WIDGET_CONFIG = [{
pId: 414, pId: 414,
text: "bi.collapse", text: "bi.collapse",
value: "demo.collapse" value: "demo.collapse"
}]; }];

19
src/widget/intervalslider/intervalslider.js

@ -26,7 +26,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
beforeMount: function () { beforeMount: function () {
const { value, min, max } = this.options; const { value, min, max } = this.options;
this.setMinAndMax({ this._setMinAndMax({
min, min,
max, max,
}); });
@ -260,12 +260,12 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
items: [ items: [
{ {
el: this.sliderOne, el: this.sliderOne,
top: 1, top: 0,
bottom: 0, bottom: 0,
left: 0 left: 0
}, { }, {
el: this.sliderTwo, el: this.sliderTwo,
top: 1, top: 0,
bottom: 0, bottom: 0,
left: "100%" left: "100%"
} }
@ -487,22 +487,23 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}, },
setMinAndMax: function (v) { _setMinAndMax: function (v) {
var minNumber = BI.parseFloat(v.min); var minNumber = BI.parseFloat(v.min);
var maxNumber = BI.parseFloat(v.max); var maxNumber = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber >= minNumber )) { if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber >= minNumber)) {
this.min = minNumber; this.min = minNumber;
this.max = maxNumber; this.max = maxNumber;
this.valueOne = minNumber; this.valueOne = minNumber;
this.valueTwo = maxNumber; this.valueTwo = maxNumber;
this.precision = this._getPrecision(); this.precision = this._getPrecision();
this.setEnable(true);
}
if (maxNumber === minNumber) {
this.setEnable(false);
} }
}, },
setMinAndMax: function (v) {
this._setMinAndMax(v);
this.setEnable(v.min <= v.max);
},
setValue: function (v) { setValue: function (v) {
var o = this.options; var o = this.options;
var valueOne = BI.parseFloat(v.min); var valueOne = BI.parseFloat(v.min);

Loading…
Cancel
Save