Browse Source

BI-25602 && BI-25604

master
windy 7 years ago
parent
commit
6e537deefe
  1. 3
      src/base/layer/layer.popup.js
  2. 2
      src/case/calendar/calendar.year.js
  3. 4
      src/css/base/calendar/calendar.css
  4. 4
      src/css/base/view/popupview.css
  5. 4
      src/css/widget/date/calendar/popup.css
  6. 6
      src/less/base/calendar/calendar.year.less
  7. 4
      src/less/base/view/popupview.less
  8. 2
      src/widget/date/calendar/combo.year.date.js
  9. 2
      src/widget/date/calendar/picker.date.js
  10. 2
      src/widget/date/calendar/picker.year.js
  11. 20
      src/widget/date/calendar/popup.calendar.date.js
  12. 5
      src/widget/date/calendar/trigger.triangle.date.js
  13. 34
      src/widget/datepane/card.static.datepane.js
  14. 29
      src/widget/datetimepane/card.static.datetimepane.js
  15. 2
      src/widget/downlist/popup.downlist.js
  16. 58
      src/widget/dynamicdate/dynamicdate.card.js
  17. 1
      src/widget/yearmonth/card.static.yearmonth.js
  18. 2
      src/widget/yearmonth/combo.yearmonth.js

3
src/base/layer/layer.popup.js

@ -17,6 +17,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
bgap: 0, bgap: 0,
vgap: 0, vgap: 0,
hgap: 0, hgap: 0,
innerVGap: 0,
direction: BI.Direction.Top, // 工具栏的方向 direction: BI.Direction.Top, // 工具栏的方向
stopEvent: false, // 是否停止mousedown、mouseup事件 stopEvent: false, // 是否停止mousedown、mouseup事件
stopPropagation: false, // 是否停止mousedown、mouseup向上冒泡 stopPropagation: false, // 是否停止mousedown、mouseup向上冒泡
@ -94,7 +95,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
_createView: function () { _createView: function () {
var o = this.options; var o = this.options;
this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value}); 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; return this.button_group;
}, },

2
src/case/calendar/calendar.year.js

@ -65,7 +65,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
once: false, once: false,
forceSelected: true, forceSelected: true,
height: 24, height: 24,
width: 38, width: 45,
value: td.text, value: td.text,
disabled: td.disabled disabled: td.disabled
}); });

4
src/css/base/calendar/calendar.css

@ -0,0 +1,4 @@
.bi-year-calendar {
padding-top: 5px;
padding-bottom: 5px;
}

4
src/css/base/view/popupview.css

@ -11,6 +11,10 @@
-moz-border-radius: 2px; -moz-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
.bi-popup-view .padding-outer {
padding-top: 5px;
padding-bottom: 5px;
}
.bi-popup-view .list-view-shadow { .bi-popup-view .list-view-shadow {
-webkit-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); -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); -moz-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2);

4
src/css/widget/date/calendar/popup.css

@ -0,0 +1,4 @@
.bi-date-calendar-popup .navigation-header {
padding-left: 10px;
padding-right: 10px;
}

6
src/less/base/calendar/calendar.year.less

@ -0,0 +1,6 @@
@import "../../index";
.bi-year-calendar {
padding-top: 5px;
padding-bottom: 5px;
}

4
src/less/base/view/popupview.less

@ -10,6 +10,10 @@
& .list-view-outer { & .list-view-outer {
.border-radius(2px); .border-radius(2px);
} }
& .padding-outer{
padding-top: 5px;
padding-bottom: 5px;
}
& .list-view-shadow { & .list-view-shadow {
.box-shadow(0 1px 5px 0, fade(@color-bi-background-black, 20)); .box-shadow(0 1px 5px 0, fade(@color-bi-background-black, 20));
} }

2
src/widget/date/calendar/combo.year.date.js

@ -45,7 +45,7 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, {
isNeedAdjustWidth: false, isNeedAdjustWidth: false,
el: this.trigger, el: this.trigger,
popup: { popup: {
minWidth: 85, minWidth: 100,
stopPropagation: false, stopPropagation: false,
el: this.popup el: this.popup
} }

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

@ -7,7 +7,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.DatePicker.superclass._defaultConfig.apply(this, arguments); var conf = BI.DatePicker.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: "bi-date-picker bi-background", baseCls: "bi-date-picker",
height: 40, height: 40,
min: "1900-01-01", // 最小日期 min: "1900-01-01", // 最小日期
max: "2099-12-31" // 最大日期 max: "2099-12-31" // 最大日期

2
src/widget/date/calendar/picker.year.js

@ -7,7 +7,7 @@ BI.YearPicker = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.YearPicker.superclass._defaultConfig.apply(this, arguments); var conf = BI.YearPicker.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: "bi-year-picker bi-background", baseCls: "bi-year-picker",
behaviors: {}, behaviors: {},
height: 40, height: 40,
min: "1900-01-01", // 最小日期 min: "1900-01-01", // 最小日期

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

@ -53,7 +53,6 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
direction: "top", direction: "top",
element: this,
logic: { logic: {
dynamic: true dynamic: true
}, },
@ -81,6 +80,25 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
self.setValue(self.selectedTime); self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE); 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) { setValue: function (timeOb) {

5
src/widget/date/calendar/trigger.triangle.date.js

@ -42,7 +42,10 @@ BI.DateTriangleTrigger = BI.inherit(BI.Trigger, {
type: "bi.center_adapt", type: "bi.center_adapt",
width: 50, width: 50,
height: c.height, height: c.height,
items: [this.text, this.icon] items: [{
el: this.text,
rgap: 10
}, this.icon]
}] }]
}); });
}, },

34
src/widget/datepane/card.static.datepane.js

@ -48,11 +48,10 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
}); });
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
direction: "top", direction: "custom",
element: this, // logic: {
logic: { // dynamic: false
dynamic: false // },
},
type: "bi.navigation", type: "bi.navigation",
tab: this.datePicker, tab: this.datePicker,
cardCreator: BI.bind(this._createNav, this) cardCreator: BI.bind(this._createNav, this)
@ -65,6 +64,31 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
}); });
this.setValue(o.selectedTime); 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) { _createNav: function (v) {

29
src/widget/datetimepane/card.static.datetimepane.js

@ -46,10 +46,10 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
}); });
this.calendar = BI.createWidget({ this.calendar = BI.createWidget({
direction: "top", direction: "custom",
logic: { // logic: {
dynamic: false // dynamic: false
}, // },
type: "bi.navigation", type: "bi.navigation",
tab: this.datePicker, tab: this.datePicker,
cardCreator: BI.bind(this._createNav, this) cardCreator: BI.bind(this._createNav, this)
@ -64,7 +64,11 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
BI.createWidget({ BI.createWidget({
type: "bi.vtape", type: "bi.vtape",
element: this, element: this,
items: [this.calendar, { hgap: 10,
items: [{
el: this.datePicker,
height: 40
}, this.calendar, {
el: { el: {
type: "bi.dynamic_date_time_select", type: "bi.dynamic_date_time_select",
ref: function () { ref: function () {
@ -81,6 +85,21 @@ BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
height: 40 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); this.setValue(o.selectedTime);
}, },

2
src/widget/downlist/popup.downlist.js

@ -106,7 +106,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
}] }]
}, },
vgap: 5, innerVGap: 5,
maxHeight: 378 maxHeight: 378
}; };
item.el.childValues = []; item.el.childValues = [];

58
src/widget/dynamicdate/dynamicdate.card.js

@ -14,15 +14,18 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
type: "bi.label", type: "bi.label",
text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"), text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"),
textAlign: "left", textAlign: "left",
height: 24, height: 12,
lgap: 10 lgap: 10
} },
tgap: 10,
bgap: 5
}, { }, {
type: "bi.button_group", type: "bi.button_group",
ref: function () { ref: function () {
self.checkgroup = this; self.checkgroup = this;
}, },
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
lgap: 4,
value: [BI.DynamicDateCard.TYPE.YEAR], value: [BI.DynamicDateCard.TYPE.YEAR],
items: BI.createItems([{ items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year"), text: BI.i18nText("BI-Basic_Year"),
@ -46,7 +49,8 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
} }
}), }),
layouts: [{ layouts: [{
type: "bi.left" type: "bi.left",
rgap: 4
}], }],
listeners: [{ listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE, eventName: BI.ButtonGroup.EVENT_CHANGE,
@ -82,29 +86,33 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
}] }]
}, { }, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
lgap: 2,
items: [{ items: [{
type: "bi.multi_select_item", el: {
ref: function () { type: "bi.multi_select_item",
self.workDayBox = this; ref: function () {
}, self.workDayBox = this;
logic: { },
dynamic: true logic: {
}, dynamic: true
text: BI.i18nText("BI-Basic_Work_Day"), },
value: BI.DynamicDateCard.TYPE.WORK_DAY, text: BI.i18nText("BI-Basic_Work_Day"),
listeners: [{ value: BI.DynamicDateCard.TYPE.WORK_DAY,
eventName: BI.MultiSelectItem.EVENT_CHANGE, listeners: [{
action: function () { eventName: BI.MultiSelectItem.EVENT_CHANGE,
if(this.isSelected()) { action: function () {
self.checkgroup.setValue(); 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 },
}]) : []); bgap: 5
self.position = BI.DynamicDateCard.OFFSET.CURRENT;
self.fireEvent("EVENT_CHANGE");
}
}]
}], }],
ref: function () { ref: function () {
self.workDay = this; self.workDay = this;
@ -119,7 +127,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
}, },
layouts: [{ layouts: [{
type: "bi.vertical", type: "bi.vertical",
vgap: 10, bgap: 10,
hgap: 10 hgap: 10
}] }]
}] }]

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

@ -56,6 +56,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, {
}] }]
}, { }, {
type: "bi.button_group", type: "bi.button_group",
cls: "bi-border-top",
behaviors: o.behaviors, behaviors: o.behaviors,
ref: function () { ref: function () {
self.month = this; self.month = this;

2
src/widget/yearmonth/combo.yearmonth.js

@ -60,7 +60,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: false, isNeedAdjustWidth: false,
el: this.trigger, el: this.trigger,
popup: { popup: {
minWidth: 85, minWidth: 100,
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",

Loading…
Cancel
Save