mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
support setting decimal separator and digit grouping symbol
This commit is contained in:
@@ -4,7 +4,7 @@ import services from '@/lib/services.js';
|
||||
import logger from '@/lib/logger.js';
|
||||
import { isEquals } from '@/lib/common.js';
|
||||
import { getCurrentUnixTime, formatUnixTime } from '@/lib/datetime.js';
|
||||
import { getExchangedAmount } from '@/lib/currency.js';
|
||||
import { getExchangedAmount } from '@/lib/numeral.js';
|
||||
|
||||
const exchangeRatesLocalStorageKey = 'ebk_app_exchange_rates';
|
||||
|
||||
|
||||
+4
-1
@@ -380,7 +380,10 @@ export const useRootStore = defineStore('root', {
|
||||
longDateFormat: profile.longDateFormat,
|
||||
shortDateFormat: profile.shortDateFormat,
|
||||
longTimeFormat: profile.longTimeFormat,
|
||||
shortTimeFormat: profile.shortTimeFormat
|
||||
shortTimeFormat: profile.shortTimeFormat,
|
||||
decimalSeparator: profile.decimalSeparator,
|
||||
digitGroupingSymbol: profile.digitGroupingSymbol,
|
||||
digitGrouping: profile.digitGrouping
|
||||
}).then(response => {
|
||||
const data = response.data;
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ export const useSettingsStore = defineStore('settings', {
|
||||
applicationLockWebAuthn: settings.isEnableApplicationLockWebAuthn(),
|
||||
autoUpdateExchangeRatesData: settings.isAutoUpdateExchangeRatesData(),
|
||||
autoGetCurrentGeoLocation: settings.isAutoGetCurrentGeoLocation(),
|
||||
thousandsSeparator: settings.isEnableThousandsSeparator(),
|
||||
currencyDisplayMode: settings.getCurrencyDisplayMode(),
|
||||
showAmountInHomePage: settings.isShowAmountInHomePage(),
|
||||
timezoneUsedForStatisticsInHomePage: settings.getTimezoneUsedForStatisticsInHomePage(),
|
||||
@@ -68,10 +67,6 @@ export const useSettingsStore = defineStore('settings', {
|
||||
settings.setAutoGetCurrentGeoLocation(value);
|
||||
this.appSettings.autoGetCurrentGeoLocation = value;
|
||||
},
|
||||
setEnableThousandsSeparator(value) {
|
||||
settings.setEnableThousandsSeparator(value);
|
||||
this.appSettings.thousandsSeparator = value;
|
||||
},
|
||||
setCurrencyDisplayMode(value) {
|
||||
settings.setCurrencyDisplayMode(value);
|
||||
this.appSettings.currencyDisplayMode = value;
|
||||
|
||||
@@ -25,9 +25,6 @@ import {
|
||||
getDay,
|
||||
getDayOfWeekName
|
||||
} from '@/lib/datetime.js';
|
||||
import {
|
||||
stringCurrencyToNumeric
|
||||
} from '@/lib/currency.js';
|
||||
|
||||
const emptyTransactionResult = {
|
||||
items: [],
|
||||
@@ -353,8 +350,7 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
}
|
||||
|
||||
if ((!sourceAccount || !destinationAccount || transaction.destinationAmount === oldValue || transaction.destinationAmount === 0) &&
|
||||
(stringCurrencyToNumeric(transactionConstants.minAmount) <= newValue &&
|
||||
newValue <= stringCurrencyToNumeric(transactionConstants.maxAmount))) {
|
||||
(transactionConstants.minAmountNumber <= newValue && newValue <= transactionConstants.maxAmountNumber)) {
|
||||
transaction.destinationAmount = newValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,18 @@ export const useUserStore = defineStore('user', {
|
||||
const settingsStore = useSettingsStore();
|
||||
const userInfo = state.currentUserInfo || {};
|
||||
return isNumber(userInfo.shortTimeFormat) ? userInfo.shortTimeFormat : settingsStore.shortTimeFormat;
|
||||
},
|
||||
currentUserDecimalSeparator(state) {
|
||||
const userInfo = state.currentUserInfo || {};
|
||||
return userInfo.decimalSeparator;
|
||||
},
|
||||
currentUserDigitGroupingSymbol(state) {
|
||||
const userInfo = state.currentUserInfo || {};
|
||||
return userInfo.digitGroupingSymbol;
|
||||
},
|
||||
currentUserDigitGrouping(state) {
|
||||
const userInfo = state.currentUserInfo || {};
|
||||
return userInfo.digitGrouping;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user