mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 15:37:33 +08:00
move currency display type to user settings
This commit is contained in:
@@ -47,23 +47,6 @@
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" md="6">
|
||||
<v-select
|
||||
item-title="displayName"
|
||||
item-value="value"
|
||||
persistent-placeholder
|
||||
:label="$t('Currency Display Mode')"
|
||||
:placeholder="$t('Currency Display Mode')"
|
||||
:items="[
|
||||
{ value: allCurrencyDisplayModes.None, displayName: $t('None') },
|
||||
{ value: allCurrencyDisplayModes.Symbol, displayName: $t('Currency Symbol') },
|
||||
{ value: allCurrencyDisplayModes.Code, displayName: $t('Currency Code') },
|
||||
{ value: allCurrencyDisplayModes.Name, displayName: $t('Currency Name') }
|
||||
]"
|
||||
v-model="currencyDisplayMode"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" md="6">
|
||||
<v-select
|
||||
item-title="displayName"
|
||||
@@ -182,7 +165,6 @@ import { useOverviewStore } from '@/stores/overview.js';
|
||||
import { useStatisticsStore } from '@/stores/statistics.js';
|
||||
import { useExchangeRatesStore } from '@/stores/exchangeRates.js';
|
||||
|
||||
import currencyConstants from '@/consts/currency.js';
|
||||
import { getSystemTheme } from '@/lib/ui.js';
|
||||
|
||||
export default {
|
||||
@@ -194,9 +176,6 @@ export default {
|
||||
allTimezones() {
|
||||
return this.$locale.getAllTimezones(true);
|
||||
},
|
||||
allCurrencyDisplayModes() {
|
||||
return currencyConstants.allCurrencyDisplayModes;
|
||||
},
|
||||
allTimezoneTypesUsedForStatistics() {
|
||||
return this.$locale.getAllTimezoneTypesUsedForStatistics(this.timeZone);
|
||||
},
|
||||
@@ -236,14 +215,6 @@ export default {
|
||||
this.settingsStore.setAutoUpdateExchangeRatesData(value);
|
||||
}
|
||||
},
|
||||
currencyDisplayMode: {
|
||||
get: function () {
|
||||
return this.settingsStore.appSettings.currencyDisplayMode;
|
||||
},
|
||||
set: function (value) {
|
||||
this.settingsStore.setCurrencyDisplayMode(value);
|
||||
}
|
||||
},
|
||||
showAccountBalance: {
|
||||
get: function () {
|
||||
return this.settingsStore.appSettings.showAccountBalance;
|
||||
|
||||
@@ -244,6 +244,19 @@
|
||||
v-model="newProfile.digitGrouping"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" md="6">
|
||||
<v-select
|
||||
item-title="displayName"
|
||||
item-value="type"
|
||||
persistent-placeholder
|
||||
:disabled="loading || saving"
|
||||
:label="$t('Currency Display Mode')"
|
||||
:placeholder="$t('Currency Display Mode')"
|
||||
:items="allCurrencyDisplayTypes"
|
||||
v-model="newProfile.currencyDisplayType"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
|
||||
@@ -303,7 +316,8 @@ export default {
|
||||
shortTimeFormat: 0,
|
||||
decimalSeparator: 0,
|
||||
digitGroupingSymbol: 0,
|
||||
digitGrouping: 0
|
||||
digitGrouping: 0,
|
||||
currencyDisplayType: 0
|
||||
},
|
||||
oldProfile: {
|
||||
email: '',
|
||||
@@ -319,7 +333,8 @@ export default {
|
||||
shortTimeFormat: 0,
|
||||
decimalSeparator: 0,
|
||||
digitGroupingSymbol: 0,
|
||||
digitGrouping: 0
|
||||
digitGrouping: 0,
|
||||
currencyDisplayType: 0
|
||||
},
|
||||
emailVerified: false,
|
||||
loading: true,
|
||||
@@ -371,6 +386,9 @@ export default {
|
||||
allDigitGroupingTypes() {
|
||||
return this.$locale.getAllDigitGroupingTypes();
|
||||
},
|
||||
allCurrencyDisplayTypes() {
|
||||
return this.$locale.getAllCurrencyDisplayTypes(this.settingsStore, this.userStore);
|
||||
},
|
||||
allTransactionEditScopeTypes() {
|
||||
return this.$locale.getAllTransactionEditScopeTypes();
|
||||
},
|
||||
@@ -405,7 +423,8 @@ export default {
|
||||
this.newProfile.shortTimeFormat === this.oldProfile.shortTimeFormat &&
|
||||
this.newProfile.decimalSeparator === this.oldProfile.decimalSeparator &&
|
||||
this.newProfile.digitGroupingSymbol === this.oldProfile.digitGroupingSymbol &&
|
||||
this.newProfile.digitGrouping === this.oldProfile.digitGrouping) {
|
||||
this.newProfile.digitGrouping === this.oldProfile.digitGrouping &&
|
||||
this.newProfile.currencyDisplayType === this.oldProfile.currencyDisplayType) {
|
||||
return 'Nothing has been modified';
|
||||
} else {
|
||||
return null;
|
||||
@@ -535,6 +554,7 @@ export default {
|
||||
this.oldProfile.decimalSeparator = profile.decimalSeparator;
|
||||
this.oldProfile.digitGroupingSymbol = profile.digitGroupingSymbol;
|
||||
this.oldProfile.digitGrouping = profile.digitGrouping;
|
||||
this.oldProfile.currencyDisplayType = profile.currencyDisplayType;
|
||||
|
||||
this.newProfile.email = this.oldProfile.email
|
||||
this.newProfile.nickname = this.oldProfile.nickname;
|
||||
@@ -550,6 +570,7 @@ export default {
|
||||
this.newProfile.decimalSeparator = this.oldProfile.decimalSeparator;
|
||||
this.newProfile.digitGroupingSymbol = this.oldProfile.digitGroupingSymbol;
|
||||
this.newProfile.digitGrouping = this.oldProfile.digitGrouping;
|
||||
this.newProfile.currencyDisplayType = this.oldProfile.currencyDisplayType;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -47,18 +47,6 @@
|
||||
<f7-toggle :checked="isAutoUpdateExchangeRatesData" @toggle:change="isAutoUpdateExchangeRatesData = $event"></f7-toggle>
|
||||
</f7-list-item>
|
||||
|
||||
<f7-list-item
|
||||
:key="currentLocale + '_currency_display'"
|
||||
:title="$t('Currency Display Mode')"
|
||||
smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: $t('Currency Display Mode'), searchbarDisableText: $t('Cancel'), appendSearchbarNotFound: $t('No results'), popupCloseLinkText: $t('Done') }">
|
||||
<select v-model="currencyDisplayMode">
|
||||
<option :value="allCurrencyDisplayModes.None">{{ $t('None') }}</option>
|
||||
<option :value="allCurrencyDisplayModes.Symbol">{{ $t('Currency Symbol') }}</option>
|
||||
<option :value="allCurrencyDisplayModes.Code">{{ $t('Currency Code') }}</option>
|
||||
<option :value="allCurrencyDisplayModes.Name">{{ $t('Currency Name') }}</option>
|
||||
</select>
|
||||
</f7-list-item>
|
||||
|
||||
<f7-list-item>
|
||||
<span>{{ $t('Show Account Balance') }}</span>
|
||||
<f7-toggle :checked="showAccountBalance" @toggle:change="showAccountBalance = $event"></f7-toggle>
|
||||
@@ -90,7 +78,6 @@ import { useOverviewStore } from '@/stores/overview.js';
|
||||
import { useStatisticsStore } from '@/stores/statistics.js';
|
||||
import { useExchangeRatesStore } from '@/stores/exchangeRates.js';
|
||||
|
||||
import currencyConstants from '@/consts/currency.js';
|
||||
import { getDesktopVersionPath } from '@/lib/version.js';
|
||||
|
||||
export default {
|
||||
@@ -116,9 +103,6 @@ export default {
|
||||
allTimezones() {
|
||||
return this.$locale.getAllTimezones(true);
|
||||
},
|
||||
allCurrencyDisplayModes() {
|
||||
return currencyConstants.allCurrencyDisplayModes;
|
||||
},
|
||||
currentNickName() {
|
||||
return this.userStore.currentUserNickname || this.$t('User');
|
||||
},
|
||||
@@ -160,14 +144,6 @@ export default {
|
||||
isEnableApplicationLock() {
|
||||
return this.settingsStore.appSettings.applicationLock;
|
||||
},
|
||||
currencyDisplayMode: {
|
||||
get: function () {
|
||||
return this.settingsStore.appSettings.currencyDisplayMode;
|
||||
},
|
||||
set: function (value) {
|
||||
this.settingsStore.setCurrencyDisplayMode(value);
|
||||
}
|
||||
},
|
||||
showAccountBalance: {
|
||||
get: function () {
|
||||
return this.settingsStore.appSettings.showAccountBalance;
|
||||
|
||||
@@ -245,6 +245,19 @@
|
||||
</select>
|
||||
</f7-list-item>
|
||||
|
||||
<f7-list-item
|
||||
class="list-item-with-header-and-title list-item-no-item-after"
|
||||
:header="$t('Currency Display Mode')"
|
||||
:title="getNameByKeyValue(allCurrencyDisplayTypes, newProfile.currencyDisplayType, 'type', 'displayName')"
|
||||
smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: $t('Currency Display Mode'), searchbarDisableText: $t('Cancel'), appendSearchbarNotFound: $t('No results'), pageTitle: $t('Currency Display Mode'), popupCloseLinkText: $t('Done') }"
|
||||
>
|
||||
<select v-model="newProfile.currencyDisplayType">
|
||||
<option :value="format.type"
|
||||
:key="format.type"
|
||||
v-for="format in allCurrencyDisplayTypes">{{ format.displayName }}</option>
|
||||
</select>
|
||||
</f7-list-item>
|
||||
|
||||
<f7-list-item class="ebk-list-item-error-info" v-if="langAndRegionInputIsInvalid" :footer="$t(langAndRegionInputInvalidProblemMessage)"></f7-list-item>
|
||||
</f7-list>
|
||||
|
||||
@@ -303,7 +316,8 @@ export default {
|
||||
shortTimeFormat: 0,
|
||||
decimalSeparator: 0,
|
||||
digitGroupingSymbol: 0,
|
||||
digitGrouping: 0
|
||||
digitGrouping: 0,
|
||||
currencyDisplayType: 0
|
||||
},
|
||||
oldProfile: {
|
||||
email: '',
|
||||
@@ -319,7 +333,8 @@ export default {
|
||||
shortTimeFormat: 0,
|
||||
decimalSeparator: 0,
|
||||
digitGroupingSymbol: 0,
|
||||
digitGrouping: 0
|
||||
digitGrouping: 0,
|
||||
currencyDisplayType: 0
|
||||
},
|
||||
emailVerified: false,
|
||||
currentPassword: '',
|
||||
@@ -373,6 +388,9 @@ export default {
|
||||
allDigitGroupingTypes() {
|
||||
return this.$locale.getAllDigitGroupingTypes();
|
||||
},
|
||||
allCurrencyDisplayTypes() {
|
||||
return this.$locale.getAllCurrencyDisplayTypes(this.settingsStore, this.userStore);
|
||||
},
|
||||
allTransactionEditScopeTypes() {
|
||||
return this.$locale.getAllTransactionEditScopeTypes();
|
||||
},
|
||||
@@ -420,7 +438,8 @@ export default {
|
||||
this.newProfile.shortTimeFormat === this.oldProfile.shortTimeFormat &&
|
||||
this.newProfile.decimalSeparator === this.oldProfile.decimalSeparator &&
|
||||
this.newProfile.digitGroupingSymbol === this.oldProfile.digitGroupingSymbol &&
|
||||
this.newProfile.digitGrouping === this.oldProfile.digitGrouping) {
|
||||
this.newProfile.digitGrouping === this.oldProfile.digitGrouping &&
|
||||
this.newProfile.currencyDisplayType === this.oldProfile.currencyDisplayType) {
|
||||
return 'Nothing has been modified';
|
||||
} else if (!this.newProfile.password && this.newProfile.confirmPassword) {
|
||||
return 'Password cannot be blank';
|
||||
@@ -572,6 +591,7 @@ export default {
|
||||
this.oldProfile.decimalSeparator = profile.decimalSeparator;
|
||||
this.oldProfile.digitGroupingSymbol = profile.digitGroupingSymbol;
|
||||
this.oldProfile.digitGrouping = profile.digitGrouping;
|
||||
this.oldProfile.currencyDisplayType = profile.currencyDisplayType;
|
||||
|
||||
this.newProfile.email = this.oldProfile.email
|
||||
this.newProfile.nickname = this.oldProfile.nickname;
|
||||
@@ -587,6 +607,7 @@ export default {
|
||||
this.newProfile.decimalSeparator = this.oldProfile.decimalSeparator;
|
||||
this.newProfile.digitGroupingSymbol = this.oldProfile.digitGroupingSymbol;
|
||||
this.newProfile.digitGrouping = this.oldProfile.digitGrouping;
|
||||
this.newProfile.currencyDisplayType = this.oldProfile.currencyDisplayType;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user