mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
total amount on the account list page supports excluding specified accounts (#161)
This commit is contained in:
@@ -120,7 +120,7 @@
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleAccount }" @click="selectNoneAccounts">{{ tt('Select None') }}</f7-actions-button>
|
||||
<f7-actions-button :class="{ 'disabled': !hasAnyVisibleAccount }" @click="selectInvertAccounts">{{ tt('Invert Selection') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
<f7-actions-group>
|
||||
<f7-actions-group v-if="allowHiddenAccount">
|
||||
<f7-actions-button v-if="!showHidden" @click="showHidden = true">{{ tt('Show Hidden Accounts') }}</f7-actions-button>
|
||||
<f7-actions-button v-if="showHidden" @click="showHidden = false">{{ tt('Hide Hidden Accounts') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
@@ -171,6 +171,7 @@ const {
|
||||
filterAccountIds,
|
||||
title,
|
||||
applyText,
|
||||
allowHiddenAccount,
|
||||
allCategorizedAccounts,
|
||||
hasAnyAvailableAccount,
|
||||
hasAnyVisibleAccount,
|
||||
@@ -245,15 +246,15 @@ function updateAccountSelected(e: Event): void {
|
||||
}
|
||||
|
||||
function selectAllAccounts(): void {
|
||||
selectAll(filterAccountIds.value, accountsStore.allAccountsMap);
|
||||
selectAll(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
|
||||
}
|
||||
|
||||
function selectNoneAccounts(): void {
|
||||
selectNone(filterAccountIds.value, accountsStore.allAccountsMap);
|
||||
selectNone(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
|
||||
}
|
||||
|
||||
function selectInvertAccounts(): void {
|
||||
selectInvert(filterAccountIds.value, accountsStore.allAccountsMap);
|
||||
selectInvert(filterAccountIds.value, accountsStore.allAccountsMap, !allowHiddenAccount.value);
|
||||
}
|
||||
|
||||
function save(): void {
|
||||
|
||||
@@ -73,6 +73,18 @@
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
|
||||
<f7-block-title>{{ tt('Account List Page') }}</f7-block-title>
|
||||
<f7-list strong inset dividers>
|
||||
<f7-list-item :disabled="!hasAnyVisibleAccount"
|
||||
:title="tt('Accounts Included in Total')"
|
||||
link="/settings/filter/account?type=accountListTotalAmount">
|
||||
<template #after>
|
||||
<f7-preloader v-if="loadingAccounts" />
|
||||
<span v-else-if="!loadingAccounts">{{ accountsIncludedInTotalDisplayContent }}</span>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
|
||||
<f7-block-title>{{ tt('Exchange Rates Data Page') }}</f7-block-title>
|
||||
<f7-list strong inset dividers>
|
||||
<f7-list-item
|
||||
@@ -101,14 +113,19 @@
|
||||
import { ref, computed } from 'vue';
|
||||
|
||||
import { useI18n } from '@/locales/helpers.ts';
|
||||
import { useI18nUIComponents } from '@/lib/ui/mobile.ts';
|
||||
import { useAppSettingPageBase } from '@/views/base/settings/AppSettingsPageBase.ts';
|
||||
|
||||
import { useSettingsStore } from '@/stores/setting.ts';
|
||||
import { useAccountsStore } from '@/stores/account.ts';
|
||||
|
||||
import { findNameByValue, findDisplayNameByType } from '@/lib/common.ts';
|
||||
|
||||
const { tt } = useI18n();
|
||||
const { showToast } = useI18nUIComponents();
|
||||
const {
|
||||
loadingAccounts,
|
||||
hasAnyVisibleAccount,
|
||||
allTimezoneTypesUsedForStatistics,
|
||||
allCurrencySortingTypes,
|
||||
allAutoSaveTransactionDraftTypes,
|
||||
@@ -118,10 +135,12 @@ const {
|
||||
showTagInTransactionListPage,
|
||||
autoSaveTransactionDraft,
|
||||
isAutoGetCurrentGeoLocation,
|
||||
currencySortByInExchangeRatesPage
|
||||
currencySortByInExchangeRatesPage,
|
||||
accountsIncludedInTotalDisplayContent
|
||||
} = useAppSettingPageBase();
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
const accountsStore = useAccountsStore();
|
||||
|
||||
const showTimezoneUsedForStatisticsInHomePagePopup = ref<boolean>(false);
|
||||
const showAutoSaveTransactionDraftPopup = ref<boolean>(false);
|
||||
@@ -131,4 +150,22 @@ const alwaysShowTransactionPicturesInMobileTransactionEditPage = computed<boolea
|
||||
get: () => settingsStore.appSettings.alwaysShowTransactionPicturesInMobileTransactionEditPage,
|
||||
set: (value) => settingsStore.setAlwaysShowTransactionPicturesInMobileTransactionEditPage(value)
|
||||
});
|
||||
|
||||
function init(): void {
|
||||
loadingAccounts.value = true;
|
||||
|
||||
accountsStore.loadAllAccounts({
|
||||
force: false
|
||||
}).then(() => {
|
||||
loadingAccounts.value = false;
|
||||
}).catch(error => {
|
||||
loadingAccounts.value = false;
|
||||
|
||||
if (!error.processed) {
|
||||
showToast(error.message || error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user