Browse Source

BI-28087 slider控件可编辑区域值显示规范

master
windy 7 years ago
parent
commit
d821a3e2b3
  1. 35
      dist/bundle.js
  2. 2
      dist/core.js
  3. 35
      dist/fineui.js
  4. 33
      dist/widget.js
  5. 2
      src/core/alias.js
  6. 33
      src/widget/intervalslider/intervalslider.js
  7. 2
      utils/utils.js

35
dist/bundle.js vendored

@ -26161,7 +26161,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
cv = Date.parseDateTime(cv + "", Date.patterns.ISO8601Long);
}
}
if (!BI.isNull(cv)) {
@ -94144,7 +94144,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
textAlign: "left",
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -94157,13 +94156,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -94173,7 +94173,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) {
return self._checkValidation(v);
}
@ -94184,13 +94183,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -94238,16 +94238,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
@ -94422,14 +94423,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
},
_setLabelOnePosition: function (percent) {
// this.labelOne.element.css({left: percent + "%"});
// this._checkOverlap();
},
_setLabelTwoPosition: function (percent) {
// this.labelTwo.element.css({left: percent + "%"});
// this._checkOverlap();
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
},
_setSliderOnePosition: function (percent) {
@ -94462,9 +94465,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack();
},

2
dist/core.js vendored

@ -26161,7 +26161,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
cv = Date.parseDateTime(cv + "", Date.patterns.ISO8601Long);
}
}
if (!BI.isNull(cv)) {

35
dist/fineui.js vendored

@ -26410,7 +26410,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
cv = Date.parseDateTime(cv + "", Date.patterns.ISO8601Long);
}
}
if (!BI.isNull(cv)) {
@ -94393,7 +94393,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
textAlign: "left",
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -94406,13 +94405,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -94422,7 +94422,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) {
return self._checkValidation(v);
}
@ -94433,13 +94432,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -94487,16 +94487,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
@ -94671,14 +94672,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
},
_setLabelOnePosition: function (percent) {
// this.labelOne.element.css({left: percent + "%"});
// this._checkOverlap();
},
_setLabelTwoPosition: function (percent) {
// this.labelTwo.element.css({left: percent + "%"});
// this._checkOverlap();
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
},
_setSliderOnePosition: function (percent) {
@ -94711,9 +94714,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack();
},

33
dist/widget.js vendored

@ -6248,7 +6248,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
textAlign: "left",
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -6261,13 +6260,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -6277,7 +6277,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) {
return self._checkValidation(v);
}
@ -6288,13 +6287,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -6342,16 +6342,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
@ -6526,14 +6527,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
},
_setLabelOnePosition: function (percent) {
// this.labelOne.element.css({left: percent + "%"});
// this._checkOverlap();
},
_setLabelTwoPosition: function (percent) {
// this.labelTwo.element.css({left: percent + "%"});
// this._checkOverlap();
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
},
_setSliderOnePosition: function (percent) {
@ -6566,9 +6569,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack();
},

2
src/core/alias.js

@ -486,7 +486,7 @@
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
cv = Date.parseDateTime(cv + "", Date.patterns.ISO8601Long);
}
}
if (!BI.isNull(cv)) {

33
src/widget/intervalslider/intervalslider.js

@ -48,7 +48,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
textAlign: "left",
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -61,13 +60,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -77,7 +77,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) {
return self._checkValidation(v);
}
@ -88,13 +87,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -142,16 +142,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
@ -326,14 +327,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
},
_setLabelOnePosition: function (percent) {
// this.labelOne.element.css({left: percent + "%"});
// this._checkOverlap();
},
_setLabelTwoPosition: function (percent) {
// this.labelTwo.element.css({left: percent + "%"});
// this._checkOverlap();
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
},
_setSliderOnePosition: function (percent) {
@ -366,9 +369,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack();
},

2
utils/utils.js

@ -12958,7 +12958,7 @@ _.extend(BI.OB.prototype, {
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
cv = Date.parseDateTime(cv + "", Date.patterns.ISO8601Long);
}
}
if (!BI.isNull(cv)) {

Loading…
Cancel
Save