mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 15:37:33 +08:00
code refactor
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
>
|
||||
<template #title>
|
||||
<div class="no-padding no-margin">
|
||||
<span>{{ $t(`currency.${baseCurrency}`) }} </span>
|
||||
<span>{{ getCurrencyName(baseCurrency) }} </span>
|
||||
<small class="smaller">{{ baseCurrency }}</small>
|
||||
</div>
|
||||
</template>
|
||||
@@ -207,6 +207,9 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
getCurrencyName(currencyCode) {
|
||||
return this.$locale.getCurrencyName(currencyCode);
|
||||
},
|
||||
getConvertedAmount(toExchangeRate) {
|
||||
const fromExchangeRate = this.exchangeRatesStore.latestExchangeRateMap[this.baseCurrency];
|
||||
return getConvertedAmount(this.baseAmount / 100, fromExchangeRate, toExchangeRate);
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
>
|
||||
<template #title>
|
||||
<f7-block class="no-padding no-margin">
|
||||
<span>{{ $t(`currency.${user.defaultCurrency}`) }} </span>
|
||||
<span>{{ getCurrencyName(user.defaultCurrency) }} </span>
|
||||
<small class="smaller">{{ user.defaultCurrency }}</small>
|
||||
</f7-block>
|
||||
</template>
|
||||
@@ -399,6 +399,9 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
getCurrencyName(currencyCode) {
|
||||
return this.$locale.getCurrencyName(currencyCode);
|
||||
},
|
||||
getCategoryTypeName(categoryType) {
|
||||
switch (categoryType) {
|
||||
case categoryConstants.allCategoryTypes.Income.toString():
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
>
|
||||
<template #title>
|
||||
<div class="no-padding no-margin">
|
||||
<span>{{ $t(`currency.${account.currency}`) }} </span>
|
||||
<span>{{ getCurrencyName(account.currency) }} </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}`) }} </span>
|
||||
<span>{{ getCurrencyName(subAccount.currency) }} </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);
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
>
|
||||
<template #title>
|
||||
<f7-block class="no-padding no-margin">
|
||||
<span>{{ $t(`currency.${newProfile.defaultCurrency}`) }} </span>
|
||||
<span>{{ getCurrencyName(newProfile.defaultCurrency) }} </span>
|
||||
<small class="smaller">{{ newProfile.defaultCurrency }}</small>
|
||||
</f7-block>
|
||||
</template>
|
||||
@@ -456,6 +456,9 @@ export default {
|
||||
getNameByKeyValue(src, value, keyField, nameField, defaultName) {
|
||||
return getNameByKeyValue(src, value, keyField, nameField, defaultName);
|
||||
},
|
||||
getCurrencyName(currencyCode) {
|
||||
return this.$locale.getCurrencyName(currencyCode);
|
||||
},
|
||||
setCurrentUserProfile(profile) {
|
||||
this.oldProfile.email = profile.email;
|
||||
this.oldProfile.nickname = profile.nickname;
|
||||
|
||||
Reference in New Issue
Block a user