mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
support selecting all visible in account / category / tag filter dialog / page
This commit is contained in:
@@ -249,6 +249,26 @@ export function selectAccountOrSubAccounts(filterAccountIds: Record<string, bool
|
||||
}
|
||||
}
|
||||
|
||||
export function selectAllVisible(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
|
||||
for (const accountId of keys(filterAccountIds)) {
|
||||
const account = allAccountsMap[accountId];
|
||||
|
||||
if (account) {
|
||||
if (account.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (account.parentId && allAccountsMap[account.parentId] && allAccountsMap[account.parentId]!.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (account.type === AccountType.SingleAccount.type) {
|
||||
filterAccountIds[account.id] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function selectAll(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
|
||||
for (const accountId of keys(filterAccountIds)) {
|
||||
const account = allAccountsMap[accountId];
|
||||
|
||||
Reference in New Issue
Block a user