code refactor

This commit is contained in:
MaysWind
2024-07-21 22:28:42 +08:00
parent 0b83518921
commit 4f9ab9db75
4 changed files with 16 additions and 16 deletions
@@ -212,18 +212,18 @@ export default {
const account = self.accountsStore.allAccountsMap[accountId];
if (this.type === 'transactionListCurrent' && self.transactionsStore.allFilterAccountIdsCount > 0) {
if (self.type === 'transactionListCurrent' && self.transactionsStore.allFilterAccountIdsCount > 0) {
allAccountIds[account.id] = true;
} else {
allAccountIds[account.id] = false;
}
}
if (this.type === 'statisticsDefault') {
if (self.type === 'statisticsDefault') {
self.filterAccountIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultAccountFilter, allAccountIds);
} else if (this.type === 'statisticsCurrent') {
} else if (self.type === 'statisticsCurrent') {
self.filterAccountIds = copyObjectTo(self.statisticsStore.transactionStatisticsFilter.filterAccountIds, allAccountIds);
} else if (this.type === 'transactionListCurrent') {
} else if (self.type === 'transactionListCurrent') {
for (let accountId in self.transactionsStore.allFilterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterAccountIds, accountId)) {
continue;
@@ -225,18 +225,18 @@ export default {
continue;
}
if (this.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
if (self.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
allCategoryIds[category.id] = true;
} else {
allCategoryIds[category.id] = false;
}
}
if (this.type === 'statisticsDefault') {
if (self.type === 'statisticsDefault') {
self.filterCategoryIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultTransactionCategoryFilter, allCategoryIds);
} else if (this.type === 'statisticsCurrent') {
} else if (self.type === 'statisticsCurrent') {
self.filterCategoryIds = copyObjectTo(self.statisticsStore.transactionStatisticsFilter.filterCategoryIds, allCategoryIds);
} else if (this.type === 'transactionListCurrent') {
} else if (self.type === 'transactionListCurrent') {
for (let categoryId in self.transactionsStore.allFilterCategoryIds) {
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterCategoryIds, categoryId)) {
continue;
@@ -195,18 +195,18 @@ export default {
const account = self.accountsStore.allAccountsMap[accountId];
if (this.type === 'transactionListCurrent' && self.transactionsStore.allFilterAccountIdsCount > 0) {
if (self.type === 'transactionListCurrent' && self.transactionsStore.allFilterAccountIdsCount > 0) {
allAccountIds[account.id] = true;
} else {
allAccountIds[account.id] = false;
}
}
if (this.type === 'statisticsDefault') {
if (self.type === 'statisticsDefault') {
self.filterAccountIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultAccountFilter, allAccountIds);
} else if (this.type === 'statisticsCurrent') {
} else if (self.type === 'statisticsCurrent') {
self.filterAccountIds = copyObjectTo(self.statisticsStore.transactionStatisticsFilter.filterAccountIds, allAccountIds);
} else if (this.type === 'transactionListCurrent') {
} else if (self.type === 'transactionListCurrent') {
for (let accountId in self.transactionsStore.allFilterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterAccountIds, accountId)) {
continue;
@@ -213,18 +213,18 @@ export default {
continue;
}
if (this.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
if (self.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
allCategoryIds[category.id] = true;
} else {
allCategoryIds[category.id] = false;
}
}
if (this.type === 'statisticsDefault') {
if (self.type === 'statisticsDefault') {
self.filterCategoryIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultTransactionCategoryFilter, allCategoryIds);
} else if (this.type === 'statisticsCurrent') {
} else if (self.type === 'statisticsCurrent') {
self.filterCategoryIds = copyObjectTo(self.statisticsStore.transactionStatisticsFilter.filterCategoryIds, allCategoryIds);
} else if (this.type === 'transactionListCurrent') {
} else if (self.type === 'transactionListCurrent') {
for (let categoryId in self.transactionsStore.allFilterCategoryIds) {
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterCategoryIds, categoryId)) {
continue;