Browse Source

Pull request #1425: 无JIRA任务 复选树的线

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

* commit '62359baa5e52a71b11a24eda4de7ba0b7414e5cb':
  REPORT-36727 fix: 适配FR的操作
  无JIRA任务 复选中的线
es6
windy 4 years ago
parent
commit
b8a5d2b3c1
  1. 2
      src/less/resource/background.less
  2. 18
      src/widget/date/calendar/picker.date.js

2
src/less/resource/background.less

@ -50,7 +50,7 @@
content: ''; content: '';
border-left: 1px dashed #D0D4DA; border-left: 1px dashed #D0D4DA;
height: calc(~"100% - 3px"); height: calc(~"100% - 3px");
left: 12px; left: 11px;
margin-top: 1px; margin-top: 1px;
} }
} }

18
src/widget/date/calendar/picker.date.js

@ -29,12 +29,12 @@ BI.DatePicker = BI.inherit(BI.Widget, {
this.left.on(BI.IconButton.EVENT_CHANGE, function () { this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 1) { if (self._month === 1) {
self.setValue({ self.setValue({
year: self.year.getValue() - 1, year: (self.year.getValue() - 1) || (BI.getDate().getFullYear() - 1),
month: 12, month: 12,
}); });
} else { } else {
self.setValue({ self.setValue({
year: self.year.getValue(), year: self.year.getValue() || BI.getDate().getFullYear(),
month: (self.month.getValue() - 1) || BI.getDate().getMonth(), month: (self.month.getValue() - 1) || BI.getDate().getMonth(),
}); });
} }
@ -53,12 +53,12 @@ BI.DatePicker = BI.inherit(BI.Widget, {
this.right.on(BI.IconButton.EVENT_CHANGE, function () { this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 12) { if (self._month === 12) {
self.setValue({ self.setValue({
year: self.year.getValue() + 1, year: (self.year.getValue() + 1) || (BI.getDate().getFullYear() + 1),
month: 1, month: 1,
}); });
} else { } else {
self.setValue({ self.setValue({
year: self.year.getValue(), year: self.year.getValue() || BI.getDate().getFullYear(),
month: (self.month.getValue() + 1) || (BI.getDate().getMonth() + 2), month: (self.month.getValue() + 1) || (BI.getDate().getMonth() + 2),
}); });
} }
@ -129,12 +129,12 @@ BI.DatePicker = BI.inherit(BI.Widget, {
}); });
}, },
_refreshMonth: function () { _refreshMonth: function (defaultMonth) {
var month = this.month.getValue(); var month = this.month.getValue();
this.month.populate(this._getAllowMonths()); this.month.populate(this._getAllowMonths());
var allowMonth = this._getAllowMonths(); var allowMonth = this._getAllowMonths();
if (!BI.contains(allowMonth, month)) { if (!BI.contains(allowMonth, month)) {
month = allowMonth[0]; month = defaultMonth || allowMonth[0];
} }
this.month.setValue(month); this.month.setValue(month);
return month; return month;
@ -187,7 +187,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
setMinDate: function (minDate) { setMinDate: function (minDate) {
this.options.min = minDate; this.options.min = minDate;
this.year.setMinDate(minDate); this.year.setMinDate(minDate);
this._refreshMonth(); this._refreshMonth(this._month);
this._checkLeftValid(); this._checkLeftValid();
this._checkRightValid(); this._checkRightValid();
}, },
@ -195,7 +195,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
setMaxDate: function (maxDate) { setMaxDate: function (maxDate) {
this.options.max = maxDate; this.options.max = maxDate;
this.year.setMaxDate(maxDate); this.year.setMaxDate(maxDate);
this._refreshMonth(); this._refreshMonth(this._month);
this._checkLeftValid(); this._checkLeftValid();
this._checkRightValid(); this._checkRightValid();
}, },
@ -204,7 +204,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
this._year = BI.parseInt(ob.year); this._year = BI.parseInt(ob.year);
this._month = BI.parseInt(ob.month); this._month = BI.parseInt(ob.month);
this.year.setValue(ob.year); this.year.setValue(ob.year);
this._refreshMonth(); this._refreshMonth(this._month);
this.month.setValue(ob.month); this.month.setValue(ob.month);
this._checkLeftValid(); this._checkLeftValid();
this._checkRightValid(); this._checkRightValid();

Loading…
Cancel
Save