guy 7 years ago
parent
commit
c380daec83
  1. 16
      bi/base.js
  2. 209
      bi/case.js
  3. 77
      bi/core.js
  4. 103
      bi/widget.js
  5. 35
      demo/js/case/combo/demo.icon_text_value_combo.js
  6. 5
      demo/js/case/combo/demo.text_value_combo.js
  7. 4
      demo/js/config/case.js
  8. 4
      demo/js/config/core.js
  9. 56
      demo/js/core/popup/demo.popover.js
  10. 42
      demo/js/core/popup/demo.popup_view.js
  11. 45
      demo/js/core/popup/demo.searcher_view.js
  12. 16
      dist/base.js
  13. 405
      dist/bundle.js
  14. 87
      dist/bundle.min.js
  15. 209
      dist/case.js
  16. 77
      dist/core.js
  17. 189
      dist/demo.js
  18. 103
      dist/widget.js
  19. 16
      src/base/formula/formulaeditor.js
  20. 14
      src/case/calendar/calendar.js
  21. 6
      src/case/calendar/calendar.year.js
  22. 62
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  23. 59
      src/case/combo/icontextvaluecombo/popup.icontextvalue.js
  24. 16
      src/case/trigger/trigger.icon.text.js
  25. 55
      src/case/trigger/trigger.icon.text.select.js
  26. 4
      src/core/base.js
  27. 4
      src/core/controller/controller.tooltips.js
  28. 69
      src/core/proto/date.js
  29. 4
      src/widget/date/calendar/picker.date.js
  30. 2
      src/widget/date/calendar/popup.calendar.date.js
  31. 28
      src/widget/date/trigger.date.js
  32. 4
      src/widget/datepane/datepane.js
  33. 2
      src/widget/datetime/datetime.combo.js
  34. 4
      src/widget/datetime/datetime.popup.js
  35. 4
      src/widget/datetime/datetime.trigger.js
  36. 7
      src/widget/intervalslider/intervalslider.js
  37. 34
      src/widget/multidate/abstract.multidate.datepane.js
  38. 4
      src/widget/multidate/multidate.combo.js
  39. 6
      src/widget/multidate/multidate.popup.js
  40. 4
      src/widget/year/popup.year.js

16
bi/base.js

@ -14363,7 +14363,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
});
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) {
@ -14454,7 +14456,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");
@ -14505,7 +14508,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
var dId = fieldMap[value.substr(i.from, i.to - i.from)];
//因为插入字段的时候首尾加了不可见字符,所以首尾缩进一个字符
var dId = fieldMap[value.substr(i.from + 1, i.to - i.from - 2)];
if (!fields.contains(dId)) {
fields.push(dId);
}
@ -14544,8 +14548,10 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
switch (i.marker.className) {
case "fieldName":
var fieldNameLength = i.to - i.from;
var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)];
value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length);
var start = i.from + num + 1;
var end = fieldNameLength - 2;
var fieldId = fieldMap[value.substr(start, end)];
value = value.substr(0, i.from + num) + "$\{" + fieldId + "\}" + value.substr(i.to + num, value.length);
num += fieldId.length - fieldNameLength + 3;
break;
}

209
bi/case.js

@ -1640,7 +1640,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = new Date();
var self = this, o = this.options, log = {}, De = Date.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
@ -1750,7 +1750,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(-1 * (day + 1));
@ -1759,7 +1759,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(42 - day);
@ -1782,14 +1782,14 @@ BI.Calendar = BI.inherit(BI.Widget, {
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = new Date().getFullYear();
var month = new Date().getMonth();
var year = Date.getDate().getFullYear();
var month = Date.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
return page;
},
getDateJSONByPage: function(v){
var months = new Date().getMonth();
var months = Date.getDate().getMonth();
var page = v;
//对当前page做偏移,使到当前年初
@ -1801,7 +1801,7 @@ BI.extend(BI.Calendar, {
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: new Date().getFullYear() + year,
year: Date.getDate().getFullYear() + year,
month: month
}
}
@ -1847,7 +1847,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = new Date().getFullYear();
this.currentYear = Date.getDate().getFullYear();
var years = this._yearCreator(o.year || this.currentYear);
//纵向排列年
@ -1934,7 +1934,7 @@ BI.extend(BI.YearCalendar, {
//获取显示的第一年
getStartYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
@ -1943,7 +1943,7 @@ BI.extend(BI.YearCalendar, {
},
getPageByYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}
@ -5454,6 +5454,125 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, {
});
BI.IconComboTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_combo_trigger", BI.IconComboTrigger);/**
* Created by Windy on 2017/12/12.
* combo : icon + text + icon, popup : icon + text
*/
BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
text: "",
el: {}
})
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
text: o.text
});
this.popup = BI.createWidget({
type: "bi.icon_text_value_combo_popup",
items: o.items
});
this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCombo.hideView();
self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE, arguments);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
},
setValue: function (v) {
this.textIconCombo.setValue(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},
populate: function (items) {
this.options.items = items;
this.textIconCombo.populate(items);
}
});
BI.IconTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo", BI.IconTextValueCombo);/**
* Created by Windy on 2017/12/12.
*/
BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-icon-popup"
});
},
_init: function () {
BI.IconTextValueComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_icon_text_item",
height: 30
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{
type: "bi.vertical"
}]
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE, val, obj);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup]
});
},
populate: function (items) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
items = BI.createItems(items, {
type: "bi.single_select_icon_text_item",
height: 30
});
this.popup.populate(items);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/**
* 单选combo
*
* @class BI.StaticCombo
@ -13532,6 +13651,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({
element: this,
type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.icon_change_button",
@ -13559,7 +13681,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
},
setText: function (text) {
@ -13568,6 +13703,60 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}
});
BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/**
* Created by Windy on 2017/12/12.
*/
BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border",
height: 24
});
},
_init: function () {
this.options.height -= 2;
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.icon_text_trigger",
element: this,
height: o.height
});
if (BI.isKey(o.text)) {
this.setValue(o.text);
}
},
setValue: function (vals) {
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result;
var items = BI.Tree.transformToArrayFormat(this.options.items);
BI.any(items, function (i, item) {
if (BI.deepContains(vals, item.value)) {
result = {
text: item.text || item.value,
iconClass: item.iconClass
};
return true;
}
});
if (BI.isNotNull(result)) {
this.trigger.setText(result.text);
this.trigger.setIcon(result.iconClass);
} else {
this.trigger.setText(o.text);
this.trigger.setIcon("");
}
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.select_icon_text_trigger", BI.SelectIconTextTrigger);/**
* 文字trigger
*
* Created by GUY on 2015/9/15.

77
bi/core.js

@ -11695,7 +11695,7 @@ if (!window.BI) {
// Date
if (type === '[object Date]') {
return new Date(obj.getTime());
return Date.getDate(obj.getTime());
}
var i, clone, key;
@ -11925,7 +11925,7 @@ if (!window.BI) {
if (Date.now) {
return Date.now();
} else {
return new Date().getTime();
return Date.getDate().getTime();
}
}
}
@ -18776,9 +18776,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
tooltip.visible();
tooltip.element.height(tooltip.element[0].scrollHeight);
this.showingTips[name] = true;
var x = e.pageX || e.clientX, y = (e.pageY || e.clientY) + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
x -= tooltip.element.outerWidth();
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
@ -20875,20 +20875,21 @@ Date.prototype.getMonthDays = function (month) {
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
return Date.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var now = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = Date.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
};
/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function () {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var d = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
//周一是一周第一天
var week = d.getDay();
if (this.getMonth() === 0 && this.getDate() <= week) {
return 1;
@ -20904,19 +20905,23 @@ Date.prototype.getWeekNumber = function () {
return offset;
};
Date.prototype.getQuarter = function () {
return Math.floor(this.getMonth() / 3) + 1;
};
//离当前时间多少天的时间
Date.prototype.getOffsetDate = function (offset) {
return new Date(this.getTime() + offset * 864e5);
return Date.getDate(this.getTime() + offset * 864e5);
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20940,32 +20945,32 @@ Date.prototype.getQuarterStartMonth = function () {
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20990,9 +20995,9 @@ Date.prototype.getQuarterStartMonth = function () {
//指定日期n个月之前或之后的日期
Date.prototype.getOffsetMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var day = dt.getDate();
var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
var monthDay = Date.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
if (day > monthDay) {
day = monthDay;
}
@ -21015,31 +21020,31 @@ Date.prototype.getWeekEndDate = function () {
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
return Date.getDate(utc + offset);
};
/** Checks date and time equality */
@ -21054,7 +21059,7 @@ Date.prototype.equalsTo = function (date) {
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = new Date(date);
var tmp = Date.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
@ -21066,6 +21071,7 @@ Date.prototype.print = function (str) {
var d = this.getDate();
var y = this.getFullYear();
var wn = this.getWeekNumber();
var qr = this.getQuarter();
var w = this.getDay();
var s = {};
var hr = this.getHours();
@ -21112,6 +21118,7 @@ Date.prototype.print = function (str) {
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%Q"] = qr;
var re = /%./g;
if (!BI.isKhtml()) {
@ -21200,7 +21207,7 @@ Date.checkLegal = function (str) {
};
Date.parseDateTime = function (str, fmt) {
var today = new Date();
var today = Date.getDate();
var y = 0;
var m = 0;
var d = 1;
@ -21293,7 +21300,7 @@ Date.parseDateTime = function (str, fmt) {
sec = today.getSeconds();
}
if (y != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
@ -21326,10 +21333,22 @@ Date.parseDateTime = function (str, fmt) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
return today;
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))){
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + Date.timeZone);//+ Pool.timeZone.offset);
}else{
return dt;
}
};
/*
* 给jQuery.Event对象添加的工具方法
*/

103
bi/widget.js

@ -1946,8 +1946,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_init: function () {
BI.DatePicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = new Date().getFullYear();
this._month = new Date().getMonth();
this._year = Date.getDate().getFullYear();
this._month = Date.getDate().getMonth();
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
@ -2111,7 +2111,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
var self = this,
o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
this._day = this.today.getDate();
@ -2433,7 +2433,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
setValue: function (v) {
var type, value, self = this;
var date = new Date();
var date = Date.getDate();
this.store_value = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DateTrigger.MULTI_DATE_CALENDAR; value = v.value;
@ -2450,62 +2450,62 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = new Date((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = new Date((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_BEGIN];
date = new Date(date.getFullYear(), 0, 1);
date = Date.getDate(date.getFullYear(), 0, 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_END];
date = new Date(date.getFullYear(), 11, 31);
date = Date.getDate(date.getFullYear(), 11, 31);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_PREV];
date = new Date().getBeforeMulQuarter(value);
date = Date.getDate().getBeforeMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_AFTER];
date = new Date().getAfterMulQuarter(value);
date = Date.getDate().getAfterMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN];
date = new Date().getQuarterStartDate();
date = Date.getDate().getQuarterStartDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_END];
date = new Date().getQuarterEndDate();
date = Date.getDate().getQuarterEndDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_PREV];
date = new Date().getBeforeMultiMonth(value);
date = Date.getDate().getBeforeMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_AFTER];
date = new Date().getAfterMultiMonth(value);
date = Date.getDate().getAfterMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_BEGIN];
date = new Date(date.getFullYear(), date.getMonth(), 1);
date = Date.getDate(date.getFullYear(), date.getMonth(), 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_END];
date = new Date(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
date = Date.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_WEEK_PREV:
@ -2530,7 +2530,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
break;
case BI.DateTrigger.MULTI_DATE_DAY_TODAY:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_DAY_TODAY];
date = new Date();
date = Date.getDate();
_setInnerValue(date, text);
break;
default:
@ -2631,7 +2631,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
BI.DatePaneWidget.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
@ -2695,7 +2695,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
},
_getNewCurrentDate: function () {
var today = new Date();
var today = Date.getDate();
return {
year: today.getFullYear(),
month: today.getMonth()
@ -2757,7 +2757,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
_init: function () {
BI.DateTimeCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var date = new Date();
var date = Date.getDate();
this.storeValue = {
year: date.getFullYear(),
month: date.getMonth(),
@ -2974,7 +2974,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
}]
});
var date = new Date();
var date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -3006,7 +3006,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var value = v, date;
if (BI.isNull(value)) {
date = new Date();
date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -3196,10 +3196,10 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
var self = this;
var value = v, dateStr;
if(BI.isNull(value)){
value = new Date();
value = Date.getDate();
dateStr = value.print("%Y-%X-%d %H:%M:%S");
} else {
var date = new Date(value.year,value.month,value.day,value.hour,value.minute,value.second);
var date = Date.getDate(value.year,value.month,value.day,value.hour,value.minute,value.second);
dateStr = date.print("%Y-%X-%d %H:%M:%S");
}
@ -5911,14 +5911,19 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_checkValidation: function (v) {
var o = this.options;
var valid = false;
//像90.这样的既不属于整数又不属于小数,是不合法的值
var dotText = (v + "").split(".")[1];
if (BI.isEmptyString(dotText)) {
}else{
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
if(o.digit === false){
valid = true;
}else{
var dotText = (v + "").split(".")[1] || "";
dotText = dotText || "";
valid = (dotText.length === o.digit);
}
}
}
return valid;
},
@ -6741,39 +6746,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var type = valueObject.type, value = valueObject.value;
switch (type) {
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value);
return Date.getDate().getOffsetDate(-1 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value);
return Date.getDate().getOffsetDate(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date();
return Date.getDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value);
return Date.getDate().getBeforeMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value);
return Date.getDate().getAfterMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), (Date.getDate().getLastDateOfMonth()).getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value);
return Date.getDate().getBeforeMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value);
return Date.getDate().getAfterMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate();
return Date.getDate().getQuarterStartDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate();
return Date.getDate().getQuarterEndDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value);
return Date.getDate().getOffsetDate(-7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value);
return Date.getDate().getOffsetDate(7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() - 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() + 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1);
return Date.getDate(Date.getDate().getFullYear(), 0, 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31);
return Date.getDate(Date.getDate().getFullYear(), 11, 31);
}
}
});
@ -6802,7 +6807,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
BI.MultiDateCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = new Date();
var date = Date.getDate();
this.storeValue = null;
this.trigger = BI.createWidget({
type: 'bi.date_trigger',
@ -6869,7 +6874,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
});
this.popup.on(BI.MultiDatePopup.BUTTON_lABEL_EVENT_CHANGE, function () {
var date = new Date();
var date = Date.getDate();
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -7366,7 +7371,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
},
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
setValue: function (v) {
@ -7424,8 +7429,8 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day);
break;
default:
if (!this._checkValueValid(value)) {
var date = new Date();
if (this._checkValueValid(value)) {
var date = Date.getDate();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({
year: date.getFullYear(),
@ -20785,7 +20790,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
this.selectedYear = this._year = new Date().getFullYear();
this.selectedYear = this._year = Date.getDate().getFullYear();
var backBtn = BI.createWidget({
type: "bi.icon_button",
@ -20839,7 +20844,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var o = this.options;
if (Date.checkVoid(v, 1, 1, o.min, o.max)[0]) {
v = new Date().getFullYear();
v = Date.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");

35
demo/js/case/combo/demo.icon_text_value_combo.js

@ -0,0 +1,35 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.IconTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "close-font",
value: 1
}, {
text: "MVC-2",
iconClass: "date-font",
value: 2
}, {
text: "MVC-3",
iconClass: "search-close-h-font",
value: 3
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.icon_text_value_combo", Demo.IconTextValueCombo);

5
demo/js/case/combo/demo.text_value_combo.js

@ -10,17 +10,20 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_combo",
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "date-font",
value: 1
}, {
text: "MVC-2",
iconClass: "search-font",
value: 2
}, {
text: "MVC-3",
iconClass: "pull-right-font",
value: 3
}]
}],

4
demo/js/config/case.js

@ -130,6 +130,10 @@ Demo.CASE_CONFIG = [{
pId: 306,
text: "bi.text_value_combo",
value: "demo.text_value_combo"
}, {
pId: 306,
text: "bi.icon_text_value_combo",
value: "demo.icon_text_value_combo"
}, {
pId: 306,
text: "bi.text_value_check_combo",

4
demo/js/config/core.js

@ -162,8 +162,8 @@ Demo.CORE_CONFIG = [{
text: "弹出层"
}, {
pId: 10202,
text: "bi.float_box",
value: "demo.float_box"
text: "bi.popover",
value: "demo.popover"
}, {
pId: 10202,
text: "bi.popup_view",

56
demo/js/core/popup/demo.popover.js

@ -0,0 +1,56 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var id = BI.UUID();
return {
type: "bi.text_button",
text: "点击弹出Popover",
width: 200,
height: 80,
handler: function() {
BI.Popovers.remove(id);
BI.Popovers.create(id, new Demo.ExamplePopoverSection()).open(id);
}
};
}
});
Demo.ExamplePopoverSection = BI.inherit(BI.PopoverSection, {
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: 'bi.button',
text: "确定",
warningTitle: o.warningTitle,
height: 30,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: 'bi.button',
text: "取消",
height: 30,
value: 1,
level: 'ignore',
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
}
});
BI.shortcut("demo.popover", Demo.Func);

42
demo/js/core/popup/demo.popup_view.js

@ -0,0 +1,42 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
width: 200,
height: 30,
el: {
type: "bi.text_button",
text: "点击",
cls: "bi-border",
height: 30
},
popup: {
type: "bi.popup_view",
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
}
}
}]
};
}
});
BI.shortcut("demo.popup_view", Demo.Func);

45
demo/js/core/popup/demo.searcher_view.js

@ -0,0 +1,45 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.searcher_view",
ref: function () {
self.searcherView = this;
}
},
left: 100,
top: 20,
width: 230
}]
};
},
mounted: function () {
this.searcherView.populate(BI.createItems([{
text: 2012
}, {
text: 2013
}, {
text: 2014
}, {
text: 2015
}], {
type: "bi.label",
textHeight: 24,
height: 24
}), [{
text: 2
}], "2");
}
});
BI.shortcut("demo.searcher_view", Demo.Func);

16
dist/base.js vendored

@ -14363,7 +14363,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
});
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) {
@ -14454,7 +14456,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");
@ -14505,7 +14508,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
var dId = fieldMap[value.substr(i.from, i.to - i.from)];
//因为插入字段的时候首尾加了不可见字符,所以首尾缩进一个字符
var dId = fieldMap[value.substr(i.from + 1, i.to - i.from - 2)];
if (!fields.contains(dId)) {
fields.push(dId);
}
@ -14544,8 +14548,10 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
switch (i.marker.className) {
case "fieldName":
var fieldNameLength = i.to - i.from;
var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)];
value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length);
var start = i.from + num + 1;
var end = fieldNameLength - 2;
var fieldId = fieldMap[value.substr(start, end)];
value = value.substr(0, i.from + num) + "$\{" + fieldId + "\}" + value.substr(i.to + num, value.length);
num += fieldId.length - fieldNameLength + 3;
break;
}

405
dist/bundle.js vendored

@ -11695,7 +11695,7 @@ if (!window.BI) {
// Date
if (type === '[object Date]') {
return new Date(obj.getTime());
return Date.getDate(obj.getTime());
}
var i, clone, key;
@ -11925,7 +11925,7 @@ if (!window.BI) {
if (Date.now) {
return Date.now();
} else {
return new Date().getTime();
return Date.getDate().getTime();
}
}
}
@ -18776,9 +18776,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
tooltip.visible();
tooltip.element.height(tooltip.element[0].scrollHeight);
this.showingTips[name] = true;
var x = e.pageX || e.clientX, y = (e.pageY || e.clientY) + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
x -= tooltip.element.outerWidth();
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
@ -20875,20 +20875,21 @@ Date.prototype.getMonthDays = function (month) {
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
return Date.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var now = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = Date.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
};
/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function () {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var d = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
//周一是一周第一天
var week = d.getDay();
if (this.getMonth() === 0 && this.getDate() <= week) {
return 1;
@ -20904,19 +20905,23 @@ Date.prototype.getWeekNumber = function () {
return offset;
};
Date.prototype.getQuarter = function () {
return Math.floor(this.getMonth() / 3) + 1;
};
//离当前时间多少天的时间
Date.prototype.getOffsetDate = function (offset) {
return new Date(this.getTime() + offset * 864e5);
return Date.getDate(this.getTime() + offset * 864e5);
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20940,32 +20945,32 @@ Date.prototype.getQuarterStartMonth = function () {
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20990,9 +20995,9 @@ Date.prototype.getQuarterStartMonth = function () {
//指定日期n个月之前或之后的日期
Date.prototype.getOffsetMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var day = dt.getDate();
var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
var monthDay = Date.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
if (day > monthDay) {
day = monthDay;
}
@ -21015,31 +21020,31 @@ Date.prototype.getWeekEndDate = function () {
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
return Date.getDate(utc + offset);
};
/** Checks date and time equality */
@ -21054,7 +21059,7 @@ Date.prototype.equalsTo = function (date) {
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = new Date(date);
var tmp = Date.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
@ -21066,6 +21071,7 @@ Date.prototype.print = function (str) {
var d = this.getDate();
var y = this.getFullYear();
var wn = this.getWeekNumber();
var qr = this.getQuarter();
var w = this.getDay();
var s = {};
var hr = this.getHours();
@ -21112,6 +21118,7 @@ Date.prototype.print = function (str) {
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%Q"] = qr;
var re = /%./g;
if (!BI.isKhtml()) {
@ -21200,7 +21207,7 @@ Date.checkLegal = function (str) {
};
Date.parseDateTime = function (str, fmt) {
var today = new Date();
var today = Date.getDate();
var y = 0;
var m = 0;
var d = 1;
@ -21293,7 +21300,7 @@ Date.parseDateTime = function (str, fmt) {
sec = today.getSeconds();
}
if (y != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
@ -21326,10 +21333,22 @@ Date.parseDateTime = function (str, fmt) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
return today;
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))){
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + Date.timeZone);//+ Pool.timeZone.offset);
}else{
return dt;
}
};
/*
* 给jQuery.Event对象添加的工具方法
*/
@ -40260,7 +40279,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
});
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) {
@ -40351,7 +40372,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");
@ -40402,7 +40424,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
var dId = fieldMap[value.substr(i.from, i.to - i.from)];
//因为插入字段的时候首尾加了不可见字符,所以首尾缩进一个字符
var dId = fieldMap[value.substr(i.from + 1, i.to - i.from - 2)];
if (!fields.contains(dId)) {
fields.push(dId);
}
@ -40441,8 +40464,10 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
switch (i.marker.className) {
case "fieldName":
var fieldNameLength = i.to - i.from;
var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)];
value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length);
var start = i.from + num + 1;
var end = fieldNameLength - 2;
var fieldId = fieldMap[value.substr(start, end)];
value = value.substr(0, i.from + num) + "$\{" + fieldId + "\}" + value.substr(i.to + num, value.length);
num += fieldId.length - fieldNameLength + 3;
break;
}
@ -63118,7 +63143,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = new Date();
var self = this, o = this.options, log = {}, De = Date.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
@ -63228,7 +63253,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(-1 * (day + 1));
@ -63237,7 +63262,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(42 - day);
@ -63260,14 +63285,14 @@ BI.Calendar = BI.inherit(BI.Widget, {
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = new Date().getFullYear();
var month = new Date().getMonth();
var year = Date.getDate().getFullYear();
var month = Date.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
return page;
},
getDateJSONByPage: function(v){
var months = new Date().getMonth();
var months = Date.getDate().getMonth();
var page = v;
//对当前page做偏移,使到当前年初
@ -63279,7 +63304,7 @@ BI.extend(BI.Calendar, {
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: new Date().getFullYear() + year,
year: Date.getDate().getFullYear() + year,
month: month
}
}
@ -63325,7 +63350,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = new Date().getFullYear();
this.currentYear = Date.getDate().getFullYear();
var years = this._yearCreator(o.year || this.currentYear);
//纵向排列年
@ -63412,7 +63437,7 @@ BI.extend(BI.YearCalendar, {
//获取显示的第一年
getStartYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
@ -63421,7 +63446,7 @@ BI.extend(BI.YearCalendar, {
},
getPageByYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}
@ -66932,6 +66957,125 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, {
});
BI.IconComboTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_combo_trigger", BI.IconComboTrigger);/**
* Created by Windy on 2017/12/12.
* combo : icon + text + icon, popup : icon + text
*/
BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
text: "",
el: {}
})
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
text: o.text
});
this.popup = BI.createWidget({
type: "bi.icon_text_value_combo_popup",
items: o.items
});
this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCombo.hideView();
self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE, arguments);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
},
setValue: function (v) {
this.textIconCombo.setValue(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},
populate: function (items) {
this.options.items = items;
this.textIconCombo.populate(items);
}
});
BI.IconTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo", BI.IconTextValueCombo);/**
* Created by Windy on 2017/12/12.
*/
BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-icon-popup"
});
},
_init: function () {
BI.IconTextValueComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_icon_text_item",
height: 30
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{
type: "bi.vertical"
}]
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE, val, obj);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup]
});
},
populate: function (items) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
items = BI.createItems(items, {
type: "bi.single_select_icon_text_item",
height: 30
});
this.popup.populate(items);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/**
* 单选combo
*
* @class BI.StaticCombo
@ -75010,6 +75154,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({
element: this,
type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.icon_change_button",
@ -75037,7 +75184,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
},
setText: function (text) {
@ -75046,6 +75206,60 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}
});
BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/**
* Created by Windy on 2017/12/12.
*/
BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border",
height: 24
});
},
_init: function () {
this.options.height -= 2;
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.icon_text_trigger",
element: this,
height: o.height
});
if (BI.isKey(o.text)) {
this.setValue(o.text);
}
},
setValue: function (vals) {
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result;
var items = BI.Tree.transformToArrayFormat(this.options.items);
BI.any(items, function (i, item) {
if (BI.deepContains(vals, item.value)) {
result = {
text: item.text || item.value,
iconClass: item.iconClass
};
return true;
}
});
if (BI.isNotNull(result)) {
this.trigger.setText(result.text);
this.trigger.setIcon(result.iconClass);
} else {
this.trigger.setText(o.text);
this.trigger.setIcon("");
}
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.select_icon_text_trigger", BI.SelectIconTextTrigger);/**
* 文字trigger
*
* Created by GUY on 2015/9/15.
@ -77215,8 +77429,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_init: function () {
BI.DatePicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = new Date().getFullYear();
this._month = new Date().getMonth();
this._year = Date.getDate().getFullYear();
this._month = Date.getDate().getMonth();
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
@ -77380,7 +77594,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
var self = this,
o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
this._day = this.today.getDate();
@ -77702,7 +77916,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
setValue: function (v) {
var type, value, self = this;
var date = new Date();
var date = Date.getDate();
this.store_value = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DateTrigger.MULTI_DATE_CALENDAR; value = v.value;
@ -77719,62 +77933,62 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = new Date((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = new Date((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_BEGIN];
date = new Date(date.getFullYear(), 0, 1);
date = Date.getDate(date.getFullYear(), 0, 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_END];
date = new Date(date.getFullYear(), 11, 31);
date = Date.getDate(date.getFullYear(), 11, 31);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_PREV];
date = new Date().getBeforeMulQuarter(value);
date = Date.getDate().getBeforeMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_AFTER];
date = new Date().getAfterMulQuarter(value);
date = Date.getDate().getAfterMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN];
date = new Date().getQuarterStartDate();
date = Date.getDate().getQuarterStartDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_END];
date = new Date().getQuarterEndDate();
date = Date.getDate().getQuarterEndDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_PREV];
date = new Date().getBeforeMultiMonth(value);
date = Date.getDate().getBeforeMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_AFTER];
date = new Date().getAfterMultiMonth(value);
date = Date.getDate().getAfterMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_BEGIN];
date = new Date(date.getFullYear(), date.getMonth(), 1);
date = Date.getDate(date.getFullYear(), date.getMonth(), 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_END];
date = new Date(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
date = Date.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_WEEK_PREV:
@ -77799,7 +78013,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
break;
case BI.DateTrigger.MULTI_DATE_DAY_TODAY:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_DAY_TODAY];
date = new Date();
date = Date.getDate();
_setInnerValue(date, text);
break;
default:
@ -77900,7 +78114,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
BI.DatePaneWidget.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
@ -77964,7 +78178,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
},
_getNewCurrentDate: function () {
var today = new Date();
var today = Date.getDate();
return {
year: today.getFullYear(),
month: today.getMonth()
@ -78026,7 +78240,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
_init: function () {
BI.DateTimeCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var date = new Date();
var date = Date.getDate();
this.storeValue = {
year: date.getFullYear(),
month: date.getMonth(),
@ -78243,7 +78457,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
}]
});
var date = new Date();
var date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -78275,7 +78489,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var value = v, date;
if (BI.isNull(value)) {
date = new Date();
date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -78465,10 +78679,10 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
var self = this;
var value = v, dateStr;
if(BI.isNull(value)){
value = new Date();
value = Date.getDate();
dateStr = value.print("%Y-%X-%d %H:%M:%S");
} else {
var date = new Date(value.year,value.month,value.day,value.hour,value.minute,value.second);
var date = Date.getDate(value.year,value.month,value.day,value.hour,value.minute,value.second);
dateStr = date.print("%Y-%X-%d %H:%M:%S");
}
@ -81180,14 +81394,19 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_checkValidation: function (v) {
var o = this.options;
var valid = false;
//像90.这样的既不属于整数又不属于小数,是不合法的值
var dotText = (v + "").split(".")[1];
if (BI.isEmptyString(dotText)) {
}else{
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
if(o.digit === false){
valid = true;
}else{
var dotText = (v + "").split(".")[1] || "";
dotText = dotText || "";
valid = (dotText.length === o.digit);
}
}
}
return valid;
},
@ -82010,39 +82229,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var type = valueObject.type, value = valueObject.value;
switch (type) {
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value);
return Date.getDate().getOffsetDate(-1 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value);
return Date.getDate().getOffsetDate(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date();
return Date.getDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value);
return Date.getDate().getBeforeMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value);
return Date.getDate().getAfterMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), (Date.getDate().getLastDateOfMonth()).getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value);
return Date.getDate().getBeforeMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value);
return Date.getDate().getAfterMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate();
return Date.getDate().getQuarterStartDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate();
return Date.getDate().getQuarterEndDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value);
return Date.getDate().getOffsetDate(-7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value);
return Date.getDate().getOffsetDate(7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() - 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() + 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1);
return Date.getDate(Date.getDate().getFullYear(), 0, 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31);
return Date.getDate(Date.getDate().getFullYear(), 11, 31);
}
}
});
@ -82071,7 +82290,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
BI.MultiDateCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = new Date();
var date = Date.getDate();
this.storeValue = null;
this.trigger = BI.createWidget({
type: 'bi.date_trigger',
@ -82138,7 +82357,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
});
this.popup.on(BI.MultiDatePopup.BUTTON_lABEL_EVENT_CHANGE, function () {
var date = new Date();
var date = Date.getDate();
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -82635,7 +82854,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
},
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
setValue: function (v) {
@ -82693,8 +82912,8 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day);
break;
default:
if (!this._checkValueValid(value)) {
var date = new Date();
if (this._checkValueValid(value)) {
var date = Date.getDate();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({
year: date.getFullYear(),
@ -96054,7 +96273,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
this.selectedYear = this._year = new Date().getFullYear();
this.selectedYear = this._year = Date.getDate().getFullYear();
var backBtn = BI.createWidget({
type: "bi.icon_button",
@ -96108,7 +96327,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var o = this.options;
if (Date.checkVoid(v, 1, 1, o.min, o.max)[0]) {
v = new Date().getFullYear();
v = Date.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");

87
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

209
dist/case.js vendored

@ -1640,7 +1640,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = new Date();
var self = this, o = this.options, log = {}, De = Date.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
@ -1750,7 +1750,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(-1 * (day + 1));
@ -1759,7 +1759,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(42 - day);
@ -1782,14 +1782,14 @@ BI.Calendar = BI.inherit(BI.Widget, {
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = new Date().getFullYear();
var month = new Date().getMonth();
var year = Date.getDate().getFullYear();
var month = Date.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
return page;
},
getDateJSONByPage: function(v){
var months = new Date().getMonth();
var months = Date.getDate().getMonth();
var page = v;
//对当前page做偏移,使到当前年初
@ -1801,7 +1801,7 @@ BI.extend(BI.Calendar, {
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: new Date().getFullYear() + year,
year: Date.getDate().getFullYear() + year,
month: month
}
}
@ -1847,7 +1847,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = new Date().getFullYear();
this.currentYear = Date.getDate().getFullYear();
var years = this._yearCreator(o.year || this.currentYear);
//纵向排列年
@ -1934,7 +1934,7 @@ BI.extend(BI.YearCalendar, {
//获取显示的第一年
getStartYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
@ -1943,7 +1943,7 @@ BI.extend(BI.YearCalendar, {
},
getPageByYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}
@ -5454,6 +5454,125 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, {
});
BI.IconComboTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_combo_trigger", BI.IconComboTrigger);/**
* Created by Windy on 2017/12/12.
* combo : icon + text + icon, popup : icon + text
*/
BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
text: "",
el: {}
})
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
text: o.text
});
this.popup = BI.createWidget({
type: "bi.icon_text_value_combo_popup",
items: o.items
});
this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCombo.hideView();
self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE, arguments);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
},
setValue: function (v) {
this.textIconCombo.setValue(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},
populate: function (items) {
this.options.items = items;
this.textIconCombo.populate(items);
}
});
BI.IconTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo", BI.IconTextValueCombo);/**
* Created by Windy on 2017/12/12.
*/
BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-icon-popup"
});
},
_init: function () {
BI.IconTextValueComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_icon_text_item",
height: 30
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{
type: "bi.vertical"
}]
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE, val, obj);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup]
});
},
populate: function (items) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
items = BI.createItems(items, {
type: "bi.single_select_icon_text_item",
height: 30
});
this.popup.populate(items);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/**
* 单选combo
*
* @class BI.StaticCombo
@ -13532,6 +13651,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({
element: this,
type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.icon_change_button",
@ -13559,7 +13681,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
},
setText: function (text) {
@ -13568,6 +13703,60 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}
});
BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/**
* Created by Windy on 2017/12/12.
*/
BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border",
height: 24
});
},
_init: function () {
this.options.height -= 2;
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.icon_text_trigger",
element: this,
height: o.height
});
if (BI.isKey(o.text)) {
this.setValue(o.text);
}
},
setValue: function (vals) {
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result;
var items = BI.Tree.transformToArrayFormat(this.options.items);
BI.any(items, function (i, item) {
if (BI.deepContains(vals, item.value)) {
result = {
text: item.text || item.value,
iconClass: item.iconClass
};
return true;
}
});
if (BI.isNotNull(result)) {
this.trigger.setText(result.text);
this.trigger.setIcon(result.iconClass);
} else {
this.trigger.setText(o.text);
this.trigger.setIcon("");
}
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.select_icon_text_trigger", BI.SelectIconTextTrigger);/**
* 文字trigger
*
* Created by GUY on 2015/9/15.

77
dist/core.js vendored

@ -11695,7 +11695,7 @@ if (!window.BI) {
// Date
if (type === '[object Date]') {
return new Date(obj.getTime());
return Date.getDate(obj.getTime());
}
var i, clone, key;
@ -11925,7 +11925,7 @@ if (!window.BI) {
if (Date.now) {
return Date.now();
} else {
return new Date().getTime();
return Date.getDate().getTime();
}
}
}
@ -18776,9 +18776,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
tooltip.visible();
tooltip.element.height(tooltip.element[0].scrollHeight);
this.showingTips[name] = true;
var x = e.pageX || e.clientX, y = (e.pageY || e.clientY) + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
x -= tooltip.element.outerWidth();
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;
@ -20875,20 +20875,21 @@ Date.prototype.getMonthDays = function (month) {
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
return Date.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var now = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = Date.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
};
/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function () {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var d = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
//周一是一周第一天
var week = d.getDay();
if (this.getMonth() === 0 && this.getDate() <= week) {
return 1;
@ -20904,19 +20905,23 @@ Date.prototype.getWeekNumber = function () {
return offset;
};
Date.prototype.getQuarter = function () {
return Math.floor(this.getMonth() / 3) + 1;
};
//离当前时间多少天的时间
Date.prototype.getOffsetDate = function (offset) {
return new Date(this.getTime() + offset * 864e5);
return Date.getDate(this.getTime() + offset * 864e5);
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20940,32 +20945,32 @@ Date.prototype.getQuarterStartMonth = function () {
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -20990,9 +20995,9 @@ Date.prototype.getQuarterStartMonth = function () {
//指定日期n个月之前或之后的日期
Date.prototype.getOffsetMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var day = dt.getDate();
var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
var monthDay = Date.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
if (day > monthDay) {
day = monthDay;
}
@ -21015,31 +21020,31 @@ Date.prototype.getWeekEndDate = function () {
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
return Date.getDate(utc + offset);
};
/** Checks date and time equality */
@ -21054,7 +21059,7 @@ Date.prototype.equalsTo = function (date) {
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = new Date(date);
var tmp = Date.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
@ -21066,6 +21071,7 @@ Date.prototype.print = function (str) {
var d = this.getDate();
var y = this.getFullYear();
var wn = this.getWeekNumber();
var qr = this.getQuarter();
var w = this.getDay();
var s = {};
var hr = this.getHours();
@ -21112,6 +21118,7 @@ Date.prototype.print = function (str) {
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%Q"] = qr;
var re = /%./g;
if (!BI.isKhtml()) {
@ -21200,7 +21207,7 @@ Date.checkLegal = function (str) {
};
Date.parseDateTime = function (str, fmt) {
var today = new Date();
var today = Date.getDate();
var y = 0;
var m = 0;
var d = 1;
@ -21293,7 +21300,7 @@ Date.parseDateTime = function (str, fmt) {
sec = today.getSeconds();
}
if (y != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
@ -21326,10 +21333,22 @@ Date.parseDateTime = function (str, fmt) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
return today;
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))){
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + Date.timeZone);//+ Pool.timeZone.offset);
}else{
return dt;
}
};
/*
* 给jQuery.Event对象添加的工具方法
*/

189
dist/demo.js vendored

@ -1765,6 +1765,40 @@ Demo.IconCombo = BI.inherit(BI.Widget, {
});
BI.shortcut("demo.icon_combo", Demo.IconCombo);/**
* Created by Windy on 2017/12/13.
*/
Demo.IconTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "close-font",
value: 1
}, {
text: "MVC-2",
iconClass: "date-font",
value: 2
}, {
text: "MVC-3",
iconClass: "search-close-h-font",
value: 3
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.icon_text_value_combo", Demo.IconTextValueCombo);/**
* Created by Dailer on 2017/7/11.
*/
Demo.StaticCombo = BI.inherit(BI.Widget, {
@ -1820,17 +1854,20 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_combo",
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "date-font",
value: 1
}, {
text: "MVC-2",
iconClass: "search-font",
value: 2
}, {
text: "MVC-3",
iconClass: "pull-right-font",
value: 3
}]
}],
@ -4849,6 +4886,10 @@ BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.ADDONS_CONFIG
pId: 306,
text: "bi.text_value_combo",
value: "demo.text_value_combo"
}, {
pId: 306,
text: "bi.icon_text_value_combo",
value: "demo.icon_text_value_combo"
}, {
pId: 306,
text: "bi.text_value_check_combo",
@ -5142,8 +5183,8 @@ Demo.COMPONENT_CONFIG = [{
text: "弹出层"
}, {
pId: 10202,
text: "bi.float_box",
value: "demo.float_box"
text: "bi.popover",
value: "demo.popover"
}, {
pId: 10202,
text: "bi.popup_view",
@ -8140,7 +8181,147 @@ Demo.VtapeLayout = BI.inherit(BI.Widget, {
};
}
});
BI.shortcut("demo.vtape", Demo.VtapeLayout);Demo.Face = BI.inherit(BI.Widget, {
BI.shortcut("demo.vtape", Demo.VtapeLayout);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var id = BI.UUID();
return {
type: "bi.text_button",
text: "点击弹出Popover",
width: 200,
height: 80,
handler: function() {
BI.Popovers.remove(id);
BI.Popovers.create(id, new Demo.ExamplePopoverSection()).open(id);
}
};
}
});
Demo.ExamplePopoverSection = BI.inherit(BI.PopoverSection, {
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: 'bi.button',
text: "确定",
warningTitle: o.warningTitle,
height: 30,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: 'bi.button',
text: "取消",
height: 30,
value: 1,
level: 'ignore',
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
}
});
BI.shortcut("demo.popover", Demo.Func);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
width: 200,
height: 30,
el: {
type: "bi.text_button",
text: "点击",
cls: "bi-border",
height: 30
},
popup: {
type: "bi.popup_view",
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
}
}
}]
};
}
});
BI.shortcut("demo.popup_view", Demo.Func);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.searcher_view",
ref: function () {
self.searcherView = this;
}
},
left: 100,
top: 20,
width: 230
}]
};
},
mounted: function () {
this.searcherView.populate(BI.createItems([{
text: 2012
}, {
text: 2013
}, {
text: 2014
}, {
text: 2015
}], {
type: "bi.label",
textHeight: 24,
height: 24
}), [{
text: 2
}], "2");
}
});
BI.shortcut("demo.searcher_view", Demo.Func);Demo.Face = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-face"
},

103
dist/widget.js vendored

@ -1946,8 +1946,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_init: function () {
BI.DatePicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = new Date().getFullYear();
this._month = new Date().getMonth();
this._year = Date.getDate().getFullYear();
this._month = Date.getDate().getMonth();
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
@ -2111,7 +2111,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
var self = this,
o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
this._day = this.today.getDate();
@ -2433,7 +2433,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
setValue: function (v) {
var type, value, self = this;
var date = new Date();
var date = Date.getDate();
this.store_value = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DateTrigger.MULTI_DATE_CALENDAR; value = v.value;
@ -2450,62 +2450,62 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = new Date((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = new Date((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_BEGIN];
date = new Date(date.getFullYear(), 0, 1);
date = Date.getDate(date.getFullYear(), 0, 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_END];
date = new Date(date.getFullYear(), 11, 31);
date = Date.getDate(date.getFullYear(), 11, 31);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_PREV];
date = new Date().getBeforeMulQuarter(value);
date = Date.getDate().getBeforeMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_AFTER];
date = new Date().getAfterMulQuarter(value);
date = Date.getDate().getAfterMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN];
date = new Date().getQuarterStartDate();
date = Date.getDate().getQuarterStartDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_END];
date = new Date().getQuarterEndDate();
date = Date.getDate().getQuarterEndDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_PREV];
date = new Date().getBeforeMultiMonth(value);
date = Date.getDate().getBeforeMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_AFTER];
date = new Date().getAfterMultiMonth(value);
date = Date.getDate().getAfterMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_BEGIN];
date = new Date(date.getFullYear(), date.getMonth(), 1);
date = Date.getDate(date.getFullYear(), date.getMonth(), 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_END];
date = new Date(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
date = Date.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_WEEK_PREV:
@ -2530,7 +2530,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
break;
case BI.DateTrigger.MULTI_DATE_DAY_TODAY:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_DAY_TODAY];
date = new Date();
date = Date.getDate();
_setInnerValue(date, text);
break;
default:
@ -2631,7 +2631,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
BI.DatePaneWidget.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
@ -2695,7 +2695,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
},
_getNewCurrentDate: function () {
var today = new Date();
var today = Date.getDate();
return {
year: today.getFullYear(),
month: today.getMonth()
@ -2757,7 +2757,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
_init: function () {
BI.DateTimeCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var date = new Date();
var date = Date.getDate();
this.storeValue = {
year: date.getFullYear(),
month: date.getMonth(),
@ -2974,7 +2974,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
}]
});
var date = new Date();
var date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -3006,7 +3006,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var value = v, date;
if (BI.isNull(value)) {
date = new Date();
date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -3196,10 +3196,10 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
var self = this;
var value = v, dateStr;
if(BI.isNull(value)){
value = new Date();
value = Date.getDate();
dateStr = value.print("%Y-%X-%d %H:%M:%S");
} else {
var date = new Date(value.year,value.month,value.day,value.hour,value.minute,value.second);
var date = Date.getDate(value.year,value.month,value.day,value.hour,value.minute,value.second);
dateStr = date.print("%Y-%X-%d %H:%M:%S");
}
@ -5911,14 +5911,19 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_checkValidation: function (v) {
var o = this.options;
var valid = false;
//像90.这样的既不属于整数又不属于小数,是不合法的值
var dotText = (v + "").split(".")[1];
if (BI.isEmptyString(dotText)) {
}else{
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
if(o.digit === false){
valid = true;
}else{
var dotText = (v + "").split(".")[1] || "";
dotText = dotText || "";
valid = (dotText.length === o.digit);
}
}
}
return valid;
},
@ -6741,39 +6746,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var type = valueObject.type, value = valueObject.value;
switch (type) {
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value);
return Date.getDate().getOffsetDate(-1 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value);
return Date.getDate().getOffsetDate(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date();
return Date.getDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value);
return Date.getDate().getBeforeMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value);
return Date.getDate().getAfterMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), (Date.getDate().getLastDateOfMonth()).getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value);
return Date.getDate().getBeforeMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value);
return Date.getDate().getAfterMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate();
return Date.getDate().getQuarterStartDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate();
return Date.getDate().getQuarterEndDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value);
return Date.getDate().getOffsetDate(-7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value);
return Date.getDate().getOffsetDate(7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() - 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() + 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1);
return Date.getDate(Date.getDate().getFullYear(), 0, 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31);
return Date.getDate(Date.getDate().getFullYear(), 11, 31);
}
}
});
@ -6802,7 +6807,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
BI.MultiDateCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = new Date();
var date = Date.getDate();
this.storeValue = null;
this.trigger = BI.createWidget({
type: 'bi.date_trigger',
@ -6869,7 +6874,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
});
this.popup.on(BI.MultiDatePopup.BUTTON_lABEL_EVENT_CHANGE, function () {
var date = new Date();
var date = Date.getDate();
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -7366,7 +7371,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
},
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
setValue: function (v) {
@ -7424,8 +7429,8 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day);
break;
default:
if (!this._checkValueValid(value)) {
var date = new Date();
if (this._checkValueValid(value)) {
var date = Date.getDate();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({
year: date.getFullYear(),
@ -20785,7 +20790,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
this.selectedYear = this._year = new Date().getFullYear();
this.selectedYear = this._year = Date.getDate().getFullYear();
var backBtn = BI.createWidget({
type: "bi.icon_button",
@ -20839,7 +20844,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var o = this.options;
if (Date.checkVoid(v, 1, 1, o.min, o.max)[0]) {
v = new Date().getFullYear();
v = Date.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");

16
src/base/formula/formulaeditor.js

@ -21,7 +21,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
});
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) {
@ -112,7 +114,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");
@ -163,7 +166,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
var dId = fieldMap[value.substr(i.from, i.to - i.from)];
//因为插入字段的时候首尾加了不可见字符,所以首尾缩进一个字符
var dId = fieldMap[value.substr(i.from + 1, i.to - i.from - 2)];
if (!fields.contains(dId)) {
fields.push(dId);
}
@ -202,8 +206,10 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
switch (i.marker.className) {
case "fieldName":
var fieldNameLength = i.to - i.from;
var fieldId = fieldMap[value.substr(i.from + num, fieldNameLength)];
value = value.substr(0, i.from + num) + "$\{" + fieldMap[value.substr(i.from + num, fieldNameLength)] + "\}" + value.substr(i.to + num, value.length);
var start = i.from + num + 1;
var end = fieldNameLength - 2;
var fieldId = fieldMap[value.substr(start, end)];
value = value.substr(0, i.from + num) + "$\{" + fieldId + "\}" + value.substr(i.to + num, value.length);
num += fieldId.length - fieldNameLength + 3;
break;
}

14
src/case/calendar/calendar.js

@ -20,7 +20,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = new Date();
var self = this, o = this.options, log = {}, De = Date.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
@ -130,7 +130,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(-1 * (day + 1));
@ -139,7 +139,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = new Date(), day = De.getDay();
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(42 - day);
@ -162,14 +162,14 @@ BI.Calendar = BI.inherit(BI.Widget, {
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = new Date().getFullYear();
var month = new Date().getMonth();
var year = Date.getDate().getFullYear();
var month = Date.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
return page;
},
getDateJSONByPage: function(v){
var months = new Date().getMonth();
var months = Date.getDate().getMonth();
var page = v;
//对当前page做偏移,使到当前年初
@ -181,7 +181,7 @@ BI.extend(BI.Calendar, {
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: new Date().getFullYear() + year,
year: Date.getDate().getFullYear() + year,
month: month
}
}

6
src/case/calendar/calendar.year.js

@ -38,7 +38,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = new Date().getFullYear();
this.currentYear = Date.getDate().getFullYear();
var years = this._yearCreator(o.year || this.currentYear);
//纵向排列年
@ -125,7 +125,7 @@ BI.extend(BI.YearCalendar, {
//获取显示的第一年
getStartYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
@ -134,7 +134,7 @@ BI.extend(BI.YearCalendar, {
},
getPageByYear: function (year) {
var cur = new Date().getFullYear();
var cur = Date.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}

62
src/case/combo/icontextvaluecombo/combo.icontextvalue.js

@ -0,0 +1,62 @@
/**
* Created by Windy on 2017/12/12.
* combo : icon + text + icon, popup : icon + text
*/
BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-icon-text-value-combo",
height: 30,
text: "",
el: {}
})
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
type: "bi.select_icon_text_trigger",
items: o.items,
height: o.height,
text: o.text
});
this.popup = BI.createWidget({
type: "bi.icon_text_value_combo_popup",
items: o.items
});
this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCombo.hideView();
self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE, arguments);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
},
setValue: function (v) {
this.textIconCombo.setValue(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},
populate: function (items) {
this.options.items = items;
this.textIconCombo.populate(items);
}
});
BI.IconTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo", BI.IconTextValueCombo);

59
src/case/combo/icontextvaluecombo/popup.icontextvalue.js

@ -0,0 +1,59 @@
/**
* Created by Windy on 2017/12/12.
*/
BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-icon-popup"
});
},
_init: function () {
BI.IconTextValueComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_icon_text_item",
height: 30
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{
type: "bi.vertical"
}]
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE, val, obj);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup]
});
},
populate: function (items) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
items = BI.createItems(items, {
type: "bi.single_select_icon_text_item",
height: 30
});
this.popup.populate(items);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);

16
src/case/trigger/trigger.icon.text.js

@ -37,6 +37,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({
element: this,
type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.icon_change_button",
@ -64,7 +67,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
},
setText: function (text) {

55
src/case/trigger/trigger.icon.text.select.js

@ -0,0 +1,55 @@
/**
* Created by Windy on 2017/12/12.
*/
BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border",
height: 24
});
},
_init: function () {
this.options.height -= 2;
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.icon_text_trigger",
element: this,
height: o.height
});
if (BI.isKey(o.text)) {
this.setValue(o.text);
}
},
setValue: function (vals) {
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result;
var items = BI.Tree.transformToArrayFormat(this.options.items);
BI.any(items, function (i, item) {
if (BI.deepContains(vals, item.value)) {
result = {
text: item.text || item.value,
iconClass: item.iconClass
};
return true;
}
});
if (BI.isNotNull(result)) {
this.trigger.setText(result.text);
this.trigger.setIcon(result.iconClass);
} else {
this.trigger.setText(o.text);
this.trigger.setIcon("");
}
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.select_icon_text_trigger", BI.SelectIconTextTrigger);

4
src/core/base.js

@ -545,7 +545,7 @@ if (!window.BI) {
// Date
if (type === '[object Date]') {
return new Date(obj.getTime());
return Date.getDate(obj.getTime());
}
var i, clone, key;
@ -775,7 +775,7 @@ if (!window.BI) {
if (Date.now) {
return Date.now();
} else {
return new Date().getTime();
return Date.getDate().getTime();
}
}
}

4
src/core/controller/controller.tooltips.js

@ -85,9 +85,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
tooltip.visible();
tooltip.element.height(tooltip.element[0].scrollHeight);
this.showingTips[name] = true;
var x = e.pageX || e.clientX, y = (e.pageY || e.clientY) + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > $("body").outerWidth()) {
x -= tooltip.element.outerWidth();
x -= tooltip.element.outerWidth() + 15;
}
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15;

69
src/core/proto/date.js

@ -94,20 +94,21 @@ Date.prototype.getMonthDays = function (month) {
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return new Date(this.getFullYear(), this.getMonth(), this.getMonthDays());
return Date.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var now = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = Date.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
};
/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function () {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var d = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
//周一是一周第一天
var week = d.getDay();
if (this.getMonth() === 0 && this.getDate() <= week) {
return 1;
@ -123,19 +124,23 @@ Date.prototype.getWeekNumber = function () {
return offset;
};
Date.prototype.getQuarter = function () {
return Math.floor(this.getMonth() / 3) + 1;
};
//离当前时间多少天的时间
Date.prototype.getOffsetDate = function (offset) {
return new Date(this.getTime() + offset * 864e5);
return Date.getDate(this.getTime() + offset * 864e5);
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -159,32 +164,32 @@ Date.prototype.getQuarterStartMonth = function () {
};
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
//获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -209,9 +214,9 @@ Date.prototype.getQuarterStartMonth = function () {
//指定日期n个月之前或之后的日期
Date.prototype.getOffsetMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var day = dt.getDate();
var monthDay = new Date(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
var monthDay = Date.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
if (day > monthDay) {
day = monthDay;
}
@ -234,31 +239,31 @@ Date.prototype.getWeekEndDate = function () {
//获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return new Date(this.getFullYear(), this.getQuarterStartMonth(), 1);
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
//得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return new Date(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var dt = Date.getDate(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
return Date.getDate(utc + offset);
};
/** Checks date and time equality */
@ -273,7 +278,7 @@ Date.prototype.equalsTo = function (date) {
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = new Date(date);
var tmp = Date.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
@ -285,6 +290,7 @@ Date.prototype.print = function (str) {
var d = this.getDate();
var y = this.getFullYear();
var wn = this.getWeekNumber();
var qr = this.getQuarter();
var w = this.getDay();
var s = {};
var hr = this.getHours();
@ -331,6 +337,7 @@ Date.prototype.print = function (str) {
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%Q"] = qr;
var re = /%./g;
if (!BI.isKhtml()) {
@ -419,7 +426,7 @@ Date.checkLegal = function (str) {
};
Date.parseDateTime = function (str, fmt) {
var today = new Date();
var today = Date.getDate();
var y = 0;
var m = 0;
var d = 1;
@ -512,7 +519,7 @@ Date.parseDateTime = function (str, fmt) {
sec = today.getSeconds();
}
if (y != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
@ -545,7 +552,19 @@ Date.parseDateTime = function (str, fmt) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return new Date(y, m, d, hr, min, sec);
return Date.getDate(y, m, d, hr, min, sec);
}
return today;
};
Date.getDate = function () {
var dt = new (Function.prototype.bind.apply(Date, BI.concat([null], [].slice.apply(arguments))))();
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))){
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + Date.timeZone);//+ Pool.timeZone.offset);
}else{
return dt;
}
};

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

@ -17,8 +17,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_init: function () {
BI.DatePicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = new Date().getFullYear();
this._month = new Date().getMonth();
this._year = Date.getDate().getFullYear();
this._month = Date.getDate().getMonth();
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",

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

@ -34,7 +34,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
var self = this,
o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
this._day = this.today.getDate();

28
src/widget/date/trigger.date.js

@ -132,7 +132,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
setValue: function (v) {
var type, value, self = this;
var date = new Date();
var date = Date.getDate();
this.store_value = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DateTrigger.MULTI_DATE_CALENDAR; value = v.value;
@ -149,62 +149,62 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = new Date((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = new Date((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
date = Date.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_BEGIN];
date = new Date(date.getFullYear(), 0, 1);
date = Date.getDate(date.getFullYear(), 0, 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_END];
date = new Date(date.getFullYear(), 11, 31);
date = Date.getDate(date.getFullYear(), 11, 31);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_PREV];
date = new Date().getBeforeMulQuarter(value);
date = Date.getDate().getBeforeMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_AFTER];
date = new Date().getAfterMulQuarter(value);
date = Date.getDate().getAfterMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN];
date = new Date().getQuarterStartDate();
date = Date.getDate().getQuarterStartDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_END];
date = new Date().getQuarterEndDate();
date = Date.getDate().getQuarterEndDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_PREV];
date = new Date().getBeforeMultiMonth(value);
date = Date.getDate().getBeforeMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_AFTER];
date = new Date().getAfterMultiMonth(value);
date = Date.getDate().getAfterMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_BEGIN];
date = new Date(date.getFullYear(), date.getMonth(), 1);
date = Date.getDate(date.getFullYear(), date.getMonth(), 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_END];
date = new Date(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
date = Date.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_WEEK_PREV:
@ -229,7 +229,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
break;
case BI.DateTrigger.MULTI_DATE_DAY_TODAY:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_DAY_TODAY];
date = new Date();
date = Date.getDate();
_setInnerValue(date, text);
break;
default:

4
src/widget/datepane/datepane.js

@ -15,7 +15,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
BI.DatePaneWidget.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = new Date();
this.today = Date.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
@ -79,7 +79,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
},
_getNewCurrentDate: function () {
var today = new Date();
var today = Date.getDate();
return {
year: today.getFullYear(),
month: today.getMonth()

2
src/widget/datetime/datetime.combo.js

@ -20,7 +20,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
_init: function () {
BI.DateTimeCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var date = new Date();
var date = Date.getDate();
this.storeValue = {
year: date.getFullYear(),
month: date.getMonth(),

4
src/widget/datetime/datetime.popup.js

@ -106,7 +106,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
}]
});
var date = new Date();
var date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
@ -138,7 +138,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var value = v, date;
if (BI.isNull(value)) {
date = new Date();
date = Date.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),

4
src/widget/datetime/datetime.trigger.js

@ -46,10 +46,10 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
var self = this;
var value = v, dateStr;
if(BI.isNull(value)){
value = new Date();
value = Date.getDate();
dateStr = value.print("%Y-%X-%d %H:%M:%S");
} else {
var date = new Date(value.year,value.month,value.day,value.hour,value.minute,value.second);
var date = Date.getDate(value.year,value.month,value.day,value.hour,value.minute,value.second);
dateStr = date.print("%Y-%X-%d %H:%M:%S");
}

7
src/widget/intervalslider/intervalslider.js

@ -295,14 +295,19 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
_checkValidation: function (v) {
var o = this.options;
var valid = false;
//像90.这样的既不属于整数又不属于小数,是不合法的值
var dotText = (v + "").split(".")[1];
if (BI.isEmptyString(dotText)) {
}else{
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
if(o.digit === false){
valid = true;
}else{
var dotText = (v + "").split(".")[1] || "";
dotText = dotText || "";
valid = (dotText.length === o.digit);
}
}
}
return valid;
},

34
src/widget/multidate/abstract.multidate.datepane.js

@ -112,39 +112,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var type = valueObject.type, value = valueObject.value;
switch (type) {
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return new Date().getOffsetDate(-1 * value);
return Date.getDate().getOffsetDate(-1 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return new Date().getOffsetDate(value);
return Date.getDate().getOffsetDate(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return new Date();
return Date.getDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return new Date().getBeforeMultiMonth(value);
return Date.getDate().getBeforeMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return new Date().getAfterMultiMonth(value);
return Date.getDate().getAfterMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return new Date(new Date().getFullYear(), new Date().getMonth(), (new Date().getLastDateOfMonth()).getDate());
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), (Date.getDate().getLastDateOfMonth()).getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return new Date().getBeforeMulQuarter(value);
return Date.getDate().getBeforeMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return new Date().getAfterMulQuarter(value);
return Date.getDate().getAfterMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return new Date().getQuarterStartDate();
return Date.getDate().getQuarterStartDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return new Date().getQuarterEndDate();
return Date.getDate().getQuarterEndDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return new Date().getOffsetDate(-7 * value);
return Date.getDate().getOffsetDate(-7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return new Date().getOffsetDate(7 * value);
return Date.getDate().getOffsetDate(7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return new Date((new Date().getFullYear() - 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() - 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return new Date((new Date().getFullYear() + 1 * value), new Date().getMonth(), new Date().getDate());
return Date.getDate((Date.getDate().getFullYear() + 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return new Date(new Date().getFullYear(), 0, 1);
return Date.getDate(Date.getDate().getFullYear(), 0, 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return new Date(new Date().getFullYear(), 11, 31);
return Date.getDate(Date.getDate().getFullYear(), 11, 31);
}
}
});

4
src/widget/multidate/multidate.combo.js

@ -22,7 +22,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
BI.MultiDateCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = new Date();
var date = Date.getDate();
this.storeValue = null;
this.trigger = BI.createWidget({
type: 'bi.date_trigger',
@ -89,7 +89,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
});
this.popup.on(BI.MultiDatePopup.BUTTON_lABEL_EVENT_CHANGE, function () {
var date = new Date();
var date = Date.getDate();
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),

6
src/widget/multidate/multidate.popup.js

@ -216,7 +216,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
},
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
setValue: function (v) {
@ -274,8 +274,8 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day);
break;
default:
if (!this._checkValueValid(value)) {
var date = new Date();
if (this._checkValueValid(value)) {
var date = Date.getDate();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({
year: date.getFullYear(),

4
src/widget/year/popup.year.js

@ -37,7 +37,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this;
this.selectedYear = this._year = new Date().getFullYear();
this.selectedYear = this._year = Date.getDate().getFullYear();
var backBtn = BI.createWidget({
type: "bi.icon_button",
@ -91,7 +91,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var o = this.options;
if (Date.checkVoid(v, 1, 1, o.min, o.max)[0]) {
v = new Date().getFullYear();
v = Date.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");

Loading…
Cancel
Save