iapyang 7 years ago
parent
commit
ca8a8f0c37
  1. 9
      Gruntfile.js
  2. 4
      dist/_fineui.min.js
  3. 73430
      dist/base.js
  4. 228348
      dist/bundle.js
  5. 4
      dist/bundle.min.js
  6. 228846
      dist/fineui.js
  7. 4
      dist/fineui.min.js
  8. 50860
      dist/widget.js
  9. 3
      package.json
  10. 60
      src/widget/yearmonthinterval/yearmonthinterval.js

9
Gruntfile.js

@ -310,7 +310,12 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.registerTask("default", ["less", "concat", "connect", "watch"]);
var defaultTask = ["less", "concat", "connect", "watch"];
grunt.registerTask("default", defaultTask);
grunt.registerTask("compile", function () {
grunt.config.set("connect.options.open", false);
grunt.task.run(defaultTask);
});
grunt.registerTask("min", ["less", "concat", "uglify", "cssmin"]);
grunt.registerTask("build", ["less", "concat", "uglify", "cssmin", "uglify", "concat"]);
};
};

4
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

73430
dist/base.js vendored

File diff suppressed because it is too large Load Diff

228348
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

4
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

228846
dist/fineui.js vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

50860
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

3
package.json

@ -20,7 +20,8 @@
"grunt": "grunt",
"start": "node server.js",
"uglify": "grunt min",
"build": "grunt build"
"build": "grunt build",
"compile": "grunt compile"
},
"repository": {
"type": "git",

60
src/widget/yearmonthinterval/yearmonthinterval.js

@ -81,35 +81,11 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
});
combo.on(BI.DynamicYearMonthCombo.EVENT_VALID, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
self._checkValid();
});
combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
self._checkValid();
});
combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW, function () {
@ -147,8 +123,17 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
// 判格式合法
_check: function (smallDate, bigDate) {
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g);
var smallDate4Check = (smallObj[0] || "") + "-" + (smallObj[1] || 1);
var bigDate4Check = (bigObj[0] || "") + "-" + (bigObj[1] || 1);
var smallDate4Check = "";
if (BI.isNotNull(smallObj)) {
smallDate4Check = (smallObj[0] || "") + "-" + (smallObj[1] || 1);
}
var bigDate4Check = "";
if (BI.isNotNull(bigObj)) {
bigDate4Check = (bigObj[0] || "") + "-" + (bigObj[1] || 1);
}
return this._dateCheck(smallDate4Check) && BI.checkDateLegal(smallDate) && this._checkVoid({
year: smallObj[0],
month: smallObj[1],
@ -171,10 +156,29 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
_clearTitle: function () {
this.setTitle("");
},
_checkValid: function () {
var self = this;
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
this._checkValid();
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};

Loading…
Cancel
Save