From 6e537deefe113fa18005fc109688d2d4a63630bc Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 4 Jul 2018 11:42:30 +0800 Subject: [PATCH] BI-25602 && BI-25604 --- src/base/layer/layer.popup.js | 3 +- src/case/calendar/calendar.year.js | 2 +- src/css/base/calendar/calendar.css | 4 ++ src/css/base/view/popupview.css | 4 ++ src/css/widget/date/calendar/popup.css | 4 ++ src/less/base/calendar/calendar.year.less | 6 ++ src/less/base/view/popupview.less | 4 ++ src/widget/date/calendar/combo.year.date.js | 2 +- src/widget/date/calendar/picker.date.js | 2 +- src/widget/date/calendar/picker.year.js | 2 +- .../date/calendar/popup.calendar.date.js | 20 ++++++- .../date/calendar/trigger.triangle.date.js | 5 +- src/widget/datepane/card.static.datepane.js | 34 +++++++++-- .../datetimepane/card.static.datetimepane.js | 29 ++++++++-- src/widget/downlist/popup.downlist.js | 2 +- src/widget/dynamicdate/dynamicdate.card.js | 58 +++++++++++-------- src/widget/yearmonth/card.static.yearmonth.js | 1 + src/widget/yearmonth/combo.yearmonth.js | 2 +- 18 files changed, 140 insertions(+), 44 deletions(-) create mode 100644 src/css/base/calendar/calendar.css create mode 100644 src/css/widget/date/calendar/popup.css create mode 100644 src/less/base/calendar/calendar.year.less diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index b7f964db3..8366e36ed 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -17,6 +17,7 @@ BI.PopupView = BI.inherit(BI.Widget, { bgap: 0, vgap: 0, hgap: 0, + innerVGap: 0, direction: BI.Direction.Top, // 工具栏的方向 stopEvent: false, // 是否停止mousedown、mouseup事件 stopPropagation: false, // 是否停止mousedown、mouseup向上冒泡 @@ -94,7 +95,7 @@ BI.PopupView = BI.inherit(BI.Widget, { _createView: function () { var o = this.options; this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value}); - this.button_group.element.css({"min-height": o.minHeight + "px"}); + this.button_group.element.css({"min-height": o.minHeight + "px", "padding-top": o.innerVGap + "px", "padding-bottom": o.innerVGap + "px"}); return this.button_group; }, diff --git a/src/case/calendar/calendar.year.js b/src/case/calendar/calendar.year.js index 63afac280..9abbae46e 100644 --- a/src/case/calendar/calendar.year.js +++ b/src/case/calendar/calendar.year.js @@ -65,7 +65,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, { once: false, forceSelected: true, height: 24, - width: 38, + width: 45, value: td.text, disabled: td.disabled }); diff --git a/src/css/base/calendar/calendar.css b/src/css/base/calendar/calendar.css new file mode 100644 index 000000000..ada2746c3 --- /dev/null +++ b/src/css/base/calendar/calendar.css @@ -0,0 +1,4 @@ +.bi-year-calendar { + padding-top: 5px; + padding-bottom: 5px; +} diff --git a/src/css/base/view/popupview.css b/src/css/base/view/popupview.css index bb4ae6c3b..cf26a3613 100644 --- a/src/css/base/view/popupview.css +++ b/src/css/base/view/popupview.css @@ -11,6 +11,10 @@ -moz-border-radius: 2px; border-radius: 2px; } +.bi-popup-view .padding-outer { + padding-top: 5px; + padding-bottom: 5px; +} .bi-popup-view .list-view-shadow { -webkit-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); -moz-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); diff --git a/src/css/widget/date/calendar/popup.css b/src/css/widget/date/calendar/popup.css new file mode 100644 index 000000000..bb8f7bea1 --- /dev/null +++ b/src/css/widget/date/calendar/popup.css @@ -0,0 +1,4 @@ +.bi-date-calendar-popup .navigation-header { + padding-left: 10px; + padding-right: 10px; +} diff --git a/src/less/base/calendar/calendar.year.less b/src/less/base/calendar/calendar.year.less new file mode 100644 index 000000000..47650c671 --- /dev/null +++ b/src/less/base/calendar/calendar.year.less @@ -0,0 +1,6 @@ +@import "../../index"; + +.bi-year-calendar { + padding-top: 5px; + padding-bottom: 5px; +} \ No newline at end of file diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index cd1697eb1..c5ae86e4b 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -10,6 +10,10 @@ & .list-view-outer { .border-radius(2px); } + & .padding-outer{ + padding-top: 5px; + padding-bottom: 5px; + } & .list-view-shadow { .box-shadow(0 1px 5px 0, fade(@color-bi-background-black, 20)); } diff --git a/src/widget/date/calendar/combo.year.date.js b/src/widget/date/calendar/combo.year.date.js index 94b54edc6..e5eec68a3 100644 --- a/src/widget/date/calendar/combo.year.date.js +++ b/src/widget/date/calendar/combo.year.date.js @@ -45,7 +45,7 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, { isNeedAdjustWidth: false, el: this.trigger, popup: { - minWidth: 85, + minWidth: 100, stopPropagation: false, el: this.popup } diff --git a/src/widget/date/calendar/picker.date.js b/src/widget/date/calendar/picker.date.js index 6aed3e1ea..b61a01ec5 100644 --- a/src/widget/date/calendar/picker.date.js +++ b/src/widget/date/calendar/picker.date.js @@ -7,7 +7,7 @@ BI.DatePicker = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.DatePicker.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-date-picker bi-background", + baseCls: "bi-date-picker", height: 40, min: "1900-01-01", // 最小日期 max: "2099-12-31" // 最大日期 diff --git a/src/widget/date/calendar/picker.year.js b/src/widget/date/calendar/picker.year.js index 5fe5deef2..2fb62d79d 100644 --- a/src/widget/date/calendar/picker.year.js +++ b/src/widget/date/calendar/picker.year.js @@ -7,7 +7,7 @@ BI.YearPicker = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.YearPicker.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-year-picker bi-background", + baseCls: "bi-year-picker", behaviors: {}, height: 40, min: "1900-01-01", // 最小日期 diff --git a/src/widget/date/calendar/popup.calendar.date.js b/src/widget/date/calendar/popup.calendar.date.js index f76862f9e..73fc55c26 100644 --- a/src/widget/date/calendar/popup.calendar.date.js +++ b/src/widget/date/calendar/popup.calendar.date.js @@ -53,7 +53,6 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { this.calendar = BI.createWidget({ direction: "top", - element: this, logic: { dynamic: true }, @@ -81,6 +80,25 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { self.setValue(self.selectedTime); self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE); }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.calendar, + left: 10, + right: 10 + }, { + el: { + type: "bi.layout", + cls: "bi-border-top" + }, + height: 1, + top: 40, + left: 0, + right: 0 + }] + }); }, setValue: function (timeOb) { diff --git a/src/widget/date/calendar/trigger.triangle.date.js b/src/widget/date/calendar/trigger.triangle.date.js index c1282ede2..ff803a36b 100644 --- a/src/widget/date/calendar/trigger.triangle.date.js +++ b/src/widget/date/calendar/trigger.triangle.date.js @@ -42,7 +42,10 @@ BI.DateTriangleTrigger = BI.inherit(BI.Trigger, { type: "bi.center_adapt", width: 50, height: c.height, - items: [this.text, this.icon] + items: [{ + el: this.text, + rgap: 10 + }, this.icon] }] }); }, diff --git a/src/widget/datepane/card.static.datepane.js b/src/widget/datepane/card.static.datepane.js index f5a0f9822..dc9e2ddbd 100644 --- a/src/widget/datepane/card.static.datepane.js +++ b/src/widget/datepane/card.static.datepane.js @@ -48,11 +48,10 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, { }); this.calendar = BI.createWidget({ - direction: "top", - element: this, - logic: { - dynamic: false - }, + direction: "custom", + // logic: { + // dynamic: false + // }, type: "bi.navigation", tab: this.datePicker, cardCreator: BI.bind(this._createNav, this) @@ -65,6 +64,31 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, { }); this.setValue(o.selectedTime); + BI.createWidget({ + type: "bi.vtape", + element: this, + items: [{ + el: this.datePicker, + height: 40 + }, this.calendar], + hgap: 10 + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.layout", + cls: "bi-border-top" + }, + height: 1, + top: 40, + left: 0, + right: 0 + }] + }); + }, _createNav: function (v) { diff --git a/src/widget/datetimepane/card.static.datetimepane.js b/src/widget/datetimepane/card.static.datetimepane.js index 8aef2d0af..574690750 100644 --- a/src/widget/datetimepane/card.static.datetimepane.js +++ b/src/widget/datetimepane/card.static.datetimepane.js @@ -46,10 +46,10 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, { }); this.calendar = BI.createWidget({ - direction: "top", - logic: { - dynamic: false - }, + direction: "custom", + // logic: { + // dynamic: false + // }, type: "bi.navigation", tab: this.datePicker, cardCreator: BI.bind(this._createNav, this) @@ -64,7 +64,11 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, { BI.createWidget({ type: "bi.vtape", element: this, - items: [this.calendar, { + hgap: 10, + items: [{ + el: this.datePicker, + height: 40 + }, this.calendar, { el: { type: "bi.dynamic_date_time_select", ref: function () { @@ -81,6 +85,21 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, { height: 40 }] }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.layout", + cls: "bi-border-top" + }, + height: 1, + top: 40, + left: 0, + right: 0 + }] + }); this.setValue(o.selectedTime); }, diff --git a/src/widget/downlist/popup.downlist.js b/src/widget/downlist/popup.downlist.js index 1de602777..ef8e16992 100644 --- a/src/widget/downlist/popup.downlist.js +++ b/src/widget/downlist/popup.downlist.js @@ -106,7 +106,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { }] }, - vgap: 5, + innerVGap: 5, maxHeight: 378 }; item.el.childValues = []; diff --git a/src/widget/dynamicdate/dynamicdate.card.js b/src/widget/dynamicdate/dynamicdate.card.js index b9e630c2e..5c746aeeb 100644 --- a/src/widget/dynamicdate/dynamicdate.card.js +++ b/src/widget/dynamicdate/dynamicdate.card.js @@ -14,15 +14,18 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { type: "bi.label", text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"), textAlign: "left", - height: 24, + height: 12, lgap: 10 - } + }, + tgap: 10, + bgap: 5 }, { type: "bi.button_group", ref: function () { self.checkgroup = this; }, chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, + lgap: 4, value: [BI.DynamicDateCard.TYPE.YEAR], items: BI.createItems([{ text: BI.i18nText("BI-Basic_Year"), @@ -46,7 +49,8 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { } }), layouts: [{ - type: "bi.left" + type: "bi.left", + rgap: 4 }], listeners: [{ eventName: BI.ButtonGroup.EVENT_CHANGE, @@ -82,29 +86,33 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { }] }, { type: "bi.vertical_adapt", + lgap: 2, items: [{ - type: "bi.multi_select_item", - ref: function () { - self.workDayBox = this; - }, - logic: { - dynamic: true - }, - text: BI.i18nText("BI-Basic_Work_Day"), - value: BI.DynamicDateCard.TYPE.WORK_DAY, - listeners: [{ - eventName: BI.MultiSelectItem.EVENT_CHANGE, - action: function () { - if(this.isSelected()) { - self.checkgroup.setValue(); + el: { + type: "bi.multi_select_item", + ref: function () { + self.workDayBox = this; + }, + logic: { + dynamic: true + }, + text: BI.i18nText("BI-Basic_Work_Day"), + value: BI.DynamicDateCard.TYPE.WORK_DAY, + listeners: [{ + eventName: BI.MultiSelectItem.EVENT_CHANGE, + action: function () { + if(this.isSelected()) { + self.checkgroup.setValue(); + } + self.resultPane.populate(this.isSelected() ? self._getParamJson([{ + dateType: BI.DynamicDateCard.TYPE.WORK_DAY + }]) : []); + self.position = BI.DynamicDateCard.OFFSET.CURRENT; + self.fireEvent("EVENT_CHANGE"); } - self.resultPane.populate(this.isSelected() ? self._getParamJson([{ - dateType: BI.DynamicDateCard.TYPE.WORK_DAY - }]) : []); - self.position = BI.DynamicDateCard.OFFSET.CURRENT; - self.fireEvent("EVENT_CHANGE"); - } - }] + }] + }, + bgap: 5 }], ref: function () { self.workDay = this; @@ -119,7 +127,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { }, layouts: [{ type: "bi.vertical", - vgap: 10, + bgap: 10, hgap: 10 }] }] diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/src/widget/yearmonth/card.static.yearmonth.js index 0571ad823..64c8b62ce 100644 --- a/src/widget/yearmonth/card.static.yearmonth.js +++ b/src/widget/yearmonth/card.static.yearmonth.js @@ -56,6 +56,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { }] }, { type: "bi.button_group", + cls: "bi-border-top", behaviors: o.behaviors, ref: function () { self.month = this; diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index 2b9c6753c..67d27f798 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/src/widget/yearmonth/combo.yearmonth.js @@ -60,7 +60,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { isNeedAdjustWidth: false, el: this.trigger, popup: { - minWidth: 85, + minWidth: 100, stopPropagation: false, el: { type: "bi.dynamic_year_month_popup",