Browse Source

Pull request #3690: BI-138460 fix: 给了固定高度不需要minHeight

Merge in VISUAL/fineui from ~IMP/fineui_fui:master to master

* commit '952fd287c4f38d41da942bb70bbf1dc9c2f8de29':
  BI-138460 fix: 给了固定高度不需要minHeight
research/test
imp-张健 12 months ago
parent
commit
ed686a4c09
  1. 3
      packages/fineui/src/less/widget/intervalslider/intervalslider.label.less
  2. 3
      packages/fineui/src/less/widget/intervalslider/intervalslider.less
  3. 52
      packages/fineui/src/widget/intervalslider/intervalslider.js

3
packages/fineui/src/less/widget/intervalslider/intervalslider.label.less

@ -1,3 +0,0 @@
.bi-interval-slider-label {
min-height: 50px;
}

3
packages/fineui/src/less/widget/intervalslider/intervalslider.less

@ -1,3 +0,0 @@
.bi-interval-slider {
min-height: 50px;
}

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

@ -23,19 +23,17 @@ import { Single, Editor } from "@/base";
import { AccurateCalculationModel } from "./model.accuratecalculation"; import { AccurateCalculationModel } from "./model.accuratecalculation";
import { SignTextEditor, SliderIconButton } from "../singleslider"; import { SignTextEditor, SliderIconButton } from "../singleslider";
const CONSTANTS = {
EDITOR_WIDTH: 58,
EDITOR_HEIGHT: 20,
LABEL_HEIGHT: 30,
SLIDER_HEIGHT: 30,
};
@shortcut() @shortcut()
export class IntervalSlider extends Single { export class IntervalSlider extends Single {
static xtype = "bi.interval_slider"; static xtype = "bi.interval_slider";
_constant = {
EDITOR_WIDTH: 58,
EDITOR_R_GAP: 60,
EDITOR_HEIGHT: 20,
SLIDER_WIDTH_HALF: 15,
LABEL_HEIGHT: 30,
SLIDER_WIDTH: 30,
SLIDER_HEIGHT: 30,
TRACK_HEIGHT: 24,
};
props = { props = {
baseCls: "bi-interval-slider bi-slider-track", baseCls: "bi-interval-slider bi-slider-track",
digit: false, digit: false,
@ -45,6 +43,8 @@ export class IntervalSlider extends Single {
value: { min: "", max: "" }, value: { min: "", max: "" },
lAlign: "center", lAlign: "center",
rAlign: "center", rAlign: "center",
labelHeight: CONSTANTS.LABEL_HEIGHT,
sliderHeight: CONSTANTS.SLIDER_HEIGHT,
}; };
static EVENT_CHANGE = "EVENT_CHANGE"; static EVENT_CHANGE = "EVENT_CHANGE";
@ -60,7 +60,6 @@ export class IntervalSlider extends Single {
} }
render() { render() {
const c = this._constant;
const o = this.options; const o = this.options;
this.enable = false; this.enable = false;
this.valueOne = ""; this.valueOne = "";
@ -86,8 +85,8 @@ export class IntervalSlider extends Single {
text: unit, text: unit,
allowBlank: false, allowBlank: false,
textAlign: lAlign, textAlign: lAlign,
width: BI.isNull(editorWidth) ? BI.toPix(c.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2), width: BI.isNull(editorWidth) ? BI.toPix(CONSTANTS.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2),
height: toPix(c.EDITOR_HEIGHT, 2), height: toPix(CONSTANTS.EDITOR_HEIGHT, 2),
validationChecker: v => this._checkValidation(v), validationChecker: v => this._checkValidation(v),
}); });
this.labelOne.element.hover( this.labelOne.element.hover(
@ -116,8 +115,8 @@ export class IntervalSlider extends Single {
text: unit, text: unit,
allowBlank: false, allowBlank: false,
textAlign: rAlign, textAlign: rAlign,
width: BI.isNull(editorWidth) ? BI.toPix(c.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2), width: BI.isNull(editorWidth) ? BI.toPix(CONSTANTS.EDITOR_WIDTH, 2) : BI.toPix(editorWidth, 2),
height: toPix(c.EDITOR_HEIGHT, 2), height: toPix(CONSTANTS.EDITOR_HEIGHT, 2),
validationChecker: v => this._checkValidation(v), validationChecker: v => this._checkValidation(v),
}); });
this.labelTwo.element.hover( this.labelTwo.element.hover(
@ -152,7 +151,7 @@ export class IntervalSlider extends Single {
return { return {
type: VerticalFillLayout.xtype, type: VerticalFillLayout.xtype,
rowSize: [o.labelHeight || c.LABEL_HEIGHT, o.sliderHeight || c.SLIDER_HEIGHT], rowSize: [o.labelHeight, o.sliderHeight],
items: [ items: [
this._createLabelWrapper(), this._createLabelWrapper(),
{ {
@ -253,7 +252,6 @@ export class IntervalSlider extends Single {
_createLabelWrapper() { _createLabelWrapper() {
const o = this.options; const o = this.options;
const c = this._constant;
return { return {
el: { el: {
@ -275,7 +273,7 @@ export class IntervalSlider extends Single {
], ],
}, },
], ],
height: o.labelHeight || c.LABEL_HEIGHT, height: o.labelHeight,
}, },
top: 0, top: 0,
left: 0, left: 0,
@ -372,24 +370,6 @@ export class IntervalSlider extends Single {
return valid; return valid;
} }
_checkOverlap() {
const labelOneLeft = this.labelOne.element[0].offsetLeft;
const labelTwoLeft = this.labelTwo.element[0].offsetLeft;
if (labelOneLeft <= labelTwoLeft) {
if (labelTwoLeft - labelOneLeft < 90) {
this.labelTwo.element.css({ top: 40 });
} else {
this.labelTwo.element.css({ top: 0 });
}
} else {
if (labelOneLeft - labelTwoLeft < 90) {
this.labelTwo.element.css({ top: 40 });
} else {
this.labelTwo.element.css({ top: 0 });
}
}
}
_checkLabelPosition(oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) { _checkLabelPosition(oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = parseFloat(oldValueOne); oldValueOne = parseFloat(oldValueOne);
oldValueTwo = parseFloat(oldValueTwo); oldValueTwo = parseFloat(oldValueTwo);

Loading…
Cancel
Save