Browse Source

Merge branch 'master' of ssh://cloud.finedevelop.com:7999/~fay/fineui

# Conflicts:
#	dist/_fineui.min.js
#	dist/bundle.min.js
#	dist/fineui.min.js
es6
fay 7 years ago
parent
commit
fcd8ea9fb4
  1. 24
      Gruntfile.js
  2. 2
      demo/js/case/combo/demo.search_text_value_combo.js
  3. 2
      demo/js/case/combo/demo.text_value_combo.js
  4. 2
      demo/js/widget/multiselect/demo.multi_select_combo.js
  5. 2
      demo/js/widget/timeinterval/demo.time_interval.js
  6. 2
      demo/version.js
  7. 7
      dist/base.css
  8. 7
      dist/bundle.css
  9. 279
      dist/bundle.js
  10. 2
      dist/bundle.min.css
  11. 14
      dist/case.js
  12. 2
      dist/config.js
  13. 48
      dist/core.js
  14. 8
      dist/demo.js
  15. 7
      dist/fineui.css
  16. 2
      dist/fineui.min.css
  17. 24
      dist/fix/fix.js
  18. 191
      dist/widget.js
  19. 238
      package-lock.json
  20. 1
      package.json
  21. 2
      public/js/index.js
  22. 4
      src/case/combo/bubblecombo/popup.bubble.js
  23. 7
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  24. 3
      src/case/combo/textvaluecombo/combo.textvalue.js
  25. 16
      src/core/wrapper/layout/adapt/inline.center.js
  26. 16
      src/core/wrapper/layout/adapt/inline.vertical.js
  27. 16
      src/core/wrapper/layout/layout.inline.js
  28. 3
      src/css/base/editor/editor.adapt.css
  29. 4
      src/css/base/editor/editor.css
  30. 7
      src/less/base/editor/editor.adapt.less
  31. 4
      src/widget/date/calendar/picker.date.js
  32. 20
      src/widget/downlist/popup.downlist.js
  33. 1
      src/widget/dynamicdate/dynamicdate.combo.js
  34. 2
      src/widget/dynamicdate/dynamicdate.popup.js
  35. 40
      src/widget/dynamicdate/dynamicdate.trigger.js
  36. 1
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  37. 2
      src/widget/dynamicdatetime/dynamicdatetime.popup.js
  38. 55
      src/widget/dynamicdatetime/dynamicdatetime.trigger.js
  39. 2
      src/widget/multiselect/multiselect..insert.combo.js
  40. 12
      src/widget/multitree/trigger/searcher.multi.tree.js
  41. 1
      src/widget/year/combo.year.js
  42. 2
      src/widget/year/trigger.year.js
  43. 10
      src/widget/yearmonth/combo.yearmonth.js
  44. 6
      src/widget/yearmonth/trigger.yearmonth.js
  45. 14
      src/widget/yearmonthinterval/yearmonthinterval.js
  46. 11
      src/widget/yearquarter/combo.yearquarter.js
  47. 2
      src/widget/yearquarter/popup.yearquarter.js
  48. 6
      src/widget/yearquarter/trigger.yearquarter.js
  49. 2
      ui/js/index.js

24
Gruntfile.js

@ -257,6 +257,27 @@ module.exports = function (grunt) {
spanw: true, spanw: true,
interrupt: true interrupt: true
} }
},
livereload: {
options: {
livereload: "<%= connect.options.livereload %>"
},
files: ["src/**/*.js", "src/**/*.less"]
}
},
connect: {
options: {
port: 9000,
open: true,
livereload: 35729,
// Change this to '0.0.0.0' to access the server from outside
hostname: "localhost"
},
server: {
options: {
port: 9001,
base: "./dist"
}
} }
} }
}); });
@ -267,8 +288,9 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-contrib-watch"); grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-concat"); grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-cssmin"); grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.registerTask("default", ["less", "concat", "watch"]); grunt.registerTask("default", ["less", "concat", "connect", "watch"]);
grunt.registerTask("min", ["less", "concat", "uglify", "cssmin"]); grunt.registerTask("min", ["less", "concat", "uglify", "cssmin"]);
grunt.registerTask("build", ["less", "concat", "uglify", "cssmin", "uglify", "concat"]); grunt.registerTask("build", ["less", "concat", "uglify", "cssmin", "uglify", "concat"]);
}; };

2
demo/js/case/combo/demo.search_text_value_combo.js

@ -15,7 +15,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
combo = this; combo = this;
}, },
text: "默认值", text: "默认值",
value: 2, value: 14,
width: 300, width: 300,
items: [{ items: [{
text: "ABC-1", text: "ABC-1",

2
demo/js/case/combo/demo.text_value_combo.js

@ -15,7 +15,7 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
combo = this; combo = this;
}, },
text: "默认值", text: "默认值",
value: 2, value: 22,
width: 300, width: 300,
items: [{ items: [{
text: "MVC-1", text: "MVC-1",

2
demo/js/widget/multiselect/demo.multi_select_combo.js

@ -9,7 +9,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_createMultiSelectCombo: function () { _createMultiSelectCombo: function () {
var self = this; var self = this;
var widget = BI.createWidget({ var widget = BI.createWidget({
type: "bi.multi_select_combo", type: "bi.multi_select_insert_combo",
itemsCreator: BI.bind(this._itemsCreator, this), itemsCreator: BI.bind(this._itemsCreator, this),
width: 200, width: 200,
value: { value: {

2
demo/js/widget/timeinterval/demo.time_interval.js

@ -28,7 +28,7 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
type: 1, type: 1,
value: { value: {
year: 2018, year: 2018,
month: 0, month: 1,
day: 12 day: 12
} }
} }

2
demo/version.js

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明", "BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一", "BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末", "BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间", "BI-Time_Interval_Error_Text": "请保证开始时间早于/等于时间",
"BI-Basic_Time": "时间", "BI-Basic_Time": "时间",
"BI-Basic_OK": "确定", "BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定", "BI-Basic_Sure": "确定",

7
dist/base.css vendored

@ -309,13 +309,6 @@
.bi-bubble-popup-view { .bi-bubble-popup-view {
} }
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}
/*************BI.SearchEditor******************/ /*************BI.SearchEditor******************/
.bi-search-editor .close-font { .bi-search-editor .close-font {
font-size: 20px; font-size: 20px;

7
dist/bundle.css vendored

@ -2362,13 +2362,6 @@ textarea {
.bi-bubble-popup-view { .bi-bubble-popup-view {
} }
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}
/*************BI.SearchEditor******************/ /*************BI.SearchEditor******************/
.bi-search-editor .close-font { .bi-search-editor .close-font {
font-size: 20px; font-size: 20px;

279
dist/bundle.js vendored

@ -31465,24 +31465,24 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
"*zoom": 1, "*zoom": 1,
"min-width": 100 / length + "%" "min-width": 100 / length + "%"
}); });
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;
@ -31551,24 +31551,24 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
"*display": "inline", "*display": "inline",
"*zoom": 1 "*zoom": 1
}); });
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;
@ -33209,24 +33209,24 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
var o = this.options; var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments); var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1}); w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;
@ -34527,10 +34527,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var _resolve = void 0; var _resolve = void 0;
callbacks.push(function () { callbacks.push(function () {
if (cb) { if (cb) {
// try { try {
cb.call(ctx); cb.call(ctx);
// } catch (e) { } catch (e) {
// } console.error(e);
}
} else if (_resolve) { } else if (_resolve) {
_resolve(ctx); _resolve(ctx);
} }
@ -35147,7 +35148,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} catch (e) { } catch (e) {
// if (this.user) { // if (this.user) {
// } else { // } else {
throw e; console.error(e);
// } // }
} finally { } finally {
// "touch" every property so they are all tracked as // "touch" every property so they are all tracked as
@ -35213,12 +35214,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var oldValue = this.value; var oldValue = this.value;
this.value = value; this.value = value;
if (this.user) { if (this.user) {
// try { try {
this.cb.call(this.vm, value, oldValue, options); this.cb.call(this.vm, value, oldValue, options);
// } catch (e) { } catch (e) {
// } console.log(e);
}
} else { } else {
try {
this.cb.call(this.vm, value, oldValue, options); this.cb.call(this.vm, value, oldValue, options);
} catch (e) {
console.log(e);
}
} }
} }
} }
@ -35384,7 +35390,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return NaN; return NaN;
}, function (newValue, oldValue, opt) { }, function (newValue, oldValue, opt) {
callback(i, newValue, oldValue, _.extend({ index: i }, opt)); callback(i, newValue, oldValue, _.extend({ index: i }, opt));
}); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
w.teardown(); w.teardown();
v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep); v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep);
@ -35425,7 +35431,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return NaN; return NaN;
}, function (newValue, oldValue, opt) { }, function (newValue, oldValue, opt) {
callback(i, newValue, oldValue, _.extend({ index: i }, opt)); callback(i, newValue, oldValue, _.extend({ index: i }, opt));
}); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
_w.teardown(); _w.teardown();
root._globalDeps && delete root._globalDeps[regStr]; root._globalDeps && delete root._globalDeps[regStr];
@ -77532,7 +77538,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view", extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}, {value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}] buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
}); });
}, },
_init: function () { _init: function () {
@ -77542,7 +77548,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
var o = this.options, self = this; var o = this.options, self = this;
var items = []; var items = [];
BI.each(o.buttons.reverse(), function (i, buttonOpt) { BI.each(o.buttons, function (i, buttonOpt) {
if(BI.isWidget(buttonOpt)) { if(BI.isWidget(buttonOpt)) {
items.push(buttonOpt); items.push(buttonOpt);
}else{ }else{
@ -78215,6 +78221,13 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
},
_checkError: function (v) { _checkError: function (v) {
if(BI.isNotNull(v)) { if(BI.isNotNull(v)) {
v = BI.isArray(v) ? v : [v]; v = BI.isArray(v) ? v : [v];
@ -78741,6 +78754,9 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
maxHeight: 300 maxHeight: 300
} }
}); });
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
}, },
_checkError: function (v) { _checkError: function (v) {
@ -87707,7 +87723,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
height: 25 height: 25
}); });
this.left.on(BI.IconButton.EVENT_CHANGE, function () { this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 0) { if (self._month === 1) {
self.setValue({ self.setValue({
year: self.year.getValue() - 1, year: self.year.getValue() - 1,
month: 12 month: 12
@ -87731,7 +87747,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
}); });
this.right.on(BI.IconButton.EVENT_CHANGE, function () { this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 11) { if (self._month === 12) {
self.setValue({ self.setValue({
year: self.year.getValue() + 1, year: self.year.getValue() + 1,
month: 0 month: 0
@ -89946,7 +89962,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
this.singleValues = []; this.singleValues = [];
this.childValueMap = {}; this.childValueMap = {};
this.fatherValueMap = {}; this.fatherValueMap = {};
var self = this, o = this.options, children = this._createChildren(o.items); this.items = BI.deepClone(this.options.items);
var self = this, o = this.options, children = this._createChildren(this.items);
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.button_tree", type: "bi.button_tree",
items: BI.createItems(children, items: BI.createItems(children,
@ -89996,7 +90013,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
_createChildren: function (items) { _createChildren: function (items) {
var self = this, result = []; var self = this, result = [];
// 不能修改populate进来的item的引用 // 不能修改populate进来的item的引用
BI.each(BI.deepClone(items), function (i, it) { BI.each(items, function (i, it) {
var item_done = { var item_done = {
type: "bi.down_list_group", type: "bi.down_list_group",
items: [] items: []
@ -90115,9 +90132,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
}, },
_checkValues: function (values) { _checkValues: function (values) {
var self = this, o = this.options;
var value = []; var value = [];
BI.each(o.items, function (idx, itemGroup) { BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) { BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) { if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value"); var childValues = BI.map(item.children, "value");
@ -90150,17 +90166,17 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
populate: function (items) { populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments); BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this; this.items = BI.deepClone(items);
self.childValueMap = {}; this.childValueMap = {};
self.fatherValueMap = {}; this.fatherValueMap = {};
self.singleValues = []; this.singleValues = [];
var children = self._createChildren(items); var children = this._createChildren(this.items);
var popupItem = BI.createItems(children, var popupItem = BI.createItems(children,
{}, { {}, {
adjustLength: -2 adjustLength: -2
} }
); );
self.popup.populate(popupItem); this.popup.populate(popupItem);
}, },
setValue: function (valueItem) { setValue: function (valueItem) {
@ -90693,6 +90709,7 @@ BI.extend(BI.DynamicDateCard, {
self.storeValue = null; self.storeValue = null;
self.trigger.setValue(); self.trigger.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
}] }]
@ -91081,7 +91098,7 @@ BI.shortcut("bi.dynamic_date_param_item", BI.DynamicDateParamItem);BI.DynamicDat
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({ self.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth(), month: date.getMonth() + 1,
day: date.getDate() day: date.getDate()
}); });
self._setInnerValue(); self._setInnerValue();
@ -91167,7 +91184,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
hgap: 4, hgap: 4,
vgap: 2, vgap: 2,
yearLength: 4, yearLength: 4,
yearMonthLength: 7 yearMonthLength: 6,
yearFullMonthLength: 7
}, },
props: { props: {
@ -91187,9 +91205,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
var date = v.match(/\d+/g); var date = v.match(/\d+/g);
self._autoAppend(v, date); self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({ return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0], year: date[0] | 0,
month: date[1], month: date[1] | 0,
day: date[2] day: date[2] | 0
}); });
}, },
quitChecker: function () { quitChecker: function () {
@ -91281,6 +91299,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
} }
break; break;
case this._const.yearMonthLength: case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
if (this._monthCheck(v)) { if (this._monthCheck(v)) {
this.editor.setValue(v + "-"); this.editor.setValue(v + "-");
} }
@ -91295,8 +91314,10 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
}, },
_monthCheck: function (v) { _monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); var date = BI.parseDateTime(v, "%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
}, },
_setInnerValue: function (date, text) { _setInnerValue: function (date, text) {
@ -91309,27 +91330,37 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
var endText = ""; var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter)) {
if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { if(BI.isNotNull(obj.month)) {
if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.week) && obj.week !== 0) { if(BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
} }
if(BI.isNotNull(obj.day) && obj.day !== 0) { if(BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : ""; endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
} }
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) { if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value + endText; return value + endText;
@ -91368,7 +91399,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
this.editor.setValue(""); this.editor.setValue("");
this.setTitle(""); this.setTitle("");
} else { } else {
var dateStr = value.year + "-" + (value.month) + "-" + value.day; var dateStr = BI.getDate(value.year, (value.month - 1), value.day).print("%Y-%X-%d");
this.editor.setState(dateStr); this.editor.setState(dateStr);
this.editor.setValue(dateStr); this.editor.setValue(dateStr);
this.setTitle(dateStr); this.setTitle(dateStr);
@ -91510,6 +91541,7 @@ BI.shortcut("bi.dynamic_date_trigger", BI.DynamicDateTrigger);BI.DynamicDateTime
self.storeValue = null; self.storeValue = null;
self.trigger.setValue(); self.trigger.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
} }
}] }]
@ -91799,7 +91831,7 @@ BI.extend(BI.DynamicDateTimeCombo, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({ self.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth(), month: date.getMonth() + 1,
day: date.getDate() day: date.getDate()
}); });
self.timeSelect.setValue(); self.timeSelect.setValue();
@ -92056,7 +92088,8 @@ BI.extend(BI.DynamicDateTimeSelect, {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2,
yearLength: 4, yearLength: 4,
yearMonthLength: 7 yearMonthLength: 6,
yearFullMonthLength: 7
}, },
props: { props: {
@ -92076,9 +92109,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
var date = v.match(/\d+/g); var date = v.match(/\d+/g);
self._autoAppend(v, date); self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({ return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0], year: date[0] | 0,
month: date[1], month: date[1] | 0,
day: date[2] day: date[2] | 0
}); });
}, },
quitChecker: function () { quitChecker: function () {
@ -92187,8 +92220,10 @@ BI.extend(BI.DynamicDateTimeSelect, {
}, },
_monthCheck: function (v) { _monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); var date = BI.parseDateTime(v, "%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
}, },
_setInnerValue: function (date, text) { _setInnerValue: function (date, text) {
@ -92200,25 +92235,41 @@ BI.extend(BI.DynamicDateTimeSelect, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { var endText = "";
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter)) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.week) && obj.week !== 0) { if(BI.isNotNull(obj.month)) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.day) && obj.day !== 0) { endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
} }
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) { if(BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value + endText;
function getPositionText (baseText, position) { function getPositionText (baseText, position) {
switch (position) { switch (position) {
@ -97143,7 +97194,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue); self.trigger.getCounter().setButtonChecked(self.storeValue);
}; };
this.storeValue = {}; this.storeValue = o.value || {};
// 标记正在请求数据 // 标记正在请求数据
this.requesting = false; this.requesting = false;
@ -100571,6 +100622,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
ob || (ob = {}); ob || (ob = {});
ob.value || (ob.value = {}); ob.value || (ob.value = {});
var count = 0;
if (BI.isNumber(ob)) { if (BI.isNumber(ob)) {
this.editor.setState(ob); this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) { } else if (BI.size(ob.value) === 0) {
@ -100580,9 +100632,17 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
BI.each(ob.value, function (name, children) { BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children); var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; "; text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
if (childNodes === "") {
count++;
}
}); });
if (count > 20) {
this.editor.setState(BI.Selection.Multi);
} else {
this.editor.setState(text); this.editor.setState(text);
} }
}
function getChildrenNode (ob) { function getChildrenNode (ob) {
var text = ""; var text = "";
@ -100591,6 +100651,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
index++; index++;
var childNodes = getChildrenNode(children); var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ","); text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
if (childNodes === "") {
count++;
}
}); });
return text; return text;
} }
@ -108127,6 +108190,7 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
self.storeValue = null; self.storeValue = null;
self.setValue(); self.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
}); });
@ -108542,7 +108606,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;
@ -108796,6 +108860,7 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments); BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = o.value; this.storeValue = o.value;
this.storeTriggerValue = "";
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.dynamic_year_month_trigger", type: "bi.dynamic_year_month_trigger",
min: o.min, min: o.min,
@ -108819,10 +108884,17 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
return; return;
} }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}); });
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () { this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS);
}); });
@ -109221,7 +109293,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
if(isYear) { if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
} }
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
}, },
quitChecker: function () { quitChecker: function () {
return false; return false;
@ -109303,10 +109375,10 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;
@ -109369,7 +109441,7 @@ BI.DynamicYearMonthTrigger.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP"; BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP";
BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.YearMonthInterval = BI.inherit(BI.Single, { BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 25, height: 26,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -109430,10 +109502,17 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year
}, },
_createCombo: function (v) { _createCombo: function (v) {
var self = this; var self = this, o = this.options;
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
value: v behaviors: o.behaviors,
value: v,
listeners: [{
eventName: BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW);
}
}]
}); });
combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () { combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
@ -109546,6 +109625,7 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year
BI.YearMonthInterval.EVENT_VALID = "EVENT_VALID"; BI.YearMonthInterval.EVENT_VALID = "EVENT_VALID";
BI.YearMonthInterval.EVENT_ERROR = "EVENT_ERROR"; BI.YearMonthInterval.EVENT_ERROR = "EVENT_ERROR";
BI.YearMonthInterval.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearMonthInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.year_month_interval", BI.YearMonthInterval);/** BI.shortcut("bi.year_month_interval", BI.YearMonthInterval);/**
* 年份展示面板 * 年份展示面板
* *
@ -109742,6 +109822,7 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments); BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = o.value; this.storeValue = o.value;
self.storeTriggerValue = "";
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.dynamic_year_quarter_trigger", type: "bi.dynamic_year_quarter_trigger",
min: o.min, min: o.min,
@ -109761,9 +109842,19 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
return; return;
} }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}); });
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_FOCUS);
});
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
@ -109955,7 +110046,7 @@ BI.extend(BI.DynamicYearQuarterCombo, {
this.textButton.setEnable(true); this.textButton.setEnable(true);
} else { } else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = date.print("%Y-%x"); date = date.print("%Y-%Q");
this.textButton.setValue(date); this.textButton.setValue(date);
this.textButton.setEnable(false); this.textButton.setEnable(false);
} }
@ -110142,7 +110233,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
if(isYear) { if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
} }
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
}, },
quitChecker: function () { quitChecker: function () {
return false; return false;
@ -110222,10 +110313,10 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;
@ -112374,7 +112465,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明", "BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一", "BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末", "BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间", "BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间", "BI-Basic_Time": "时间",
"BI-Basic_OK": "确定", "BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定", "BI-Basic_Sure": "确定",

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

14
dist/case.js vendored

@ -5087,7 +5087,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view", extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}, {value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}] buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
}); });
}, },
_init: function () { _init: function () {
@ -5097,7 +5097,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
var o = this.options, self = this; var o = this.options, self = this;
var items = []; var items = [];
BI.each(o.buttons.reverse(), function (i, buttonOpt) { BI.each(o.buttons, function (i, buttonOpt) {
if(BI.isWidget(buttonOpt)) { if(BI.isWidget(buttonOpt)) {
items.push(buttonOpt); items.push(buttonOpt);
}else{ }else{
@ -5770,6 +5770,13 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
},
_checkError: function (v) { _checkError: function (v) {
if(BI.isNotNull(v)) { if(BI.isNotNull(v)) {
v = BI.isArray(v) ? v : [v]; v = BI.isArray(v) ? v : [v];
@ -6296,6 +6303,9 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
maxHeight: 300 maxHeight: 300
} }
}); });
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
}, },
_checkError: function (v) { _checkError: function (v) {

2
dist/config.js vendored

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明", "BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一", "BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末", "BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间", "BI-Time_Interval_Error_Text": "请保证开始时间早于/等于时间",
"BI-Basic_Time": "时间", "BI-Basic_Time": "时间",
"BI-Basic_OK": "确定", "BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定", "BI-Basic_Sure": "确定",

48
dist/core.js vendored

@ -31465,24 +31465,24 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
"*zoom": 1, "*zoom": 1,
"min-width": 100 / length + "%" "min-width": 100 / length + "%"
}); });
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;
@ -31551,24 +31551,24 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
"*display": "inline", "*display": "inline",
"*zoom": 1 "*zoom": 1
}); });
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;
@ -33209,24 +33209,24 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
var o = this.options; var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments); var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1}); w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;

8
dist/demo.js vendored

@ -2068,7 +2068,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
combo = this; combo = this;
}, },
text: "默认值", text: "默认值",
value: 2, value: 14,
width: 300, width: 300,
items: [{ items: [{
text: "ABC-1", text: "ABC-1",
@ -2186,7 +2186,7 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
combo = this; combo = this;
}, },
text: "默认值", text: "默认值",
value: 2, value: 22,
width: 300, width: 300,
items: [{ items: [{
text: "MVC-1", text: "MVC-1",
@ -12712,7 +12712,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_createMultiSelectCombo: function () { _createMultiSelectCombo: function () {
var self = this; var self = this;
var widget = BI.createWidget({ var widget = BI.createWidget({
type: "bi.multi_select_combo", type: "bi.multi_select_insert_combo",
itemsCreator: BI.bind(this._itemsCreator, this), itemsCreator: BI.bind(this._itemsCreator, this),
width: 200, width: 200,
value: { value: {
@ -14304,7 +14304,7 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
type: 1, type: 1,
value: { value: {
year: 2018, year: 2018,
month: 0, month: 1,
day: 12 day: 12
} }
} }

7
dist/fineui.css vendored

@ -2362,13 +2362,6 @@ textarea {
.bi-bubble-popup-view { .bi-bubble-popup-view {
} }
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}
/*************BI.SearchEditor******************/ /*************BI.SearchEditor******************/
.bi-search-editor .close-font { .bi-search-editor .close-font {
font-size: 20px; font-size: 20px;

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

24
dist/fix/fix.js vendored

@ -132,10 +132,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var _resolve = void 0; var _resolve = void 0;
callbacks.push(function () { callbacks.push(function () {
if (cb) { if (cb) {
// try { try {
cb.call(ctx); cb.call(ctx);
// } catch (e) { } catch (e) {
// } console.error(e);
}
} else if (_resolve) { } else if (_resolve) {
_resolve(ctx); _resolve(ctx);
} }
@ -752,7 +753,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} catch (e) { } catch (e) {
// if (this.user) { // if (this.user) {
// } else { // } else {
throw e; console.error(e);
// } // }
} finally { } finally {
// "touch" every property so they are all tracked as // "touch" every property so they are all tracked as
@ -818,12 +819,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var oldValue = this.value; var oldValue = this.value;
this.value = value; this.value = value;
if (this.user) { if (this.user) {
// try { try {
this.cb.call(this.vm, value, oldValue, options); this.cb.call(this.vm, value, oldValue, options);
// } catch (e) { } catch (e) {
// } console.log(e);
}
} else { } else {
try {
this.cb.call(this.vm, value, oldValue, options); this.cb.call(this.vm, value, oldValue, options);
} catch (e) {
console.log(e);
}
} }
} }
} }
@ -989,7 +995,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return NaN; return NaN;
}, function (newValue, oldValue, opt) { }, function (newValue, oldValue, opt) {
callback(i, newValue, oldValue, _.extend({ index: i }, opt)); callback(i, newValue, oldValue, _.extend({ index: i }, opt));
}); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
w.teardown(); w.teardown();
v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep); v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep);
@ -1030,7 +1036,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return NaN; return NaN;
}, function (newValue, oldValue, opt) { }, function (newValue, oldValue, opt) {
callback(i, newValue, oldValue, _.extend({ index: i }, opt)); callback(i, newValue, oldValue, _.extend({ index: i }, opt));
}); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
_w.teardown(); _w.teardown();
root._globalDeps && delete root._globalDeps[regStr]; root._globalDeps && delete root._globalDeps[regStr];

191
dist/widget.js vendored

@ -570,7 +570,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
height: 25 height: 25
}); });
this.left.on(BI.IconButton.EVENT_CHANGE, function () { this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 0) { if (self._month === 1) {
self.setValue({ self.setValue({
year: self.year.getValue() - 1, year: self.year.getValue() - 1,
month: 12 month: 12
@ -594,7 +594,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
}); });
this.right.on(BI.IconButton.EVENT_CHANGE, function () { this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 11) { if (self._month === 12) {
self.setValue({ self.setValue({
year: self.year.getValue() + 1, year: self.year.getValue() + 1,
month: 0 month: 0
@ -2809,7 +2809,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
this.singleValues = []; this.singleValues = [];
this.childValueMap = {}; this.childValueMap = {};
this.fatherValueMap = {}; this.fatherValueMap = {};
var self = this, o = this.options, children = this._createChildren(o.items); this.items = BI.deepClone(this.options.items);
var self = this, o = this.options, children = this._createChildren(this.items);
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.button_tree", type: "bi.button_tree",
items: BI.createItems(children, items: BI.createItems(children,
@ -2859,7 +2860,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
_createChildren: function (items) { _createChildren: function (items) {
var self = this, result = []; var self = this, result = [];
// 不能修改populate进来的item的引用 // 不能修改populate进来的item的引用
BI.each(BI.deepClone(items), function (i, it) { BI.each(items, function (i, it) {
var item_done = { var item_done = {
type: "bi.down_list_group", type: "bi.down_list_group",
items: [] items: []
@ -2978,9 +2979,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
}, },
_checkValues: function (values) { _checkValues: function (values) {
var self = this, o = this.options;
var value = []; var value = [];
BI.each(o.items, function (idx, itemGroup) { BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) { BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) { if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value"); var childValues = BI.map(item.children, "value");
@ -3013,17 +3013,17 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
populate: function (items) { populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments); BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this; this.items = BI.deepClone(items);
self.childValueMap = {}; this.childValueMap = {};
self.fatherValueMap = {}; this.fatherValueMap = {};
self.singleValues = []; this.singleValues = [];
var children = self._createChildren(items); var children = this._createChildren(this.items);
var popupItem = BI.createItems(children, var popupItem = BI.createItems(children,
{}, { {}, {
adjustLength: -2 adjustLength: -2
} }
); );
self.popup.populate(popupItem); this.popup.populate(popupItem);
}, },
setValue: function (valueItem) { setValue: function (valueItem) {
@ -3556,6 +3556,7 @@ BI.extend(BI.DynamicDateCard, {
self.storeValue = null; self.storeValue = null;
self.trigger.setValue(); self.trigger.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
}] }]
@ -3944,7 +3945,7 @@ BI.shortcut("bi.dynamic_date_param_item", BI.DynamicDateParamItem);BI.DynamicDat
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({ self.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth(), month: date.getMonth() + 1,
day: date.getDate() day: date.getDate()
}); });
self._setInnerValue(); self._setInnerValue();
@ -4030,7 +4031,8 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
hgap: 4, hgap: 4,
vgap: 2, vgap: 2,
yearLength: 4, yearLength: 4,
yearMonthLength: 7 yearMonthLength: 6,
yearFullMonthLength: 7
}, },
props: { props: {
@ -4050,9 +4052,9 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
var date = v.match(/\d+/g); var date = v.match(/\d+/g);
self._autoAppend(v, date); self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({ return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0], year: date[0] | 0,
month: date[1], month: date[1] | 0,
day: date[2] day: date[2] | 0
}); });
}, },
quitChecker: function () { quitChecker: function () {
@ -4144,6 +4146,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
} }
break; break;
case this._const.yearMonthLength: case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
if (this._monthCheck(v)) { if (this._monthCheck(v)) {
this.editor.setValue(v + "-"); this.editor.setValue(v + "-");
} }
@ -4158,8 +4161,10 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
}, },
_monthCheck: function (v) { _monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); var date = BI.parseDateTime(v, "%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
}, },
_setInnerValue: function (date, text) { _setInnerValue: function (date, text) {
@ -4172,27 +4177,37 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
var endText = ""; var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter)) {
if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { if(BI.isNotNull(obj.month)) {
if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.week) && obj.week !== 0) { if(BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
} }
if(BI.isNotNull(obj.day) && obj.day !== 0) { if(BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : ""; endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
} }
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) { if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value + endText; return value + endText;
@ -4231,7 +4246,7 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
this.editor.setValue(""); this.editor.setValue("");
this.setTitle(""); this.setTitle("");
} else { } else {
var dateStr = value.year + "-" + (value.month) + "-" + value.day; var dateStr = BI.getDate(value.year, (value.month - 1), value.day).print("%Y-%X-%d");
this.editor.setState(dateStr); this.editor.setState(dateStr);
this.editor.setValue(dateStr); this.editor.setValue(dateStr);
this.setTitle(dateStr); this.setTitle(dateStr);
@ -4373,6 +4388,7 @@ BI.shortcut("bi.dynamic_date_trigger", BI.DynamicDateTrigger);BI.DynamicDateTime
self.storeValue = null; self.storeValue = null;
self.trigger.setValue(); self.trigger.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
} }
}] }]
@ -4662,7 +4678,7 @@ BI.extend(BI.DynamicDateTimeCombo, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({ self.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth(), month: date.getMonth() + 1,
day: date.getDate() day: date.getDate()
}); });
self.timeSelect.setValue(); self.timeSelect.setValue();
@ -4919,7 +4935,8 @@ BI.extend(BI.DynamicDateTimeSelect, {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2,
yearLength: 4, yearLength: 4,
yearMonthLength: 7 yearMonthLength: 6,
yearFullMonthLength: 7
}, },
props: { props: {
@ -4939,9 +4956,9 @@ BI.extend(BI.DynamicDateTimeSelect, {
var date = v.match(/\d+/g); var date = v.match(/\d+/g);
self._autoAppend(v, date); self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({ return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0], year: date[0] | 0,
month: date[1], month: date[1] | 0,
day: date[2] day: date[2] | 0
}); });
}, },
quitChecker: function () { quitChecker: function () {
@ -5050,8 +5067,10 @@ BI.extend(BI.DynamicDateTimeSelect, {
}, },
_monthCheck: function (v) { _monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); var date = BI.parseDateTime(v, "%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
}, },
_setInnerValue: function (date, text) { _setInnerValue: function (date, text) {
@ -5063,25 +5082,41 @@ BI.extend(BI.DynamicDateTimeSelect, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { var endText = "";
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter)) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.week) && obj.week !== 0) { if(BI.isNotNull(obj.month)) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.day) && obj.day !== 0) { endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
} }
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) { if(BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value + endText;
function getPositionText (baseText, position) { function getPositionText (baseText, position) {
switch (position) { switch (position) {
@ -10006,7 +10041,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue); self.trigger.getCounter().setButtonChecked(self.storeValue);
}; };
this.storeValue = {}; this.storeValue = o.value || {};
// 标记正在请求数据 // 标记正在请求数据
this.requesting = false; this.requesting = false;
@ -13434,6 +13469,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
ob || (ob = {}); ob || (ob = {});
ob.value || (ob.value = {}); ob.value || (ob.value = {});
var count = 0;
if (BI.isNumber(ob)) { if (BI.isNumber(ob)) {
this.editor.setState(ob); this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) { } else if (BI.size(ob.value) === 0) {
@ -13443,9 +13479,17 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
BI.each(ob.value, function (name, children) { BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children); var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; "; text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
if (childNodes === "") {
count++;
}
}); });
if (count > 20) {
this.editor.setState(BI.Selection.Multi);
} else {
this.editor.setState(text); this.editor.setState(text);
} }
}
function getChildrenNode (ob) { function getChildrenNode (ob) {
var text = ""; var text = "";
@ -13454,6 +13498,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
index++; index++;
var childNodes = getChildrenNode(children); var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ","); text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
if (childNodes === "") {
count++;
}
}); });
return text; return text;
} }
@ -20990,6 +21037,7 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
self.storeValue = null; self.storeValue = null;
self.setValue(); self.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
}); });
@ -21405,7 +21453,7 @@ BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);BI.DynamicYearTrigger
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;
@ -21659,6 +21707,7 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments); BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = o.value; this.storeValue = o.value;
this.storeTriggerValue = "";
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.dynamic_year_month_trigger", type: "bi.dynamic_year_month_trigger",
min: o.min, min: o.min,
@ -21682,10 +21731,17 @@ BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);BI.DynamicYearM
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
return; return;
} }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}); });
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () { this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS);
}); });
@ -22084,7 +22140,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
if(isYear) { if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
} }
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
}, },
quitChecker: function () { quitChecker: function () {
return false; return false;
@ -22166,10 +22222,10 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;
@ -22232,7 +22288,7 @@ BI.DynamicYearMonthTrigger.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP"; BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP";
BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.YearMonthInterval = BI.inherit(BI.Single, { BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 25, height: 26,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -22293,10 +22349,17 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year
}, },
_createCombo: function (v) { _createCombo: function (v) {
var self = this; var self = this, o = this.options;
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
value: v behaviors: o.behaviors,
value: v,
listeners: [{
eventName: BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW);
}
}]
}); });
combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () { combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
@ -22409,6 +22472,7 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year
BI.YearMonthInterval.EVENT_VALID = "EVENT_VALID"; BI.YearMonthInterval.EVENT_VALID = "EVENT_VALID";
BI.YearMonthInterval.EVENT_ERROR = "EVENT_ERROR"; BI.YearMonthInterval.EVENT_ERROR = "EVENT_ERROR";
BI.YearMonthInterval.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearMonthInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.year_month_interval", BI.YearMonthInterval);/** BI.shortcut("bi.year_month_interval", BI.YearMonthInterval);/**
* 年份展示面板 * 年份展示面板
* *
@ -22605,6 +22669,7 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments); BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = o.value; this.storeValue = o.value;
self.storeTriggerValue = "";
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.dynamic_year_quarter_trigger", type: "bi.dynamic_year_quarter_trigger",
min: o.min, min: o.min,
@ -22624,9 +22689,19 @@ BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);BI.DynamicY
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
return; return;
} }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}); });
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_FOCUS);
});
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
@ -22818,7 +22893,7 @@ BI.extend(BI.DynamicYearQuarterCombo, {
this.textButton.setEnable(true); this.textButton.setEnable(true);
} else { } else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = date.print("%Y-%x"); date = date.print("%Y-%Q");
this.textButton.setValue(date); this.textButton.setValue(date);
this.textButton.setEnable(false); this.textButton.setEnable(false);
} }
@ -23005,7 +23080,7 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
if(isYear) { if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
} }
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
}, },
quitChecker: function () { quitChecker: function () {
return false; return false;
@ -23085,10 +23160,10 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;

238
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "1.1.1", "version": "1.1.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -135,6 +135,21 @@
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true "dev": true
}, },
"basic-auth": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz",
"integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"batch": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz",
"integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=",
"dev": true
},
"bcrypt-pbkdf": { "bcrypt-pbkdf": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
@ -400,6 +415,62 @@
"typedarray": "0.0.6" "typedarray": "0.0.6"
} }
}, },
"connect": {
"version": "3.6.6",
"resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz",
"integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=",
"dev": true,
"requires": {
"debug": "2.6.9",
"finalhandler": "1.1.0",
"parseurl": "1.3.2",
"utils-merge": "1.0.1"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"finalhandler": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz",
"integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=",
"dev": true,
"requires": {
"debug": "2.6.9",
"encodeurl": "1.0.1",
"escape-html": "1.0.3",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"statuses": "1.3.1",
"unpipe": "1.0.0"
}
},
"parseurl": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=",
"dev": true
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
"dev": true
}
}
},
"connect-livereload": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/connect-livereload/-/connect-livereload-0.5.4.tgz",
"integrity": "sha1-gBV9E3HJ83zBQDmrGJWXDRGdw7w=",
"dev": true
},
"console-browserify": { "console-browserify": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
@ -959,6 +1030,23 @@
"source-map": "0.5.6" "source-map": "0.5.6"
} }
}, },
"grunt-contrib-connect": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/grunt-contrib-connect/-/grunt-contrib-connect-1.0.2.tgz",
"integrity": "sha1-XPkzuRpnOGBEJzwLJERgPNmIebo=",
"dev": true,
"requires": {
"async": "1.5.2",
"connect": "3.6.6",
"connect-livereload": "0.5.4",
"http2": "3.3.7",
"morgan": "1.9.0",
"opn": "4.0.2",
"portscanner": "1.2.0",
"serve-index": "1.9.1",
"serve-static": "1.12.3"
}
},
"grunt-contrib-cssmin": { "grunt-contrib-cssmin": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-1.0.2.tgz", "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-1.0.2.tgz",
@ -1234,6 +1322,12 @@
"sshpk": "1.13.1" "sshpk": "1.13.1"
} }
}, },
"http2": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/http2/-/http2-3.3.7.tgz",
"integrity": "sha512-puSi8M8WNlFJm9Pk4c/Mbz9Gwparuj3gO9/RRO5zv6piQ0FY+9Qywp0PdWshYgsMJSalixFY7eC6oPu0zRxLAQ==",
"dev": true
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.18", "version": "0.4.18",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz",
@ -1615,6 +1709,36 @@
} }
} }
}, },
"morgan": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz",
"integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=",
"dev": true,
"requires": {
"basic-auth": "2.0.0",
"debug": "2.6.9",
"depd": "1.1.2",
"on-finished": "2.3.0",
"on-headers": "1.0.1"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
"dev": true
}
}
},
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@ -1676,6 +1800,12 @@
"ee-first": "1.1.1" "ee-first": "1.1.1"
} }
}, },
"on-headers": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz",
"integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=",
"dev": true
},
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@ -1691,6 +1821,16 @@
"integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=", "integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=",
"dev": true "dev": true
}, },
"opn": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz",
"integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=",
"dev": true,
"requires": {
"object-assign": "4.1.1",
"pinkie-promise": "2.0.1"
}
},
"pako": { "pako": {
"version": "0.2.9", "version": "0.2.9",
"resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
@ -1772,6 +1912,15 @@
"pinkie": "2.0.4" "pinkie": "2.0.4"
} }
}, },
"portscanner": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/portscanner/-/portscanner-1.2.0.tgz",
"integrity": "sha1-sUu9olfRTDEPqcwJaCrwLUCWGAI=",
"dev": true,
"requires": {
"async": "1.5.2"
}
},
"pretty-bytes": { "pretty-bytes": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz",
@ -2005,6 +2154,93 @@
"statuses": "1.3.1" "statuses": "1.3.1"
} }
}, },
"serve-index": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
"integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=",
"dev": true,
"requires": {
"accepts": "1.3.5",
"batch": "0.6.1",
"debug": "2.6.9",
"escape-html": "1.0.3",
"http-errors": "1.6.3",
"mime-types": "2.1.18",
"parseurl": "1.3.2"
},
"dependencies": {
"accepts": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"dev": true,
"requires": {
"mime-types": "2.1.18",
"negotiator": "0.6.1"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
"dev": true
},
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"dev": true,
"requires": {
"depd": "1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": "1.5.0"
}
},
"mime-db": {
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
"integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==",
"dev": true
},
"mime-types": {
"version": "2.1.18",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"dev": true,
"requires": {
"mime-db": "1.33.0"
}
},
"parseurl": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=",
"dev": true
},
"setprototypeof": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==",
"dev": true
},
"statuses": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
"dev": true
}
}
},
"serve-static": { "serve-static": {
"version": "1.12.3", "version": "1.12.3",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz",

1
package.json

@ -8,6 +8,7 @@
"express": "^4.15.2", "express": "^4.15.2",
"grunt": "^1.0.1", "grunt": "^1.0.1",
"grunt-contrib-concat": "^1.0.1", "grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-cssmin": "^1.0.1", "grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-jshint": "^1.0.0", "grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-less": "^1.4.1", "grunt-contrib-less": "^1.4.1",

2
public/js/index.js

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明", "BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一", "BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末", "BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间", "BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间", "BI-Basic_Time": "时间",
"BI-Basic_OK": "确定", "BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定", "BI-Basic_Sure": "确定",

4
src/case/combo/bubblecombo/popup.bubble.js

@ -82,7 +82,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view", extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}, {value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}] buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
}); });
}, },
_init: function () { _init: function () {
@ -92,7 +92,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
var o = this.options, self = this; var o = this.options, self = this;
var items = []; var items = [];
BI.each(o.buttons.reverse(), function (i, buttonOpt) { BI.each(o.buttons, function (i, buttonOpt) {
if(BI.isWidget(buttonOpt)) { if(BI.isWidget(buttonOpt)) {
items.push(buttonOpt); items.push(buttonOpt);
}else{ }else{

7
src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js

@ -104,6 +104,13 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
}; };
}, },
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
},
_checkError: function (v) { _checkError: function (v) {
if(BI.isNotNull(v)) { if(BI.isNotNull(v)) {
v = BI.isArray(v) ? v : [v]; v = BI.isArray(v) ? v : [v];

3
src/case/combo/textvaluecombo/combo.textvalue.js

@ -49,6 +49,9 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
maxHeight: 300 maxHeight: 300
} }
}); });
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
}, },
_checkError: function (v) { _checkError: function (v) {

16
src/core/wrapper/layout/adapt/inline.center.js

@ -52,24 +52,24 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
"*zoom": 1, "*zoom": 1,
"min-width": 100 / length + "%" "min-width": 100 / length + "%"
}); });
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;

16
src/core/wrapper/layout/adapt/inline.vertical.js

@ -39,24 +39,24 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
"*display": "inline", "*display": "inline",
"*zoom": 1 "*zoom": 1
}); });
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;

16
src/core/wrapper/layout/layout.inline.js

@ -30,24 +30,24 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
var o = this.options; var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments); var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1}); w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) { if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px" "margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
}); });
} }
if (o.hgap + o.rgap + (item.rgap || 0) > 0) { if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px" "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
}); });
} }
if (o.vgap + o.tgap + (item.tgap || 0) > 0) { if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px" "margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
}); });
} }
if (o.vgap + o.bgap + (item.bgap || 0) > 0) { if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({ w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px" "margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
}); });
} }
return w; return w;

3
src/css/base/editor/editor.adapt.css

@ -1,3 +0,0 @@
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}

4
src/css/base/editor/editor.css

@ -1,7 +1,3 @@
.bi-adapt-editor .adapt-editor-text {
font-size: 14px;
}
/*************BI.SearchEditor******************/ /*************BI.SearchEditor******************/
.bi-search-editor .close-font { .bi-search-editor .close-font {
font-size: 20px; font-size: 20px;

7
src/less/base/editor/editor.adapt.less

@ -1,7 +0,0 @@
@import "../../index";
.bi-adapt-editor{
.adapt-editor-text{
font-size: @font-size-14;
}
}

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

@ -26,7 +26,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
height: 25 height: 25
}); });
this.left.on(BI.IconButton.EVENT_CHANGE, function () { this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 0) { if (self._month === 1) {
self.setValue({ self.setValue({
year: self.year.getValue() - 1, year: self.year.getValue() - 1,
month: 12 month: 12
@ -50,7 +50,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
}); });
this.right.on(BI.IconButton.EVENT_CHANGE, function () { this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 11) { if (self._month === 12) {
self.setValue({ self.setValue({
year: self.year.getValue() + 1, year: self.year.getValue() + 1,
month: 0 month: 0

20
src/widget/downlist/popup.downlist.js

@ -26,7 +26,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
this.singleValues = []; this.singleValues = [];
this.childValueMap = {}; this.childValueMap = {};
this.fatherValueMap = {}; this.fatherValueMap = {};
var self = this, o = this.options, children = this._createChildren(o.items); this.items = BI.deepClone(this.options.items);
var self = this, o = this.options, children = this._createChildren(this.items);
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.button_tree", type: "bi.button_tree",
items: BI.createItems(children, items: BI.createItems(children,
@ -76,7 +77,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
_createChildren: function (items) { _createChildren: function (items) {
var self = this, result = []; var self = this, result = [];
// 不能修改populate进来的item的引用 // 不能修改populate进来的item的引用
BI.each(BI.deepClone(items), function (i, it) { BI.each(items, function (i, it) {
var item_done = { var item_done = {
type: "bi.down_list_group", type: "bi.down_list_group",
items: [] items: []
@ -195,9 +196,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
}, },
_checkValues: function (values) { _checkValues: function (values) {
var self = this, o = this.options;
var value = []; var value = [];
BI.each(o.items, function (idx, itemGroup) { BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) { BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) { if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value"); var childValues = BI.map(item.children, "value");
@ -230,17 +230,17 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
populate: function (items) { populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments); BI.DownListPopup.superclass.populate.apply(this, arguments);
var self = this; this.items = BI.deepClone(items);
self.childValueMap = {}; this.childValueMap = {};
self.fatherValueMap = {}; this.fatherValueMap = {};
self.singleValues = []; this.singleValues = [];
var children = self._createChildren(items); var children = this._createChildren(this.items);
var popupItem = BI.createItems(children, var popupItem = BI.createItems(children,
{}, { {}, {
adjustLength: -2 adjustLength: -2
} }
); );
self.popup.populate(popupItem); this.popup.populate(popupItem);
}, },
setValue: function (valueItem) { setValue: function (valueItem) {

1
src/widget/dynamicdate/dynamicdate.combo.js

@ -113,6 +113,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.storeValue = null; self.storeValue = null;
self.trigger.setValue(); self.trigger.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
}] }]

2
src/widget/dynamicdate/dynamicdate.popup.js

@ -132,7 +132,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({ self.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth(), month: date.getMonth() + 1,
day: date.getDate() day: date.getDate()
}); });
self._setInnerValue(); self._setInnerValue();

40
src/widget/dynamicdate/dynamicdate.trigger.js

@ -3,7 +3,8 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2,
yearLength: 4, yearLength: 4,
yearMonthLength: 7 yearMonthLength: 6,
yearFullMonthLength: 7
}, },
props: { props: {
@ -23,9 +24,9 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
var date = v.match(/\d+/g); var date = v.match(/\d+/g);
self._autoAppend(v, date); self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({ return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0], year: date[0] | 0,
month: date[1], month: date[1] | 0,
day: date[2] day: date[2] | 0
}); });
}, },
quitChecker: function () { quitChecker: function () {
@ -117,6 +118,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
} }
break; break;
case this._const.yearMonthLength: case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
if (this._monthCheck(v)) { if (this._monthCheck(v)) {
this.editor.setValue(v + "-"); this.editor.setValue(v + "-");
} }
@ -131,8 +133,10 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
}, },
_monthCheck: function (v) { _monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); var date = BI.parseDateTime(v, "%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
}, },
_setInnerValue: function (date, text) { _setInnerValue: function (date, text) {
@ -145,27 +149,37 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
var endText = ""; var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter)) {
if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { if(BI.isNotNull(obj.month)) {
if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.week) && obj.week !== 0) { if(BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
} }
if(BI.isNotNull(obj.day) && obj.day !== 0) { if(BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : ""; endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
} }
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) { if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value + endText; return value + endText;
@ -204,7 +218,7 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
this.editor.setValue(""); this.editor.setValue("");
this.setTitle(""); this.setTitle("");
} else { } else {
var dateStr = value.year + "-" + (value.month) + "-" + value.day; var dateStr = BI.getDate(value.year, (value.month - 1), value.day).print("%Y-%X-%d");
this.editor.setState(dateStr); this.editor.setState(dateStr);
this.editor.setValue(dateStr); this.editor.setValue(dateStr);
this.setTitle(dateStr); this.setTitle(dateStr);

1
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -113,6 +113,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.storeValue = null; self.storeValue = null;
self.trigger.setValue(); self.trigger.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
} }
}] }]

2
src/widget/dynamicdatetime/dynamicdatetime.popup.js

@ -143,7 +143,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({ self.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth(), month: date.getMonth() + 1,
day: date.getDate() day: date.getDate()
}); });
self.timeSelect.setValue(); self.timeSelect.setValue();

55
src/widget/dynamicdatetime/dynamicdatetime.trigger.js

@ -3,7 +3,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
hgap: 4, hgap: 4,
vgap: 2, vgap: 2,
yearLength: 4, yearLength: 4,
yearMonthLength: 7 yearMonthLength: 6,
yearFullMonthLength: 7
}, },
props: { props: {
@ -23,9 +24,9 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
var date = v.match(/\d+/g); var date = v.match(/\d+/g);
self._autoAppend(v, date); self._autoAppend(v, date);
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({ return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0], year: date[0] | 0,
month: date[1], month: date[1] | 0,
day: date[2] day: date[2] | 0
}); });
}, },
quitChecker: function () { quitChecker: function () {
@ -134,8 +135,10 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
}, },
_monthCheck: function (v) { _monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d"); var date = BI.parseDateTime(v, "%Y-%X-%d");
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v && date >= this.options.min && date <= this.options.max; var dateStr = date.print("%Y-%X-%d");
return (date.getMonth() > 0 && (BI.parseDateTime(v, "%Y-%X").print("%Y-%X") === v ||
BI.parseDateTime(v, "%Y-%x").print("%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
}, },
_setInnerValue: function (date, text) { _setInnerValue: function (date, text) {
@ -147,25 +150,41 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { var endText = "";
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter)) {
if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month)) {
if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.week)) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.week) && obj.week !== 0) { if(BI.isNotNull(obj.day)) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.day) && obj.day !== 0) { endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
} }
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) { if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value + endText;
function getPositionText (baseText, position) { function getPositionText (baseText, position) {
switch (position) { switch (position) {

2
src/widget/multiselect/multiselect..insert.combo.js

@ -23,7 +23,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue); self.trigger.getCounter().setButtonChecked(self.storeValue);
}; };
this.storeValue = {}; this.storeValue = o.value || {};
// 标记正在请求数据 // 标记正在请求数据
this.requesting = false; this.requesting = false;

12
src/widget/multitree/trigger/searcher.multi.tree.js

@ -111,6 +111,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
ob || (ob = {}); ob || (ob = {});
ob.value || (ob.value = {}); ob.value || (ob.value = {});
var count = 0;
if (BI.isNumber(ob)) { if (BI.isNumber(ob)) {
this.editor.setState(ob); this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) { } else if (BI.size(ob.value) === 0) {
@ -120,9 +121,17 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
BI.each(ob.value, function (name, children) { BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children); var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; "; text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
if (childNodes === "") {
count++;
}
}); });
if (count > 20) {
this.editor.setState(BI.Selection.Multi);
} else {
this.editor.setState(text); this.editor.setState(text);
} }
}
function getChildrenNode (ob) { function getChildrenNode (ob) {
var text = ""; var text = "";
@ -131,6 +140,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
index++; index++;
var childNodes = getChildrenNode(children); var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ","); text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
if (childNodes === "") {
count++;
}
}); });
return text; return text;
} }

1
src/widget/year/combo.year.js

@ -41,6 +41,7 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
self.storeValue = null; self.storeValue = null;
self.setValue(); self.setValue();
} }
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
}); });

2
src/widget/year/trigger.year.js

@ -91,7 +91,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;

10
src/widget/yearmonth/combo.yearmonth.js

@ -12,6 +12,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments); BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = o.value; this.storeValue = o.value;
this.storeTriggerValue = "";
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.dynamic_year_month_trigger", type: "bi.dynamic_year_month_trigger",
min: o.min, min: o.min,
@ -35,10 +36,17 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
return; return;
} }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}); });
this.trigger.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () { this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS); self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS);
}); });

6
src/widget/yearmonth/trigger.yearmonth.js

@ -63,7 +63,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
if(isYear) { if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
} }
return v === "" || ((v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
}, },
quitChecker: function () { quitChecker: function () {
return false; return false;
@ -145,10 +145,10 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.month) && obj.month !== 0) { if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;

14
src/widget/yearmonthinterval/yearmonthinterval.js

@ -1,6 +1,6 @@
BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 25, height: 26,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -61,10 +61,17 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
}, },
_createCombo: function (v) { _createCombo: function (v) {
var self = this; var self = this, o = this.options;
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
value: v behaviors: o.behaviors,
value: v,
listeners: [{
eventName: BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW);
}
}]
}); });
combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () { combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
@ -177,4 +184,5 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
BI.YearMonthInterval.EVENT_VALID = "EVENT_VALID"; BI.YearMonthInterval.EVENT_VALID = "EVENT_VALID";
BI.YearMonthInterval.EVENT_ERROR = "EVENT_ERROR"; BI.YearMonthInterval.EVENT_ERROR = "EVENT_ERROR";
BI.YearMonthInterval.EVENT_CHANGE = "EVENT_CHANGE"; BI.YearMonthInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.year_month_interval", BI.YearMonthInterval); BI.shortcut("bi.year_month_interval", BI.YearMonthInterval);

11
src/widget/yearquarter/combo.yearquarter.js

@ -12,6 +12,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments); BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = o.value; this.storeValue = o.value;
self.storeTriggerValue = "";
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.dynamic_year_quarter_trigger", type: "bi.dynamic_year_quarter_trigger",
min: o.min, min: o.min,
@ -31,9 +32,19 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
return; return;
} }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue(); self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}); });
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_FOCUS);
});
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",

2
src/widget/yearquarter/popup.yearquarter.js

@ -74,7 +74,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
this.textButton.setEnable(true); this.textButton.setEnable(true);
} else { } else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = date.print("%Y-%x"); date = date.print("%Y-%Q");
this.textButton.setValue(date); this.textButton.setValue(date);
this.textButton.setEnable(false); this.textButton.setEnable(false);
} }

6
src/widget/yearquarter/trigger.yearquarter.js

@ -63,7 +63,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
if(isYear) { if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]); return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
} }
return v === "" || ((v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]); return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
}, },
quitChecker: function () { quitChecker: function () {
return false; return false;
@ -143,10 +143,10 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) { if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) { if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value; return value;

2
ui/js/index.js

@ -110,7 +110,7 @@ BI.i18n = {
"BI-Transparent_Color": "透明", "BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一", "BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末", "BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间", "BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间", "BI-Basic_Time": "时间",
"BI-Basic_OK": "确定", "BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定", "BI-Basic_Sure": "确定",

Loading…
Cancel
Save