Browse Source

Pull request #1850: BI-83687 fix: 动态时间面板提示位置修改

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '274b0ffe09e46c0446a095e65dba1b0fab606bfe':
  BI-83687 fix: 动态时间面板提示位置修改
es6
windy 4 years ago
parent
commit
cc5dbfb6fc
  1. 6
      src/widget/year/card.dynamic.year.js
  2. 2
      src/widget/year/popup.year.js
  3. 16
      src/widget/yearmonth/card.dynamic.yearmonth.js
  4. 2
      src/widget/yearmonth/popup.yearmonth.js
  5. 16
      src/widget/yearquarter/card.dynamic.yearquarter.js
  6. 2
      src/widget/yearquarter/popup.yearquarter.js

6
src/widget/year/card.dynamic.year.js

@ -93,6 +93,10 @@ BI.DynamicYearCard = BI.inherit(BI.Widget, {
}; };
}, },
getInputValue: function () {
return this._getValue();
},
getValue: function () { getValue: function () {
return this.checkValidation() ? this._getValue() : {}; return this.checkValidation() ? this._getValue() : {};
}, },
@ -106,7 +110,7 @@ BI.DynamicYearCard = BI.inherit(BI.Widget, {
invalid = !this._checkDate(this._getValue()); invalid = !this._checkDate(this._getValue());
errorText = this._getErrorText(); errorText = this._getErrorText();
} }
invalid && show && BI.Bubbles.show("dynamic-year-error", errorText, this.wrapper); invalid && show && BI.Bubbles.show("dynamic-year-error", errorText, this.item);
return !invalid; return !invalid;
}, },

2
src/widget/year/popup.year.js

@ -87,7 +87,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, {
this.yearButton.setValue(BI.i18nText("BI-Basic_Current_Year")); this.yearButton.setValue(BI.i18nText("BI-Basic_Current_Year"));
this.yearButton.setEnable(!this._checkYearValid()); this.yearButton.setEnable(!this._checkYearValid());
} else { } else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getInputValue());
date = BI.print(date, "%Y"); date = BI.print(date, "%Y");
this.yearButton.setValue(date); this.yearButton.setValue(date);
this.yearButton.setEnable(false); this.yearButton.setEnable(false);

16
src/widget/yearmonth/card.dynamic.yearmonth.js

@ -15,15 +15,18 @@ BI.DynamicYearMonthCard = BI.inherit(BI.Widget, {
var self = this; var self = this;
return { return {
type: "bi.vertical", type: "bi.vertical",
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{ items: [{
type: "bi.label", type: "bi.label",
text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"), text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"),
textAlign: "left", textAlign: "left",
height: 24 height: 24
}, { }, {
type: "bi.vertical",
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.dynamic_date_param_item", type: "bi.dynamic_date_param_item",
validationChecker: BI.bind(self._checkDate, self), validationChecker: BI.bind(self._checkDate, self),
ref: function () { ref: function () {
@ -40,6 +43,8 @@ BI.DynamicYearMonthCard = BI.inherit(BI.Widget, {
BI.Bubbles.hide("dynamic-year-month-error"); BI.Bubbles.hide("dynamic-year-month-error");
} }
}] }]
},
bgap: 10,
}, { }, {
type: "bi.dynamic_date_param_item", type: "bi.dynamic_date_param_item",
dateType: BI.DynamicDateCard.TYPE.MONTH, dateType: BI.DynamicDateCard.TYPE.MONTH,
@ -57,6 +62,7 @@ BI.DynamicYearMonthCard = BI.inherit(BI.Widget, {
BI.Bubbles.hide("dynamic-year-month-error"); BI.Bubbles.hide("dynamic-year-month-error");
} }
}] }]
}]
}], }],
vgap: 10, vgap: 10,
hgap: 10 hgap: 10
@ -132,6 +138,10 @@ BI.DynamicYearMonthCard = BI.inherit(BI.Widget, {
}; };
}, },
getInputValue: function () {
return this._getValue();
},
getValue: function () { getValue: function () {
return this.checkValidation() ? this._getValue() : {}; return this.checkValidation() ? this._getValue() : {};
}, },

2
src/widget/yearmonth/popup.yearmonth.js

@ -87,7 +87,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, {
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")); this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month"));
this.textButton.setEnable(!this._checkTodayValid()); this.textButton.setEnable(!this._checkTodayValid());
} else { } else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getInputValue());
date = BI.print(date, "%Y-%x"); date = BI.print(date, "%Y-%x");
this.textButton.setValue(date); this.textButton.setValue(date);
this.textButton.setEnable(false); this.textButton.setEnable(false);

16
src/widget/yearquarter/card.dynamic.yearquarter.js

@ -15,15 +15,18 @@ BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, {
var self = this; var self = this;
return { return {
type: "bi.vertical", type: "bi.vertical",
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{ items: [{
type: "bi.label", type: "bi.label",
text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"), text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"),
textAlign: "left", textAlign: "left",
height: 24 height: 24
}, { }, {
type: "bi.vertical",
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.dynamic_date_param_item", type: "bi.dynamic_date_param_item",
validationChecker: BI.bind(self._checkDate, self), validationChecker: BI.bind(self._checkDate, self),
ref: function () { ref: function () {
@ -40,6 +43,8 @@ BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, {
BI.Bubbles.hide("dynamic-year-quarter-error"); BI.Bubbles.hide("dynamic-year-quarter-error");
} }
}] }]
},
bgap: 10
}, { }, {
type: "bi.dynamic_date_param_item", type: "bi.dynamic_date_param_item",
dateType: BI.DynamicDateCard.TYPE.QUARTER, dateType: BI.DynamicDateCard.TYPE.QUARTER,
@ -57,6 +62,7 @@ BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, {
BI.Bubbles.hide("dynamic-year-quarter-error"); BI.Bubbles.hide("dynamic-year-quarter-error");
} }
}] }]
}]
}], }],
vgap: 10, vgap: 10,
hgap: 10 hgap: 10
@ -132,6 +138,10 @@ BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, {
}; };
}, },
getInputValue: function () {
return this._getValue();
},
getValue: function () { getValue: function () {
return this.checkValidation() ? this._getValue() : {}; return this.checkValidation() ? this._getValue() : {};
}, },

2
src/widget/yearquarter/popup.yearquarter.js

@ -80,7 +80,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")); this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter"));
this.textButton.setEnable(!this._checkTodayValid()); this.textButton.setEnable(!this._checkTodayValid());
} else { } else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getInputValue());
date = BI.print(date, "%Y-%Q"); date = BI.print(date, "%Y-%Q");
this.textButton.setValue(date); this.textButton.setValue(date);
this.textButton.setEnable(false); this.textButton.setEnable(false);

Loading…
Cancel
Save