From 959f6d1280aaac175f0f7b3587a1022b4a040df2 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 18 Jan 2021 15:54:44 +0800 Subject: [PATCH] =?UTF-8?q?BI-80409=20=E6=97=B6=E9=97=B4=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=85=A8=E7=B3=BB=E5=88=97=E5=8F=AF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/case/linersegment/linear.segment.js | 2 +- .../dynamicdatecombo/dynamicdatepopup.less | 4 +- .../dynamicdatetimepopup.less | 4 +- src/less/widget/year/popup.year.less | 3 + .../widget/yearmonth/popup.yearmonth.less | 4 +- .../widget/yearquarter/popup.yearquarter.less | 6 +- .../date/calendar/popup.calendar.date.js | 33 ++++++----- src/widget/dynamicdate/dynamicdate.combo.js | 4 +- src/widget/dynamicdate/dynamicdate.popup.js | 13 +++-- .../dynamicdatetime/dynamicdatetime.combo.js | 4 +- .../dynamicdatetime/dynamicdatetime.popup.js | 23 +++++--- src/widget/timeinterval/dateinterval.js | 4 +- src/widget/timeinterval/timeinterval.js | 4 +- src/widget/year/combo.year.js | 4 +- src/widget/year/popup.year.js | 14 +++-- src/widget/yearmonth/card.static.yearmonth.js | 57 ++++++++++--------- src/widget/yearmonth/combo.yearmonth.js | 4 +- src/widget/yearmonth/popup.yearmonth.js | 13 +++-- .../yearmonthinterval/yearmonthinterval.js | 4 +- .../yearquarter/card.static.yearquarter.js | 40 +++++++------ src/widget/yearquarter/combo.yearquarter.js | 4 +- src/widget/yearquarter/popup.yearquarter.js | 13 +++-- 23 files changed, 160 insertions(+), 102 deletions(-) diff --git a/changelog.md b/changelog.md index 1455a9f726..e83771b879 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2021-01) +- 日期类型控件全系列可设置是否显示动态日期 - 日期类型控件全系列可设置最大最小日期 - 调整了combo的popup显示位置计算逻辑 diff --git a/src/case/linersegment/linear.segment.js b/src/case/linersegment/linear.segment.js index 22cc5fcd96..f0060dce3c 100644 --- a/src/case/linersegment/linear.segment.js +++ b/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" diff --git a/src/less/widget/dynamicdatecombo/dynamicdatepopup.less b/src/less/widget/dynamicdatecombo/dynamicdatepopup.less index 0ba3303a56..81b8893a2b 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatepopup.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatepopup.less @@ -1,5 +1,7 @@ @import "../../index"; .bi-dynamic-date-popup{ - + & .dynamic-date-pane { + min-height: 290px; + } } \ No newline at end of file diff --git a/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less b/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less index 8ccb9a7d31..81a06aff7b 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less @@ -1,5 +1,7 @@ @import "../../index"; .bi-dynamic-date-time-popup{ - + & .dynamic-date-pane { + min-height: 331px; + } } \ No newline at end of file diff --git a/src/less/widget/year/popup.year.less b/src/less/widget/year/popup.year.less index 26bdd44517..a64116b657 100644 --- a/src/less/widget/year/popup.year.less +++ b/src/less/widget/year/popup.year.less @@ -10,6 +10,9 @@ border-left: none; } } + & .dynamic-year-pane { + min-height: 186px; + } } .bi-theme-dark { diff --git a/src/less/widget/yearmonth/popup.yearmonth.less b/src/less/widget/yearmonth/popup.yearmonth.less index 3d9fa73f98..614fbd4c8e 100644 --- a/src/less/widget/yearmonth/popup.yearmonth.less +++ b/src/less/widget/yearmonth/popup.yearmonth.less @@ -1,5 +1,7 @@ @import "../../index"; .bi-year-month-popup{ - + & .dynamic-year-month-pane { + min-height: 191px; + } } \ No newline at end of file diff --git a/src/less/widget/yearquarter/popup.yearquarter.less b/src/less/widget/yearquarter/popup.yearquarter.less index 3d9fa73f98..37c00f9dca 100644 --- a/src/less/widget/yearquarter/popup.yearquarter.less +++ b/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; + } } \ No newline at end of file diff --git a/src/widget/date/calendar/popup.calendar.date.js b/src/widget/date/calendar/popup.calendar.date.js index 2bbd04f7cc..9ddf996494 100644 --- a/src/widget/date/calendar/popup.calendar.date.js +++ b/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 () { diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index b9e9fdf8c9..b313f814fd 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/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, diff --git a/src/widget/dynamicdate/dynamicdate.popup.js b/src/widget/dynamicdate/dynamicdate.popup.js index 246b6514bd..30d8e955c8 100644 --- a/src/widget/dynamicdate/dynamicdate.popup.js +++ b/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 () { diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 9dbc16b081..f2b0f2c124 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/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, diff --git a/src/widget/dynamicdatetime/dynamicdatetime.popup.js b/src/widget/dynamicdatetime/dynamicdatetime.popup.js index b086e768f3..1bb4047173 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.popup.js +++ b/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 + } }] }; } diff --git a/src/widget/timeinterval/dateinterval.js b/src/widget/timeinterval/dateinterval.js index d11c46af71..69a5b9c873 100644 --- a/src/widget/timeinterval/dateinterval.js +++ b/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, diff --git a/src/widget/timeinterval/timeinterval.js b/src/widget/timeinterval/timeinterval.js index 43ee571f00..14367889ff 100644 --- a/src/widget/timeinterval/timeinterval.js +++ b/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, diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index 5778694013..3cbcaf29cf 100644 --- a/src/widget/year/combo.year.js +++ b/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; }, diff --git a/src/widget/year/popup.year.js b/src/widget/year/popup.year.js index 2be398e5f0..81667384a0 100644 --- a/src/widget/year/popup.year.js +++ b/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: [{ diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/src/widget/yearmonth/card.static.yearmonth.js index 4274a923a8..26e8c29ded 100644 --- a/src/widget/yearmonth/card.static.yearmonth.js +++ b/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 }] }; }, diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index 7b0d596069..cb8d480849 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/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; }, diff --git a/src/widget/yearmonth/popup.yearmonth.js b/src/widget/yearmonth/popup.yearmonth.js index f2ffe7164f..c1dc0d058a 100644 --- a/src/widget/yearmonth/popup.yearmonth.js +++ b/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: [{ diff --git a/src/widget/yearmonthinterval/yearmonthinterval.js b/src/widget/yearmonthinterval/yearmonthinterval.js index 5a5fc436f8..8b05ac479c 100644 --- a/src/widget/yearmonthinterval/yearmonthinterval.js +++ b/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, diff --git a/src/widget/yearquarter/card.static.yearquarter.js b/src/widget/yearquarter/card.static.yearquarter.js index fbc1d2ff03..5fdd231ff7 100644 --- a/src/widget/yearquarter/card.static.yearquarter.js +++ b/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 }] }; }, diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index 384555c145..8e599e22b5 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/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; }, diff --git a/src/widget/yearquarter/popup.yearquarter.js b/src/widget/yearquarter/popup.yearquarter.js index 41883314fd..6b94d92842 100644 --- a/src/widget/yearquarter/popup.yearquarter.js +++ b/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: [{