diff --git a/changelog.md b/changelog.md index 251859dd5..1c0dec991 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # 更新日志 +2.0(2020-1) +- 修复单值系滑块滑动松手后发两次EVENT_CHANGE的问题 + 2.0(2019-12) - 修复多层级单选下拉树主动设置container后搜索面板弹出问题 - bi.search_editor支持搜索中间含有空格的字符串 diff --git a/src/widget/datetimepane/card.static.datetimepane.js b/src/widget/datetimepane/card.static.datetimepane.js index c94f7592d..f17fe9104 100644 --- a/src/widget/datetimepane/card.static.datetimepane.js +++ b/src/widget/datetimepane/card.static.datetimepane.js @@ -36,8 +36,7 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, { } self.selectedTime = BI.extend(self.selectedTime, { year: value.year, - month: value.month, - day: day + month: value.month }); day !== 0 && (self.selectedTime.day = day); self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)); diff --git a/src/widget/intervalslider/intervalslider.js b/src/widget/intervalslider/intervalslider.js index a90a65f81..71b9c95d4 100644 --- a/src/widget/intervalslider/intervalslider.js +++ b/src/widget/intervalslider/intervalslider.js @@ -514,13 +514,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, { }, populate: function () { + var o = this.options; if (!isNaN(this.min) && !isNaN(this.max)) { this.enable = true; this._setVisible(true); this._setErrorText(); if ((BI.isNumeric(this.valueOne) || BI.isNotEmptyString(this.valueOne)) && (BI.isNumeric(this.valueTwo) || BI.isNotEmptyString(this.valueTwo))) { - this.labelOne.setValue(this.valueOne); - this.labelTwo.setValue(this.valueTwo); + this.labelOne.setValue(o.digit === false ? this.valueOne : BI.parseFloat(this.valueOne).toFixed(o.digit)); + this.labelTwo.setValue(o.digit === false ? this.valueTwo : BI.parseFloat(this.valueTwo).toFixed(o.digit)); this._setAllPosition(this._getPercentByValue(this.valueOne), this._getPercentByValue(this.valueTwo)); } else { this.labelOne.setValue(this.min); diff --git a/src/widget/singleslider/singleslider.js b/src/widget/singleslider/singleslider.js index c3c8e2c6e..eb0a700c7 100644 --- a/src/widget/singleslider/singleslider.js +++ b/src/widget/singleslider/singleslider.js @@ -52,7 +52,7 @@ BI.SingleSlider = BI.inherit(BI.Single, { }); // 这边其实是有问题的,拖拽区域是个圆,在圆的边缘拖拽后放开,这边计算出来的蓝条宽度实际上会比放开时长一点或者短一点 sliderVertical.element.click(function (e) { - if (self.enable && self.isEnabled()) { + if (self.enable && self.isEnabled() && sliderVertical.element[0] === e.originalEvent.target) { var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF; var trackLength = self.track.element[0].scrollWidth - c.TRACK_GAP; var percent = 0; diff --git a/src/widget/singleslider/singleslider.label.js b/src/widget/singleslider/singleslider.label.js index 034d22f14..fce46f013 100644 --- a/src/widget/singleslider/singleslider.label.js +++ b/src/widget/singleslider/singleslider.label.js @@ -54,7 +54,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { height: c.SLIDER_HEIGHT }); sliderVertical.element.click(function (e) { - if (self.enable && self.isEnabled()) { + if (self.enable && self.isEnabled() && sliderVertical.element[0] === e.originalEvent.target) { var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF; var trackLength = self.track.element[0].scrollWidth - c.TRACK_GAP; var percent = 0; diff --git a/src/widget/singleslider/singleslider.normal.js b/src/widget/singleslider/singleslider.normal.js index 347906fae..2ba74c8b9 100644 --- a/src/widget/singleslider/singleslider.normal.js +++ b/src/widget/singleslider/singleslider.normal.js @@ -42,7 +42,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Single, { height: c.SLIDER_HEIGHT }); sliderVertical.element.click(function (e) { - if (self.enable && self.isEnabled()) { + if (self.enable && self.isEnabled() && sliderVertical.element[0] === e.originalEvent.target) { var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF; var trackLength = self.track.element[0].scrollWidth - c.TRACK_GAP; var percent = 0;