code refactor

This commit is contained in:
MaysWind
2023-07-16 22:55:02 +08:00
parent 41034de676
commit ed4040f2ec
5 changed files with 25 additions and 8 deletions
+5 -2
View File
@@ -164,7 +164,7 @@
>
<template #title>
<div class="no-padding no-margin">
<span>{{ $t(`currency.${account.currency}`) }}&nbsp;</span>
<span>{{ getCurrencyName(account.currency) }}&nbsp;</span>
<small class="smaller">{{ account.currency }}</small>
</div>
</template>
@@ -357,7 +357,7 @@
>
<template #title>
<div class="no-padding no-margin">
<span>{{ $t(`currency.${subAccount.currency}`) }}&nbsp;</span>
<span>{{ getCurrencyName(subAccount.currency) }}&nbsp;</span>
<small class="smaller">{{ subAccount.currency }}</small>
</div>
</template>
@@ -712,6 +712,9 @@ export default {
}
});
},
getCurrencyName(currencyCode) {
return this.$locale.getCurrencyName(currencyCode);
},
getAccountTypeName(accountType) {
const typeName = getNameByKeyValue(this.allAccountTypesArray, accountType, 'id', 'name');
return this.$t(typeName);