fix the page could not load properly when selecting the same date in trend analysis

This commit is contained in:
MaysWind
2024-08-12 01:06:03 +08:00
parent 52dfee9ca6
commit 80396a444e
2 changed files with 18 additions and 2 deletions
+3 -2
View File
@@ -19,6 +19,7 @@ import {
isObject,
isInteger,
isYearMonth,
isYearMonthEquals,
isObjectEmpty,
objectFieldToArrayItem
} from '@/lib/common.js';
@@ -726,12 +727,12 @@ export const useStatisticsStore = defineStore('statistics', {
changed = true;
}
if (filter && (isYearMonth(filter.trendChartStartYearMonth) || filter.trendChartStartYearMonth === '') && this.transactionStatisticsFilter.trendChartStartYearMonth !== filter.trendChartStartYearMonth) {
if (filter && (isYearMonth(filter.trendChartStartYearMonth) || filter.trendChartStartYearMonth === '') && !isYearMonthEquals(this.transactionStatisticsFilter.trendChartStartYearMonth, filter.trendChartStartYearMonth)) {
this.transactionStatisticsFilter.trendChartStartYearMonth = filter.trendChartStartYearMonth;
changed = true;
}
if (filter && (isYearMonth(filter.trendChartEndYearMonth) || filter.trendChartEndYearMonth === '') && this.transactionStatisticsFilter.trendChartEndYearMonth !== filter.trendChartEndYearMonth) {
if (filter && (isYearMonth(filter.trendChartEndYearMonth) || filter.trendChartEndYearMonth === '') && !isYearMonthEquals(this.transactionStatisticsFilter.trendChartEndYearMonth, filter.trendChartEndYearMonth)) {
this.transactionStatisticsFilter.trendChartEndYearMonth = filter.trendChartEndYearMonth;
changed = true;
}