mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-22 02:34:26 +08:00
fix the page could not load properly when selecting the same date in trend analysis
This commit is contained in:
@@ -99,6 +99,21 @@ export function isEquals(obj1, obj2) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isYearMonthEquals(val1, val2) {
|
||||||
|
if (typeof(val1) !== 'string' || typeof(val2) !== 'string') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const items1 = val1.split('-');
|
||||||
|
const items2 = val2.split('-');
|
||||||
|
|
||||||
|
if (items1.length !== 2 || items2.length !== 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (parseInt(items1[0]) && parseInt(items1[1])) && (parseInt(items1[0]) === parseInt(items2[0])) && (parseInt(items1[1]) === parseInt(items2[1]));
|
||||||
|
}
|
||||||
|
|
||||||
export function isObjectEmpty(obj) {
|
export function isObjectEmpty(obj) {
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
isObject,
|
isObject,
|
||||||
isInteger,
|
isInteger,
|
||||||
isYearMonth,
|
isYearMonth,
|
||||||
|
isYearMonthEquals,
|
||||||
isObjectEmpty,
|
isObjectEmpty,
|
||||||
objectFieldToArrayItem
|
objectFieldToArrayItem
|
||||||
} from '@/lib/common.js';
|
} from '@/lib/common.js';
|
||||||
@@ -726,12 +727,12 @@ export const useStatisticsStore = defineStore('statistics', {
|
|||||||
changed = true;
|
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;
|
this.transactionStatisticsFilter.trendChartStartYearMonth = filter.trendChartStartYearMonth;
|
||||||
changed = true;
|
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;
|
this.transactionStatisticsFilter.trendChartEndYearMonth = filter.trendChartEndYearMonth;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user