From 2250ed8172b459b20c3e78b028c39620cab44414 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 22 Jan 2021 16:45:14 +0800 Subject: [PATCH] update --- src/widget/dynamicdate/dynamicdate.card.js | 14 +++++++------- src/widget/year/card.dynamic.year.js | 4 ++-- src/widget/yearmonth/card.dynamic.yearmonth.js | 4 ++-- src/widget/yearquarter/card.dynamic.yearquarter.js | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/widget/dynamicdate/dynamicdate.card.js b/src/widget/dynamicdate/dynamicdate.card.js index cacb66eb5..621756ac0 100644 --- a/src/widget/dynamicdate/dynamicdate.card.js +++ b/src/widget/dynamicdate/dynamicdate.card.js @@ -284,22 +284,22 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { var valueMap = {}; switch (value.dateType) { case BI.DynamicDateCard.TYPE.YEAR: - valueMap.year = (value.offset === 0 ? -value.value : value.value); + valueMap.year = (value.offset === 0 ? -value.value : +value.value); break; case BI.DynamicDateCard.TYPE.QUARTER: - valueMap.quarter = (value.offset === 0 ? -value.value : value.value); + valueMap.quarter = (value.offset === 0 ? -value.value : +value.value); break; case BI.DynamicDateCard.TYPE.MONTH: - valueMap.month = (value.offset === 0 ? -value.value : value.value); + valueMap.month = (value.offset === 0 ? -value.value : +value.value); break; case BI.DynamicDateCard.TYPE.WEEK: - valueMap.week = (value.offset === 0 ? -value.value : value.value); + valueMap.week = (value.offset === 0 ? -value.value : +value.value); break; case BI.DynamicDateCard.TYPE.DAY: - valueMap.day = (value.offset === 0 ? -value.value : value.value); + valueMap.day = (value.offset === 0 ? -value.value : +value.value); break; case BI.DynamicDateCard.TYPE.WORK_DAY: - valueMap.workDay = (value.offset === 0 ? -value.value : value.value); + valueMap.workDay = (value.offset === 0 ? -value.value : +value.value); break; default: break; @@ -369,7 +369,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, { } if(this.workDayBox.isSelected()) { var value = buttons[0].getValue(); - valueMap.workDay = (value.offset === 0 ? -value.value : value.value); + valueMap.workDay = (value.offset === 0 ? -value.value : +value.value); } return valueMap; } diff --git a/src/widget/year/card.dynamic.year.js b/src/widget/year/card.dynamic.year.js index cf2d83ad6..25a96ae7f 100644 --- a/src/widget/year/card.dynamic.year.js +++ b/src/widget/year/card.dynamic.year.js @@ -48,7 +48,7 @@ BI.DynamicYearCard = BI.inherit(BI.Widget, { _checkDate: function (obj) { var o = this.options; var date = BI.DynamicDateHelper.getCalculation({ - year: (obj.offset === 0 ? -obj.value : obj.value) + year: (obj.offset === 0 ? -obj.value : +obj.value) }); return !BI.checkDateVoid(date.getFullYear(), date.getMonth() + 1, date.getDate(), o.min, o.max)[0]; @@ -82,7 +82,7 @@ BI.DynamicYearCard = BI.inherit(BI.Widget, { getValue: function () { var value = this.item.getValue(); return { - year: (value.offset === 0 ? -value.value : value.value) + year: (value.offset === 0 ? -value.value : +value.value) }; } }); diff --git a/src/widget/yearmonth/card.dynamic.yearmonth.js b/src/widget/yearmonth/card.dynamic.yearmonth.js index 7edd5a7f9..914f1988e 100644 --- a/src/widget/yearmonth/card.dynamic.yearmonth.js +++ b/src/widget/yearmonth/card.dynamic.yearmonth.js @@ -76,10 +76,10 @@ BI.DynamicYearMonthCard = BI.inherit(BI.Widget, { var valueMap = {}; switch (value.dateType) { case BI.DynamicDateCard.TYPE.YEAR: - valueMap.year = (value.offset === 0 ? -value.value : value.value); + valueMap.year = (value.offset === 0 ? -value.value : +value.value); break; case BI.DynamicDateCard.TYPE.MONTH: - valueMap.month = (value.offset === 0 ? -value.value : value.value); + valueMap.month = (value.offset === 0 ? -value.value : +value.value); break; default: break; diff --git a/src/widget/yearquarter/card.dynamic.yearquarter.js b/src/widget/yearquarter/card.dynamic.yearquarter.js index d0d8ca844..45edb3579 100644 --- a/src/widget/yearquarter/card.dynamic.yearquarter.js +++ b/src/widget/yearquarter/card.dynamic.yearquarter.js @@ -76,10 +76,10 @@ BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, { var valueMap = {}; switch (value.dateType) { case BI.DynamicDateCard.TYPE.YEAR: - valueMap.year = (value.offset === 0 ? -value.value : value.value); + valueMap.year = (value.offset === 0 ? -value.value : +value.value); break; case BI.DynamicDateCard.TYPE.MONTH: - valueMap.quarter = (value.offset === 0 ? -value.value : value.value); + valueMap.quarter = (value.offset === 0 ? -value.value : +value.value); break; default: break;