mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
fix the parent account not displayed in the account list in the transaction list page
This commit is contained in:
@@ -50,6 +50,29 @@ export const useAccountsStore = defineStore('accounts', () => {
|
|||||||
return Account.sortAccounts(allAccountsList, allAccountsMap.value);
|
return Account.sortAccounts(allAccountsList, allAccountsMap.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const allMixedPlainAccounts = computed<Account[]>(() => {
|
||||||
|
const allAccountsList: Account[] = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < allAccounts.value.length; i++) {
|
||||||
|
const account = allAccounts.value[i];
|
||||||
|
|
||||||
|
if (account.type === AccountType.SingleAccount.type) {
|
||||||
|
allAccountsList.push(account);
|
||||||
|
} else if (account.type === AccountType.MultiSubAccounts.type) {
|
||||||
|
allAccountsList.push(account);
|
||||||
|
|
||||||
|
if (account.subAccounts) {
|
||||||
|
for (let j = 0; j < account.subAccounts.length; j++) {
|
||||||
|
const subAccount = account.subAccounts[j];
|
||||||
|
allAccountsList.push(subAccount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Account.sortAccounts(allAccountsList, allAccountsMap.value);
|
||||||
|
});
|
||||||
|
|
||||||
const allVisiblePlainAccounts = computed<Account[]>(() => {
|
const allVisiblePlainAccounts = computed<Account[]>(() => {
|
||||||
const allVisibleAccounts: Account[] = [];
|
const allVisibleAccounts: Account[] = [];
|
||||||
|
|
||||||
@@ -982,6 +1005,7 @@ export const useAccountsStore = defineStore('accounts', () => {
|
|||||||
accountListStateInvalid,
|
accountListStateInvalid,
|
||||||
// computed states
|
// computed states
|
||||||
allPlainAccounts,
|
allPlainAccounts,
|
||||||
|
allMixedPlainAccounts,
|
||||||
allVisiblePlainAccounts,
|
allVisiblePlainAccounts,
|
||||||
allAvailableAccountsCount,
|
allAvailableAccountsCount,
|
||||||
allVisibleAccountsCount,
|
allVisibleAccountsCount,
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export function useTransactionListPageBase() {
|
|||||||
|
|
||||||
const allDateRanges = computed<LocalizedDateRange[]>(() => getAllDateRanges(DateRangeScene.Normal, true, !!accountsStore.getAccountStatementDate(query.value.accountIds)));
|
const allDateRanges = computed<LocalizedDateRange[]>(() => getAllDateRanges(DateRangeScene.Normal, true, !!accountsStore.getAccountStatementDate(query.value.accountIds)));
|
||||||
|
|
||||||
const allAccounts = computed<Account[]>(() => accountsStore.allPlainAccounts);
|
const allAccounts = computed<Account[]>(() => accountsStore.allMixedPlainAccounts);
|
||||||
const allAccountsMap = computed<Record<string, Account>>(() => accountsStore.allAccountsMap);
|
const allAccountsMap = computed<Record<string, Account>>(() => accountsStore.allAccountsMap);
|
||||||
const allAvailableAccountsCount = computed<number>(() => accountsStore.allAvailableAccountsCount);
|
const allAvailableAccountsCount = computed<number>(() => accountsStore.allAvailableAccountsCount);
|
||||||
const allPrimaryCategories = computed<Record<number, TransactionCategory[]>>(() => {
|
const allPrimaryCategories = computed<Record<number, TransactionCategory[]>>(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user