fix the filter dropdown menu not display the selected items after selecting multiple hidden transaction categories or accounts

This commit is contained in:
MaysWind
2025-12-14 00:43:38 +08:00
parent b2fab42170
commit a12038e40c
4 changed files with 27 additions and 9 deletions
+6 -5
View File
@@ -266,7 +266,7 @@
</v-list-item>
<v-list-group :key="category.id" v-for="category in categories">
<template #activator="{ props }" v-if="!category.hidden || query.categoryIds === category.id || (allCategories[query.categoryIds] && allCategories[query.categoryIds]!.parentId === category.id)">
<template #activator="{ props }" v-if="!category.hidden || queryAllFilterCategoryIds[category.id] || allCategories[query.categoryIds]?.parentId === category.id || hasSubCategoryInQuery(category)">
<v-divider />
<v-list-item class="text-sm" density="compact"
:class="getCategoryListItemCheckedClass(category, queryAllFilterCategoryIds)"
@@ -296,12 +296,12 @@
<template :key="subCategory.id"
v-for="subCategory in category.subCategories">
<v-divider v-if="!subCategory.hidden || query.categoryIds === subCategory.id" />
<v-divider v-if="!subCategory.hidden || queryAllFilterCategoryIds[subCategory.id]" />
<v-list-item class="text-sm" density="compact"
:value="subCategory.id"
:class="{ 'list-item-selected': query.categoryIds === subCategory.id, 'item-in-multiple-selection': queryAllFilterCategoryIdsCount > 1 && queryAllFilterCategoryIds[subCategory.id] }"
:append-icon="(query.categoryIds === subCategory.id ? mdiCheck : undefined)"
v-if="!subCategory.hidden || query.categoryIds === subCategory.id">
v-if="!subCategory.hidden || queryAllFilterCategoryIds[subCategory.id]">
<v-list-item-title class="cursor-pointer"
@click="changeCategoryFilter(subCategory.id)">
<div class="d-flex align-center">
@@ -407,12 +407,12 @@
</v-list-item>
<template :key="account.id"
v-for="account in allAccounts">
<v-divider v-if="(!account.hidden && (!allAccountsMap[account.parentId] || !allAccountsMap[account.parentId]!.hidden)) || query.accountIds === account.id" />
<v-divider v-if="(!account.hidden && (!allAccountsMap[account.parentId] || !allAccountsMap[account.parentId]!.hidden)) || queryAllFilterAccountIds[account.id]" />
<v-list-item class="text-sm" density="compact"
:value="account.id"
:class="{ 'list-item-selected': query.accountIds === account.id, 'item-in-multiple-selection': queryAllFilterAccountIdsCount > 1 && queryAllFilterAccountIds[account.id] }"
:append-icon="(query.accountIds === account.id ? mdiCheck : undefined)"
v-if="(!account.hidden && (!allAccountsMap[account.parentId] || !allAccountsMap[account.parentId]!.hidden)) || query.accountIds === account.id">
v-if="(!account.hidden && (!allAccountsMap[account.parentId] || !allAccountsMap[account.parentId]!.hidden)) || queryAllFilterAccountIds[account.id]">
<v-list-item-title class="cursor-pointer"
@click="changeAccountFilter(account.id)">
<div class="d-flex align-center">
@@ -809,6 +809,7 @@ const {
transactionCalendarMinDate,
transactionCalendarMaxDate,
currentMonthTransactionData,
hasSubCategoryInQuery,
canAddTransaction,
getDisplayTime,
getDisplayLongDate,