Browse Source

Merge pull request #421 in FUI/fineui from ~WINDY/fui:master to master

* commit 'e500639dc31be5ce308d8b275b392f33c4a9d5e3':
  update
  工作日
es6
guy 7 years ago
parent
commit
255b537b4d
  1. 28
      dist/_fineui.min.js
  2. 14
      dist/bundle.js
  3. 28
      dist/bundle.min.js
  4. 105
      dist/demo.js
  5. 14
      dist/fineui.js
  6. 28
      dist/fineui.min.js
  7. 14
      dist/widget.js
  8. 14
      src/widget/dynamicdate/dynamicdate.caculate.js

28
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

14
dist/bundle.js vendored

@ -90357,8 +90357,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/**
date = date.getOffsetDate(BI.parseInt(obj.day)); date = date.getOffsetDate(BI.parseInt(obj.day));
} }
if (BI.isNotNull(obj.workDay)) { if (BI.isNotNull(obj.workDay)) {
// todo 根据工作日做偏移 暂时按天偏移 // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算
date = date.getOffsetDate(BI.parseInt(obj.workDay)); if(BI.isNotNull(Date.holidays)) {
var count = Math.abs(obj.workDay);
for (var i = 0; i < count; i++) {
date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1);
if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) {
i--;
}
}
} else {
date = date.getOffsetDate(BI.parseInt(obj.workDay));
}
} }
if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) {
date = this.getBeginDate(date, obj); date = this.getBeginDate(date, obj);

28
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

105
dist/demo.js vendored

@ -11017,6 +11017,111 @@ BI.shortcut("demo.tmp", Demo.Func);
}); });
BI.shortcut("demo.fix_global_watcher", Demo.Fix); BI.shortcut("demo.fix_global_watcher", Demo.Fix);
}());(function () {
var State = BI.inherit(Fix.Model, {
state: function () {
return {
name: "原始属性",
info: {
age: 12,
sex: "male",
birth: {
year: 2018,
month: 9,
day: 11
}
},
career: [{
a: 1,
b: 2,
c: 3
}]
};
},
computed: {
b: function () {
return this.model.name + "-计算属性";
},
birth: function () {
return this.model.info.birth;
}
}
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return new State();
},
watch: {
b: function () {
this.button.setText(this.model.b);
},
"birth.**": function () {
console.log(123);
}
},
render: function () {
var self = this;
return {
type: "bi.vertical",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.name = "这是改变后的属性";
},
text: this.model.b
}
}, {
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.birth.year = 2019;
},
text: "birthYearButton"
}
}, {
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.career.push({
year: 2017,
month: 3,
day: 24
});
},
text: "careerAddButton"
}
}, {
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.career[0].a = 24;
},
text: "careerChangeButton"
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_immutable", Demo.Fix);
}());/** }());/**
* @Author: Young * @Author: Young
* @CreationDate 2017-11-06 10:32 * @CreationDate 2017-11-06 10:32

14
dist/fineui.js vendored

@ -90600,8 +90600,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/**
date = date.getOffsetDate(BI.parseInt(obj.day)); date = date.getOffsetDate(BI.parseInt(obj.day));
} }
if (BI.isNotNull(obj.workDay)) { if (BI.isNotNull(obj.workDay)) {
// todo 根据工作日做偏移 暂时按天偏移 // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算
date = date.getOffsetDate(BI.parseInt(obj.workDay)); if(BI.isNotNull(Date.holidays)) {
var count = Math.abs(obj.workDay);
for (var i = 0; i < count; i++) {
date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1);
if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) {
i--;
}
}
} else {
date = date.getOffsetDate(BI.parseInt(obj.workDay));
}
} }
if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) {
date = this.getBeginDate(date, obj); date = this.getBeginDate(date, obj);

28
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

14
dist/widget.js vendored

@ -2778,8 +2778,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/**
date = date.getOffsetDate(BI.parseInt(obj.day)); date = date.getOffsetDate(BI.parseInt(obj.day));
} }
if (BI.isNotNull(obj.workDay)) { if (BI.isNotNull(obj.workDay)) {
// todo 根据工作日做偏移 暂时按天偏移 // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算
date = date.getOffsetDate(BI.parseInt(obj.workDay)); if(BI.isNotNull(Date.holidays)) {
var count = Math.abs(obj.workDay);
for (var i = 0; i < count; i++) {
date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1);
if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) {
i--;
}
}
} else {
date = date.getOffsetDate(BI.parseInt(obj.workDay));
}
} }
if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) {
date = this.getBeginDate(date, obj); date = this.getBeginDate(date, obj);

14
src/widget/dynamicdate/dynamicdate.caculate.js

@ -28,8 +28,18 @@
date = date.getOffsetDate(BI.parseInt(obj.day)); date = date.getOffsetDate(BI.parseInt(obj.day));
} }
if (BI.isNotNull(obj.workDay)) { if (BI.isNotNull(obj.workDay)) {
// todo 根据工作日做偏移 暂时按天偏移 // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算
date = date.getOffsetDate(BI.parseInt(obj.workDay)); if(BI.isNotNull(Date.holidays)) {
var count = Math.abs(obj.workDay);
for (var i = 0; i < count; i++) {
date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1);
if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) {
i--;
}
}
} else {
date = date.getOffsetDate(BI.parseInt(obj.workDay));
}
} }
if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) {
date = this.getBeginDate(date, obj); date = this.getBeginDate(date, obj);

Loading…
Cancel
Save