Browse Source

BI-139664 fix:滑块组件

research/test
treecat 12 months ago
parent
commit
bb7e287448
  1. 25
      packages/fineui/src/widget/intervalslider/intervalslider.js

25
packages/fineui/src/widget/intervalslider/intervalslider.js

@ -59,6 +59,10 @@ export class IntervalSlider extends Single {
this.populate(); this.populate();
} }
getConstant() {
return CONSTANTS;
}
render() { render() {
const o = this.options; const o = this.options;
this.enable = false; this.enable = false;
@ -85,7 +89,7 @@ export class IntervalSlider extends Single {
text: unit, text: unit,
allowBlank: false, allowBlank: false,
textAlign: lAlign, textAlign: lAlign,
width: BI.isNull(editorWidth) ? BI.toPix(CONSTANTS.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2), width: isNull(editorWidth) ? toPix(CONSTANTS.EDITOR_WIDTH, 2) : toPix(editorWidth, 2),
height: toPix(CONSTANTS.EDITOR_HEIGHT, 2), height: toPix(CONSTANTS.EDITOR_HEIGHT, 2),
validationChecker: v => this._checkValidation(v), validationChecker: v => this._checkValidation(v),
}); });
@ -115,7 +119,7 @@ export class IntervalSlider extends Single {
text: unit, text: unit,
allowBlank: false, allowBlank: false,
textAlign: rAlign, textAlign: rAlign,
width: BI.isNull(editorWidth) ? BI.toPix(CONSTANTS.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2), width: isNull(editorWidth) ? toPix(CONSTANTS.EDITOR_WIDTH, 2) : toPix(editorWidth, 2),
height: toPix(CONSTANTS.EDITOR_HEIGHT, 2), height: toPix(CONSTANTS.EDITOR_HEIGHT, 2),
validationChecker: v => this._checkValidation(v), validationChecker: v => this._checkValidation(v),
}); });
@ -384,18 +388,27 @@ export class IntervalSlider extends Single {
} }
} }
// 别删,历史原因,定时调度不能用 parentElement.children 函数
_getElementFirstChild() {
return parentElement.children()[0]
}
_resetLabelPosition(needReverse) { _resetLabelPosition(needReverse) {
const { lAlign, rAlign } = this.options; const { lAlign, rAlign } = this.options;
this.labelOne.element.css({ this.labelOne.element.css({
left: needReverse ? "unset" : "0%", left: needReverse ? "unset" : "0%",
right: needReverse ? "0%" : "unset", right: needReverse ? "0%" : "unset",
}); });
this.labelOne.element.children()[0] && (this.labelOne.element.children()[0].style.textAlign = needReverse ? rAlign : lAlign); this._getElementFirstChild(this.labelOne.element)
?.labelOneChild.css({ textAlign: needReverse ? rAlign : lAlign });
this.labelTwo.element.css({ this.labelTwo.element.css({
left: needReverse ? "0%" : "unset", left: needReverse ? "0%" : "unset",
right: needReverse ? "unset" : "0%", right: needReverse ? "unset" : "0%",
}); });
this.labelTwo.element.children()[0] && (this.labelTwo.element.children()[0].style.textAlign = needReverse ? lAlign : rAlign); this._getElementFirstChild(this.labelTwo.element)
?.css({ textAlign: needReverse ? lAlign : rAlign });
} }
_setSliderOnePosition(percent) { _setSliderOnePosition(percent) {

Loading…
Cancel
Save