total amount on the account list page supports excluding specified accounts (#161)

This commit is contained in:
MaysWind
2025-06-29 22:27:34 +08:00
parent 90e862fbb1
commit 801c0f8572
25 changed files with 305 additions and 24 deletions
+15 -3
View File
@@ -265,7 +265,7 @@ export function selectAccountOrSubAccounts(filterAccountIds: Record<string, bool
}
}
export function selectAll(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
export function selectAll(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
for (const accountId in filterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
continue;
@@ -273,13 +273,17 @@ export function selectAll(filterAccountIds: Record<string, boolean>, allAccounts
const account = allAccountsMap[accountId];
if (skipHiddenAccount && account && account.hidden) {
continue;
}
if (account && account.type === AccountType.SingleAccount.type) {
filterAccountIds[account.id] = false;
}
}
}
export function selectNone(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
export function selectNone(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
for (const accountId in filterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
continue;
@@ -287,13 +291,17 @@ export function selectNone(filterAccountIds: Record<string, boolean>, allAccount
const account = allAccountsMap[accountId];
if (skipHiddenAccount && account && account.hidden) {
continue;
}
if (account && account.type === AccountType.SingleAccount.type) {
filterAccountIds[account.id] = true;
}
}
}
export function selectInvert(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>): void {
export function selectInvert(filterAccountIds: Record<string, boolean>, allAccountsMap: Record<string, Account>, skipHiddenAccount: boolean): void {
for (const accountId in filterAccountIds) {
if (!Object.prototype.hasOwnProperty.call(filterAccountIds, accountId)) {
continue;
@@ -301,6 +309,10 @@ export function selectInvert(filterAccountIds: Record<string, boolean>, allAccou
const account = allAccountsMap[accountId];
if (skipHiddenAccount && account && account.hidden) {
continue;
}
if (account && account.type === AccountType.SingleAccount.type) {
filterAccountIds[account.id] = !filterAccountIds[account.id];
}