mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
support filter multiple accounts and categories in transaction list page
This commit is contained in:
@@ -262,6 +262,21 @@ export function selectInvert(filterCategoryIds, allTransactionCategoriesMap) {
|
||||
}
|
||||
}
|
||||
|
||||
export function isCategoryOrSubCategoriesAllChecked(category, filterCategoryIds) {
|
||||
if (!category.subCategories) {
|
||||
return !filterCategoryIds[category.id];
|
||||
}
|
||||
|
||||
for (let i = 0; i < category.subCategories.length; i++) {
|
||||
const subCategory = category.subCategories[i];
|
||||
if (filterCategoryIds[subCategory.id]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export function isSubCategoriesAllChecked(category, filterCategoryIds) {
|
||||
for (let i = 0; i < category.subCategories.length; i++) {
|
||||
const subCategory = category.subCategories[i];
|
||||
|
||||
Reference in New Issue
Block a user