fix the issue that the "all" tab of account with multiple sub accounts are not selected when opening the account list page in desktop version

This commit is contained in:
MaysWind
2024-11-10 23:49:34 +08:00
parent 876950a84e
commit 2fe393204b
+14 -1
View File
@@ -180,7 +180,7 @@
:disabled="loading" :disabled="loading"
v-model="activeSubAccount[element.id]" v-model="activeSubAccount[element.id]"
> >
<v-btn :value="undefined"> <v-btn :value="''">
<span>{{ $t('All') }}</span> <span>{{ $t('All') }}</span>
</v-btn> </v-btn>
<v-btn :key="subAccount.id" :value="subAccount.id" <v-btn :key="subAccount.id" :value="subAccount.id"
@@ -330,6 +330,9 @@ export default {
allAccountCategories() { allAccountCategories() {
return accountConstants.allCategories; return accountConstants.allCategories;
}, },
allAccounts() {
return this.accountsStore.allAccounts;
},
allCategorizedAccountsMap() { allCategorizedAccountsMap() {
return this.accountsStore.allCategorizedAccountsMap; return this.accountsStore.allCategorizedAccountsMap;
}, },
@@ -415,6 +418,16 @@ export default {
self.loading = false; self.loading = false;
self.displayOrderModified = false; self.displayOrderModified = false;
if (self.allAccounts) {
for (let i = 0; i < self.allAccounts.length; i++) {
const account = self.allAccounts[i];
if (account.type === self.allAccountTypes.MultiSubAccounts && !self.activeSubAccount[account.id]) {
self.activeSubAccount[account.id] = '';
}
}
}
if (force) { if (force) {
self.$refs.snackbar.showMessage('Account list has been updated'); self.$refs.snackbar.showMessage('Account list has been updated');
} }