mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 16:54:25 +08:00
hide unsupported filters when selecting Account Total Assets or Account Total Liabilities on the Statistics & Analysis page
This commit is contained in:
@@ -156,6 +156,30 @@ export function useStatisticsTransactionPageBase() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const canUseCategoryFilter = computed<boolean>(() => {
|
||||||
|
if (query.value.chartDataType === ChartDataType.AccountTotalAssets.type || query.value.chartDataType === ChartDataType.AccountTotalLiabilities.type) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
const canUseTagFilter = computed<boolean>(() => {
|
||||||
|
if (query.value.chartDataType === ChartDataType.AccountTotalAssets.type || query.value.chartDataType === ChartDataType.AccountTotalLiabilities.type) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
const canUseKeywordFilter = computed<boolean>(() => {
|
||||||
|
if (query.value.chartDataType === ChartDataType.AccountTotalAssets.type || query.value.chartDataType === ChartDataType.AccountTotalLiabilities.type) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
const showAmountInChart = computed<boolean>(() => {
|
const showAmountInChart = computed<boolean>(() => {
|
||||||
if (!showAccountBalance.value
|
if (!showAccountBalance.value
|
||||||
&& (query.value.chartDataType === ChartDataType.AccountTotalAssets.type || query.value.chartDataType === ChartDataType.AccountTotalLiabilities.type)) {
|
&& (query.value.chartDataType === ChartDataType.AccountTotalAssets.type || query.value.chartDataType === ChartDataType.AccountTotalLiabilities.type)) {
|
||||||
@@ -259,6 +283,9 @@ export function useStatisticsTransactionPageBase() {
|
|||||||
queryTrendDateAggregationTypeName,
|
queryTrendDateAggregationTypeName,
|
||||||
isQueryDateRangeChanged,
|
isQueryDateRangeChanged,
|
||||||
canShiftDateRange,
|
canShiftDateRange,
|
||||||
|
canUseCategoryFilter,
|
||||||
|
canUseTagFilter,
|
||||||
|
canUseKeywordFilter,
|
||||||
showAmountInChart,
|
showAmountInChart,
|
||||||
totalAmountName,
|
totalAmountName,
|
||||||
showTotalAmountInTrendsChart,
|
showTotalAmountInTrendsChart,
|
||||||
|
|||||||
@@ -120,6 +120,7 @@
|
|||||||
:append-inner-icon="filterKeyword !== query.keyword ? mdiCheck : undefined"
|
:append-inner-icon="filterKeyword !== query.keyword ? mdiCheck : undefined"
|
||||||
:placeholder="tt('Filter transaction description')"
|
:placeholder="tt('Filter transaction description')"
|
||||||
v-model="filterKeyword"
|
v-model="filterKeyword"
|
||||||
|
v-if="canUseKeywordFilter"
|
||||||
@click:append-inner="setKeywordFilter(filterKeyword)"
|
@click:append-inner="setKeywordFilter(filterKeyword)"
|
||||||
@keyup.enter="setKeywordFilter(filterKeyword)"
|
@keyup.enter="setKeywordFilter(filterKeyword)"
|
||||||
/>
|
/>
|
||||||
@@ -129,15 +130,20 @@
|
|||||||
<v-icon :icon="mdiDotsVertical" />
|
<v-icon :icon="mdiDotsVertical" />
|
||||||
<v-menu activator="parent">
|
<v-menu activator="parent">
|
||||||
<v-list>
|
<v-list>
|
||||||
<v-list-item :prepend-icon="mdiFilterOutline"
|
<v-list-item :disabled="loading"
|
||||||
|
:prepend-icon="mdiFilterOutline"
|
||||||
:title="tt('Filter Accounts')"
|
:title="tt('Filter Accounts')"
|
||||||
@click="showFilterAccountDialog = true"></v-list-item>
|
@click="showFilterAccountDialog = true"></v-list-item>
|
||||||
<v-list-item :prepend-icon="mdiFilterOutline"
|
<v-list-item :disabled="loading"
|
||||||
|
:prepend-icon="mdiFilterOutline"
|
||||||
:title="tt('Filter Transaction Categories')"
|
:title="tt('Filter Transaction Categories')"
|
||||||
@click="showFilterCategoryDialog = true"></v-list-item>
|
@click="showFilterCategoryDialog = true"
|
||||||
<v-list-item :prepend-icon="mdiFilterOutline"
|
v-if="canUseCategoryFilter"></v-list-item>
|
||||||
|
<v-list-item :disabled="loading"
|
||||||
|
:prepend-icon="mdiFilterOutline"
|
||||||
:title="tt('Filter Transaction Tags')"
|
:title="tt('Filter Transaction Tags')"
|
||||||
@click="showFilterTagDialog = true"></v-list-item>
|
@click="showFilterTagDialog = true"
|
||||||
|
v-if="canUseTagFilter"></v-list-item>
|
||||||
<v-divider class="my-2"/>
|
<v-divider class="my-2"/>
|
||||||
<v-list-item :prepend-icon="mdiExport"
|
<v-list-item :prepend-icon="mdiExport"
|
||||||
:title="tt('Export Results')"
|
:title="tt('Export Results')"
|
||||||
@@ -451,6 +457,9 @@ const {
|
|||||||
queryDateRangeName,
|
queryDateRangeName,
|
||||||
queryTrendDateAggregationTypeName,
|
queryTrendDateAggregationTypeName,
|
||||||
canShiftDateRange,
|
canShiftDateRange,
|
||||||
|
canUseCategoryFilter,
|
||||||
|
canUseTagFilter,
|
||||||
|
canUseKeywordFilter,
|
||||||
showAmountInChart,
|
showAmountInChart,
|
||||||
totalAmountName,
|
totalAmountName,
|
||||||
showTotalAmountInTrendsChart,
|
showTotalAmountInTrendsChart,
|
||||||
|
|||||||
@@ -313,13 +313,13 @@
|
|||||||
|
|
||||||
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
||||||
<f7-actions-group>
|
<f7-actions-group>
|
||||||
<f7-actions-button @click="filterAccounts">{{ tt('Filter Accounts') }}</f7-actions-button>
|
<f7-actions-button :class="{ 'disabled': reloading }" @click="filterAccounts">{{ tt('Filter Accounts') }}</f7-actions-button>
|
||||||
<f7-actions-button @click="filterCategories">{{ tt('Filter Transaction Categories') }}</f7-actions-button>
|
<f7-actions-button :class="{ 'disabled': reloading }" @click="filterCategories" v-if="canUseCategoryFilter">{{ tt('Filter Transaction Categories') }}</f7-actions-button>
|
||||||
<f7-actions-button @click="filterTags">{{ tt('Filter Transaction Tags') }}</f7-actions-button>
|
<f7-actions-button :class="{ 'disabled': reloading }" @click="filterTags" v-if="canUseTagFilter">{{ tt('Filter Transaction Tags') }}</f7-actions-button>
|
||||||
</f7-actions-group>
|
</f7-actions-group>
|
||||||
<f7-actions-group>
|
<f7-actions-group v-if="canUseKeywordFilter">
|
||||||
<f7-actions-label v-if="query.keyword">{{ query.keyword }}</f7-actions-label>
|
<f7-actions-label v-if="query.keyword">{{ query.keyword }}</f7-actions-label>
|
||||||
<f7-actions-button @click="filterDescription">{{ tt('Filter transaction description') }}</f7-actions-button>
|
<f7-actions-button :class="{ 'disabled': reloading }" @click="filterDescription">{{ tt('Filter transaction description') }}</f7-actions-button>
|
||||||
</f7-actions-group>
|
</f7-actions-group>
|
||||||
<f7-actions-group>
|
<f7-actions-group>
|
||||||
<f7-actions-button @click="settings">{{ tt('Settings') }}</f7-actions-button>
|
<f7-actions-button @click="settings">{{ tt('Settings') }}</f7-actions-button>
|
||||||
@@ -398,6 +398,9 @@ const {
|
|||||||
queryTrendDateAggregationTypeName,
|
queryTrendDateAggregationTypeName,
|
||||||
isQueryDateRangeChanged,
|
isQueryDateRangeChanged,
|
||||||
canShiftDateRange,
|
canShiftDateRange,
|
||||||
|
canUseCategoryFilter,
|
||||||
|
canUseTagFilter,
|
||||||
|
canUseKeywordFilter,
|
||||||
showAmountInChart,
|
showAmountInChart,
|
||||||
totalAmountName,
|
totalAmountName,
|
||||||
translateNameInTrendsChart,
|
translateNameInTrendsChart,
|
||||||
|
|||||||
Reference in New Issue
Block a user