mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
code refactor
This commit is contained in:
@@ -212,18 +212,18 @@ export default {
|
|||||||
|
|
||||||
const account = self.accountsStore.allAccountsMap[accountId];
|
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;
|
allAccountIds[account.id] = true;
|
||||||
} else {
|
} else {
|
||||||
allAccountIds[account.id] = false;
|
allAccountIds[account.id] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.type === 'statisticsDefault') {
|
if (self.type === 'statisticsDefault') {
|
||||||
self.filterAccountIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultAccountFilter, allAccountIds);
|
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);
|
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) {
|
for (let accountId in self.transactionsStore.allFilterAccountIds) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterAccountIds, accountId)) {
|
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterAccountIds, accountId)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -225,18 +225,18 @@ export default {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
|
if (self.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
|
||||||
allCategoryIds[category.id] = true;
|
allCategoryIds[category.id] = true;
|
||||||
} else {
|
} else {
|
||||||
allCategoryIds[category.id] = false;
|
allCategoryIds[category.id] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.type === 'statisticsDefault') {
|
if (self.type === 'statisticsDefault') {
|
||||||
self.filterCategoryIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultTransactionCategoryFilter, allCategoryIds);
|
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);
|
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) {
|
for (let categoryId in self.transactionsStore.allFilterCategoryIds) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterCategoryIds, categoryId)) {
|
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterCategoryIds, categoryId)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -195,18 +195,18 @@ export default {
|
|||||||
|
|
||||||
const account = self.accountsStore.allAccountsMap[accountId];
|
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;
|
allAccountIds[account.id] = true;
|
||||||
} else {
|
} else {
|
||||||
allAccountIds[account.id] = false;
|
allAccountIds[account.id] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.type === 'statisticsDefault') {
|
if (self.type === 'statisticsDefault') {
|
||||||
self.filterAccountIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultAccountFilter, allAccountIds);
|
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);
|
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) {
|
for (let accountId in self.transactionsStore.allFilterAccountIds) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterAccountIds, accountId)) {
|
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterAccountIds, accountId)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -213,18 +213,18 @@ export default {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
|
if (self.type === 'transactionListCurrent' && self.transactionsStore.allFilterCategoryIdsCount > 0) {
|
||||||
allCategoryIds[category.id] = true;
|
allCategoryIds[category.id] = true;
|
||||||
} else {
|
} else {
|
||||||
allCategoryIds[category.id] = false;
|
allCategoryIds[category.id] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.type === 'statisticsDefault') {
|
if (self.type === 'statisticsDefault') {
|
||||||
self.filterCategoryIds = copyObjectTo(self.settingsStore.appSettings.statistics.defaultTransactionCategoryFilter, allCategoryIds);
|
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);
|
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) {
|
for (let categoryId in self.transactionsStore.allFilterCategoryIds) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterCategoryIds, categoryId)) {
|
if (!Object.prototype.hasOwnProperty.call(self.transactionsStore.allFilterCategoryIds, categoryId)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user