From 399936e3ab35958b38094b2a820feb5eb353ad3b Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 13 Aug 2023 22:58:52 +0800 Subject: [PATCH] code refactor --- src/views/mobile/accounts/EditPage.vue | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/views/mobile/accounts/EditPage.vue b/src/views/mobile/accounts/EditPage.vue index be7f576d..dfd304d4 100644 --- a/src/views/mobile/accounts/EditPage.vue +++ b/src/views/mobile/accounts/EditPage.vue @@ -23,9 +23,8 @@ @click="showAccountCategorySheet = true" > @@ -41,9 +40,8 @@ @click="showAccountTypeSheet = true" > @@ -481,10 +479,10 @@ export default { return accountConstants.allAccountTypes; }, allAccountCategories() { - return accountConstants.allCategories; + return this.$locale.getAllAccountCategories(); }, allAccountTypesArray() { - return accountConstants.allAccountTypesArray; + return this.$locale.getAllAccountTypes(); }, allAccountIcons() { return iconConstants.allAccountIcons; @@ -642,12 +640,10 @@ export default { return this.$locale.getCurrencyName(currencyCode); }, getAccountTypeName(accountType) { - const typeName = getNameByKeyValue(this.allAccountTypesArray, accountType, 'id', 'name'); - return this.$t(typeName); + return getNameByKeyValue(this.allAccountTypesArray, accountType, 'id', 'displayName'); }, getAccountCategoryName(accountCategory) { - const categoryName = getNameByKeyValue(this.allAccountCategories, accountCategory, 'id', 'name'); - return this.$t(categoryName); + return getNameByKeyValue(this.allAccountCategories, accountCategory, 'id', 'displayName'); }, getAccountBalance(account) { return this.getDisplayCurrency(account.balance, account.currency);