Browse Source

BI-80409 时间类型控件全系列可设置是否显示动态日期

es6
windy 3 years ago
parent
commit
959f6d1280
  1. 1
      changelog.md
  2. 2
      src/case/linersegment/linear.segment.js
  3. 4
      src/less/widget/dynamicdatecombo/dynamicdatepopup.less
  4. 4
      src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less
  5. 3
      src/less/widget/year/popup.year.less
  6. 4
      src/less/widget/yearmonth/popup.yearmonth.less
  7. 6
      src/less/widget/yearquarter/popup.yearquarter.less
  8. 33
      src/widget/date/calendar/popup.calendar.date.js
  9. 4
      src/widget/dynamicdate/dynamicdate.combo.js
  10. 13
      src/widget/dynamicdate/dynamicdate.popup.js
  11. 4
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  12. 23
      src/widget/dynamicdatetime/dynamicdatetime.popup.js
  13. 4
      src/widget/timeinterval/dateinterval.js
  14. 4
      src/widget/timeinterval/timeinterval.js
  15. 4
      src/widget/year/combo.year.js
  16. 14
      src/widget/year/popup.year.js
  17. 57
      src/widget/yearmonth/card.static.yearmonth.js
  18. 4
      src/widget/yearmonth/combo.yearmonth.js
  19. 13
      src/widget/yearmonth/popup.yearmonth.js
  20. 4
      src/widget/yearmonthinterval/yearmonthinterval.js
  21. 40
      src/widget/yearquarter/card.static.yearquarter.js
  22. 4
      src/widget/yearquarter/combo.yearquarter.js
  23. 13
      src/widget/yearquarter/popup.yearquarter.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2021-01)
- 日期类型控件全系列可设置是否显示动态日期
- 日期类型控件全系列可设置最大最小日期
- 调整了combo的popup显示位置计算逻辑

2
src/case/linersegment/linear.segment.js

@ -1,7 +1,7 @@
BI.LinearSegment = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-linear-segment bi-split-bottom",
baseCls: "bi-linear-segment",
items: [],
layouts: [{
type: "bi.center"

4
src/less/widget/dynamicdatecombo/dynamicdatepopup.less

@ -1,5 +1,7 @@
@import "../../index";
.bi-dynamic-date-popup{
& .dynamic-date-pane {
min-height: 290px;
}
}

4
src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less

@ -1,5 +1,7 @@
@import "../../index";
.bi-dynamic-date-time-popup{
& .dynamic-date-pane {
min-height: 331px;
}
}

3
src/less/widget/year/popup.year.less

@ -10,6 +10,9 @@
border-left: none;
}
}
& .dynamic-year-pane {
min-height: 186px;
}
}
.bi-theme-dark {

4
src/less/widget/yearmonth/popup.yearmonth.less

@ -1,5 +1,7 @@
@import "../../index";
.bi-year-month-popup{
& .dynamic-year-month-pane {
min-height: 191px;
}
}

6
src/less/widget/yearquarter/popup.yearquarter.less

@ -1,5 +1,7 @@
@import "../../index";
.bi-year-month-popup{
.bi-year-quarter-popup{
& .dynamic-year-quarter-pane {
min-height: 187px;
}
}

33
src/widget/date/calendar/popup.calendar.date.js

@ -4,14 +4,12 @@
* @extends BI.Widget
*/
BI.DateCalendarPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.DateCalendarPopup.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-date-calendar-popup",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
selectedTime: null
});
props: {
baseCls: "bi-date-calendar-popup",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
selectedTime: null
},
_createNav: function (v) {
@ -31,8 +29,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
return calendar;
},
_init: function () {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
render: function () {
var self = this,
o = this.options;
this.today = BI.getDate();
@ -86,14 +83,16 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
BI.createWidget({
type: "bi.absolute",
element: this,
return [{
type: "bi.vertical",
items: [{
el: this.calendar,
left: 5,
right: 5
}, {
hgap: 5,
bgap: 12
}]
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.layout",
cls: "bi-split-top"
@ -103,7 +102,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
left: 0,
right: 0
}]
});
}]
},
_checkMin: function () {

4
src/widget/dynamicdate/dynamicdate.combo.js

@ -12,7 +12,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01",
maxDate: "2099-12-31",
format: "",
allowEdit: true
allowEdit: true,
supportDynamic: true,
},
@ -134,6 +135,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_popup",
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
max: opts.maxDate,

13
src/widget/dynamicdate/dynamicdate.popup.js

@ -7,7 +7,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-dynamic-date-popup",
width: 248,
height: 344
supportDynamic: true,
},
_init: function () {
@ -16,7 +16,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
this.storeValue = {type: BI.DynamicDateCombo.Static};
BI.createWidget({
element: this,
type: "bi.vtape",
type: "bi.vertical",
items: [{
el: this._getTabJson()
}, {
@ -61,9 +61,9 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
}]],
height: 24
},
height: 24
}]
});
this.setValue(opts.value);
@ -73,11 +73,15 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
return {
type: "bi.tab",
logic: {
dynamic: true
},
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
invisible: !o.supportDynamic,
cls: "bi-split-bottom",
height: this.constants.tabHeight,
items: BI.createItems([{
@ -95,6 +99,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
case BI.DynamicDateCombo.Dynamic:
return {
type: "bi.dynamic_date_card",
cls: "dynamic-date-pane",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {

4
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -12,7 +12,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01",
maxDate: "2099-12-31",
format: "",
allowEdit: true
allowEdit: true,
supportDynamic: true
},
@ -139,6 +140,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_time_popup",
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
max: opts.maxDate,

23
src/widget/dynamicdatetime/dynamicdatetime.popup.js

@ -7,7 +7,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-dynamic-date-time-popup",
width: 248,
height: 385
supportDynamic: true,
},
_init: function () {
@ -16,7 +16,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
this.storeValue = {type: BI.DynamicDateCombo.Static};
BI.createWidget({
element: this,
type: "bi.vtape",
type: "bi.vertical",
items: [{
el: this._getTabJson()
}, {
@ -61,9 +61,9 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]],
height: 24
}
}]
});
this.setValue(opts.value);
@ -73,11 +73,15 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
return {
type: "bi.tab",
logic: {
dynamic: true
},
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
invisible: !o.supportDynamic,
cls: "bi-split-bottom",
height: this.constants.tabHeight,
items: BI.createItems([{
@ -95,6 +99,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
case BI.DynamicDateCombo.Dynamic:
return {
type: "bi.dynamic_date_card",
cls: "dynamic-date-pane",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
@ -110,7 +115,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
case BI.DynamicDateCombo.Static:
default:
return {
type: "bi.vtape",
type: "bi.vertical",
items: [{
type: "bi.date_calendar_popup",
behaviors: o.behaviors,
@ -131,9 +136,9 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
cls: "bi-split-top",
ref: function () {
self.timeSelect = this;
}
},
height: 40
},
height: 40
}
}]
};
}

4
src/widget/timeinterval/dateinterval.js

@ -15,7 +15,8 @@ BI.DateInterval = BI.inherit(BI.Single, {
extraCls: "bi-date-interval",
minDate: "1900-01-01",
maxDate: "2099-12-31",
height: 24
height: 24,
supportDynamic: true,
});
},
_init: function () {
@ -68,6 +69,7 @@ BI.DateInterval = BI.inherit(BI.Single, {
var self = this, o = this.options;
var combo = BI.createWidget({
type: "bi.dynamic_date_combo",
supportDynamic: o.supportDynamic,
minDate: o.minDate,
maxDate: o.maxDate,
behaviors: o.behaviors,

4
src/widget/timeinterval/timeinterval.js

@ -15,7 +15,8 @@ BI.TimeInterval = BI.inherit(BI.Single, {
extraCls: "bi-time-interval",
minDate: "1900-01-01",
maxDate: "2099-12-31",
height: 24
height: 24,
supportDynamic: true
});
},
_init: function () {
@ -68,6 +69,7 @@ BI.TimeInterval = BI.inherit(BI.Single, {
var self = this, o = this.options;
var combo = BI.createWidget({
type: "bi.dynamic_date_time_combo",
supportDynamic: o.supportDynamic,
minDate: o.minDate,
maxDate: o.maxDate,
behaviors: o.behaviors,

4
src/widget/year/combo.year.js

@ -5,7 +5,8 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
behaviors: {},
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 22
height: 22,
supportDynamic: true,
},
_init: function () {
@ -62,6 +63,7 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_popup",
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
},

14
src/widget/year/popup.year.js

@ -17,14 +17,14 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, {
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期,
width: 180,
height: 240
supportDynamic: true,
},
render: function () {
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicYearCombo.Static};
return {
type: "bi.vtape",
type: "bi.vertical",
items: [{
el: this._getTabJson()
}, {
@ -69,9 +69,9 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
}]],
height: 24
},
height: 24
}]
};
},
@ -92,12 +92,15 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
return {
type: "bi.tab",
logic: {
dynamic: true
},
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
invisible: !o.supportDynamic,
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year_Fen"),
@ -114,6 +117,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, {
case BI.DynamicYearCombo.Dynamic:
return {
type: "bi.dynamic_year_card",
cls: "dynamic-year-pane",
min: self.options.min,
max: self.options.max,
listeners: [{

57
src/widget/yearmonth/card.static.yearmonth.js

@ -44,6 +44,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, {
type: "bi.vertical",
items: [{
type: "bi.year_picker",
cls: "bi-split-bottom",
min: o.min,
max: o.max,
ref: function () {
@ -63,34 +64,36 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, {
}
}]
}, {
type: "bi.button_group",
cls: "bi-split-top",
behaviors: o.behaviors,
ref: function () {
self.month = this;
el: {
type: "bi.button_group",
behaviors: o.behaviors,
ref: function () {
self.month = this;
},
items: this._createMonths(),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({
dynamic: true
}, {
columns: 2,
rows: 6,
columnSize: [1 / 2, 1 / 2],
rowSize: 25
})), {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}],
value: o.value,
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
self.selectedYear = self.yearPicker.getValue();
self.selectedMonth = this.getValue()[0];
self.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE);
}
}]
},
items: this._createMonths(),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({
dynamic: true
}, {
columns: 2,
rows: 6,
columnSize: [1 / 2, 1 / 2],
rowSize: 25
})), {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}],
value: o.value,
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
self.selectedYear = self.yearPicker.getValue();
self.selectedMonth = this.getValue()[0];
self.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE);
}
}]
vgap: 5
}]
};
},

4
src/widget/yearmonth/combo.yearmonth.js

@ -5,7 +5,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
behaviors: {},
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 22
height: 22,
supportDynamic: true
},
_init: function () {
@ -66,6 +67,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_month_popup",
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
},

13
src/widget/yearmonth/popup.yearmonth.js

@ -17,14 +17,14 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, {
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期,
width: 180,
height: 240
supportDynamic: true,
},
render: function () {
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicYearMonthCombo.Static};
return {
type: "bi.vtape",
type: "bi.vertical",
items: [{
el: this._getTabJson()
}, {
@ -69,9 +69,9 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
}]],
height: 24
},
height: 24
}]
};
},
@ -92,12 +92,16 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
return {
type: "bi.tab",
logic: {
dynamic: true
},
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
invisible: !o.supportDynamic,
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year_Month"),
@ -114,6 +118,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, {
case BI.DynamicYearCombo.Dynamic:
return {
type: "bi.dynamic_year_month_card",
cls: "dynamic-year-month-pane",
min: self.options.min,
max: self.options.max,
listeners: [{

4
src/widget/yearmonthinterval/yearmonthinterval.js

@ -10,7 +10,8 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
props: {
extraCls: "bi-year-month-interval",
minDate: "1900-01-01",
maxDate: "2099-12-31"
maxDate: "2099-12-31",
supportDynamic: true,
},
_init: function () {
@ -64,6 +65,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var self = this, o = this.options;
var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo",
supportDynamic: o.supportDynamic,
minDate: o.minDate,
maxDate: o.maxDate,
behaviors: o.behaviors,

40
src/widget/yearquarter/card.static.yearquarter.js

@ -43,6 +43,7 @@ BI.StaticYearQuarterCard = BI.inherit(BI.Widget, {
type: "bi.vertical",
items: [{
type: "bi.year_picker",
cls: "bi-split-bottom",
ref: function () {
self.yearPicker = this;
},
@ -62,25 +63,28 @@ BI.StaticYearQuarterCard = BI.inherit(BI.Widget, {
}
}]
}, {
type: "bi.button_group",
behaviors: o.behaviors,
ref: function () {
self.quarter = this;
el: {
type: "bi.button_group",
behaviors: o.behaviors,
ref: function () {
self.quarter = this;
},
items: this._createQuarter(),
layouts: [{
type: "bi.vertical",
vgap: 10
}],
value: o.value,
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
self.selectedYear = self.yearPicker.getValue();
self.selectedQuarter = this.getValue()[0];
self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE);
}
}]
},
items: this._createQuarter(),
layouts: [{
type: "bi.vertical",
vgap: 10
}],
value: o.value,
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
self.selectedYear = self.yearPicker.getValue();
self.selectedQuarter = this.getValue()[0];
self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE);
}
}]
vgap: 5
}]
};
},

4
src/widget/yearquarter/combo.yearquarter.js

@ -5,7 +5,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
behaviors: {},
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 22
height: 22,
supportDynamic: true,
},
_init: function () {
@ -61,6 +62,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_quarter_popup",
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
},

13
src/widget/yearquarter/popup.yearquarter.js

@ -10,14 +10,14 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期,
width: 180,
height: 240
supportDynamic: true,
},
render: function () {
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicYearQuarterCombo.Static};
return {
type: "bi.vtape",
type: "bi.vertical",
items: [{
el: this._getTabJson()
}, {
@ -62,9 +62,9 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
}]],
height: 24
},
height: 24
}]
};
},
@ -85,12 +85,16 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
var self = this, o = this.options;
return {
type: "bi.tab",
logic: {
dynamic: true
},
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
invisible: !o.supportDynamic,
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year_Quarter"),
@ -107,6 +111,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
case BI.DynamicYearQuarterCombo.Dynamic:
return {
type: "bi.dynamic_year_quarter_card",
cls: "dynamic-year-quarter-pane",
min: self.options.min,
max: self.options.max,
listeners: [{

Loading…
Cancel
Save