diff --git a/dist/bundle.js b/dist/bundle.js index ac3fe196b0..1e5a2358bf 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -90357,8 +90357,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** date = date.getOffsetDate(BI.parseInt(obj.day)); } 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) { date = this.getBeginDate(date, obj); diff --git a/dist/fineui.js b/dist/fineui.js index ad917b9ed8..3ff5719e76 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -90600,8 +90600,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** date = date.getOffsetDate(BI.parseInt(obj.day)); } 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) { date = this.getBeginDate(date, obj); diff --git a/dist/widget.js b/dist/widget.js index 362385c044..9f591f72e2 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -2778,8 +2778,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** date = date.getOffsetDate(BI.parseInt(obj.day)); } 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) { date = this.getBeginDate(date, obj); diff --git a/src/widget/dynamicdate/dynamicdate.caculate.js b/src/widget/dynamicdate/dynamicdate.caculate.js index 649b367296..75ad50dac2 100644 --- a/src/widget/dynamicdate/dynamicdate.caculate.js +++ b/src/widget/dynamicdate/dynamicdate.caculate.js @@ -28,8 +28,18 @@ date = date.getOffsetDate(BI.parseInt(obj.day)); } 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) { date = this.getBeginDate(date, obj);