Browse Source

Pull request #1742: BI-80432 fix: 当天日期不在可选范围内无法翻页

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

* commit 'e6b6e9e672d0e689d83dfedc82ce2c8f8d64f15b':
  update
  BI-80432 fix: 当天日期不在可选范围内无法翻页
es6
windy 4 years ago
parent
commit
6d1a706096
  1. 4
      src/less/base/tree/ztree.less
  2. 14
      src/less/core/utils/common.less
  3. 22
      src/widget/date/calendar/popup.year.js

4
src/less/base/tree/ztree.less

@ -35,11 +35,11 @@
vertical-align: top; vertical-align: top;
display: inline-block; display: inline-block;
&:hover { &:hover {
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 10%);
} }
&:active { &:active {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 15%);
} }
} }

14
src/less/core/utils/common.less

@ -685,7 +685,7 @@ textarea {
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-black; color: @color-bi-text-black;
} }
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 10%);
} }
&:active { &:active {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
@ -695,7 +695,7 @@ textarea {
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
} }
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 15%);
} }
&.active { &.active {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
@ -773,7 +773,7 @@ textarea {
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-black; color: @color-bi-text-black;
} }
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 10%);
} }
&:active, &.active { &:active, &.active {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
@ -783,7 +783,7 @@ textarea {
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
} }
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 15%);
} }
&.disabled { &.disabled {
&, &:hover, &:active { &, &:hover, &:active {
@ -812,7 +812,7 @@ textarea {
& .bi-textarea { & .bi-textarea {
color: @color-bi-text; color: @color-bi-text;
} }
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 10%);
} }
&:active, &.active { &:active, &.active {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
@ -822,7 +822,7 @@ textarea {
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
} }
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 15%);
} }
&.disabled { &.disabled {
&, &:hover, &:active { &, &:hover, &:active {
@ -845,7 +845,7 @@ textarea {
// 激活和选中时背景高亮 // 激活和选中时背景高亮
.bi-list-item-select { .bi-list-item-select {
&:hover, &.hover { &:hover, &.hover {
.background-color(@color-bi-background-highlight, 6%); .background-color(@color-bi-background-highlight, 10%);
} }
&:active, &.active { &:active, &.active {
color: @color-bi-text; color: @color-bi-text;

22
src/widget/date/calendar/popup.year.js

@ -71,8 +71,8 @@ BI.YearPopup = BI.inherit(BI.Widget, {
afterCardCreated: function () { afterCardCreated: function () {
this.setValue(self.selectedYear); this.setValue(self.selectedYear);
var calendar = this.getSelectedCard(); var calendar = this.getSelectedCard();
calendar && self.backBtn.setEnable(!calendar.isFrontYear()); calendar && self.backBtn.setEnable(self._checkMinYearValid());
calendar && self.preBtn.setEnable(!calendar.isFinalYear()); calendar && self.preBtn.setEnable(self._checkMaxYearValid());
} }
}); });
@ -87,12 +87,22 @@ BI.YearPopup = BI.inherit(BI.Widget, {
} }
}, },
_checkMinYearValid: function () {
var o = this.options;
return this.selectedYear > BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear();
},
_checkMaxYearValid: function () {
var o = this.options;
return this.selectedYear < BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear();
},
_checkMin: function () { _checkMin: function () {
var calendar = this.navigation.getSelectedCard(); var calendar = this.navigation.getSelectedCard();
if (BI.isNotNull(calendar)) { if (BI.isNotNull(calendar)) {
calendar.setMinDate(this.options.min); calendar.setMinDate(this.options.min);
this.backBtn.setEnable(!calendar.isFrontYear()); this.backBtn.setEnable(this._checkMinYearValid());
this.preBtn.setEnable(!calendar.isFinalYear()); this.preBtn.setEnable(this._checkMaxYearValid());
} }
}, },
@ -100,8 +110,8 @@ BI.YearPopup = BI.inherit(BI.Widget, {
var calendar = this.navigation.getSelectedCard(); var calendar = this.navigation.getSelectedCard();
if (BI.isNotNull(calendar)) { if (BI.isNotNull(calendar)) {
calendar.setMaxDate(this.options.max); calendar.setMaxDate(this.options.max);
this.backBtn.setEnable(!calendar.isFrontYear()); this.backBtn.setEnable(this._checkMinYearValid());
this.preBtn.setEnable(!calendar.isFinalYear()); this.preBtn.setEnable(this._checkMaxYearValid());
} }
}, },

Loading…
Cancel
Save