From bb7e287448f3371603a8b0af60ebb37880f58464 Mon Sep 17 00:00:00 2001 From: treecat <2184452844@qq.com> Date: Sun, 3 Dec 2023 18:29:37 +0800 Subject: [PATCH] =?UTF-8?q?BI-139664=20fix:=E6=BB=91=E5=9D=97=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/intervalslider/intervalslider.js | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/fineui/src/widget/intervalslider/intervalslider.js b/packages/fineui/src/widget/intervalslider/intervalslider.js index f3a1c4aff..afd1919f3 100644 --- a/packages/fineui/src/widget/intervalslider/intervalslider.js +++ b/packages/fineui/src/widget/intervalslider/intervalslider.js @@ -59,6 +59,10 @@ export class IntervalSlider extends Single { this.populate(); } + getConstant() { + return CONSTANTS; + } + render() { const o = this.options; this.enable = false; @@ -85,7 +89,7 @@ export class IntervalSlider extends Single { text: unit, allowBlank: false, 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), validationChecker: v => this._checkValidation(v), }); @@ -115,7 +119,7 @@ export class IntervalSlider extends Single { text: unit, allowBlank: false, 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), validationChecker: v => this._checkValidation(v), }); @@ -384,18 +388,27 @@ export class IntervalSlider extends Single { } } + // 别删,历史原因,定时调度不能用 parentElement.children 函数 + _getElementFirstChild() { + return parentElement.children()[0] + } + _resetLabelPosition(needReverse) { const { lAlign, rAlign } = this.options; + this.labelOne.element.css({ left: needReverse ? "unset" : "0%", 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({ - left: needReverse ? "0%" : "unset", - right: needReverse ? "unset" : "0%", + left: needReverse ? "0%" : "unset", + 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) {