From fd7905833e65a385d94f320421df89758f0ffb5e Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 1 Aug 2022 00:33:19 +0800 Subject: [PATCH] optimize statistics page style --- src/filters/currency.js | 18 +++---- src/mobile-main.js | 2 +- src/views/mobile/statistics/Transaction.vue | 53 +++++++++++---------- 3 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/filters/currency.js b/src/filters/currency.js index 2aa49c90..dadf20a0 100644 --- a/src/filters/currency.js +++ b/src/filters/currency.js @@ -2,7 +2,7 @@ import currency from '../consts/currency.js'; import settings from '../lib/settings.js'; import utils from '../lib/utils.js'; -export default function ({i18n}, value, currencyCode) { +export default function ({i18n}, value, currencyCode, notConvertValue) { if (!utils.isNumber(value) && !utils.isString(value)) { return value; } @@ -11,16 +11,18 @@ export default function ({i18n}, value, currencyCode) { value = value.toString(); } - const hasIncompleteFlag = utils.isString(value) && value.charAt(value.length - 1) === '+'; + if (!notConvertValue) { + const hasIncompleteFlag = utils.isString(value) && value.charAt(value.length - 1) === '+'; - if (hasIncompleteFlag) { - value = value.substr(0, value.length - 1); - } + if (hasIncompleteFlag) { + value = value.substr(0, value.length - 1); + } - value = utils.numericCurrencyToString(value); + value = utils.numericCurrencyToString(value); - if (hasIncompleteFlag) { - value = value + '+'; + if (hasIncompleteFlag) { + value = value + '+'; + } } const currencyDisplayMode = settings.getCurrencyDisplayMode(); diff --git a/src/mobile-main.js b/src/mobile-main.js index 1aaa2bb3..07f76311 100644 --- a/src/mobile-main.js +++ b/src/mobile-main.js @@ -165,7 +165,7 @@ Vue.filter('format', (value, format) => formatFilter(value, format)); Vue.filter('optionName', (value, options, keyField, nameField, defaultName) => optionNameFilter(value, options, keyField, nameField, defaultName)); Vue.filter('itemFieldContent', (value, fieldName, defaultValue, translate) => itemFieldContentFilter({ i18n }, value, fieldName, defaultValue, translate)); Vue.filter('languageName', (languageCode) => languageNameFilter(languageCode)); -Vue.filter('currency', (value, currencyCode) => currencyFilter({ i18n }, value, currencyCode)); +Vue.filter('currency', (value, currencyCode, notConvertValue) => currencyFilter({ i18n }, value, currencyCode, notConvertValue)); Vue.filter('exchangeRate', (value, currentCurrency, allExchangeRates) => exchangeRateFilter(value, currentCurrency, allExchangeRates)); Vue.filter('utcOffset', (value) => utcOffsetFilter(value)); Vue.filter('textLimit', (value, maxLength) => textLimitFilter(value, maxLength)); diff --git a/src/views/mobile/statistics/Transaction.vue b/src/views/mobile/statistics/Transaction.vue index 224bc509..4d3656ef 100644 --- a/src/views/mobile/statistics/Transaction.vue +++ b/src/views/mobile/statistics/Transaction.vue @@ -25,11 +25,11 @@ - - + +
{{ $t('Sort By') }} {{ query.sortingType | optionName(allSortingTypes, 'type', 'name', 'System Default') | localized }} - +
- - - {{ $t('Sort By') }} - {{ query.sortingType | optionName(allSortingTypes, 'type', 'name', 'System Default') | localized }} - + +
+
+ {{ query.chartDataType | totalAmountName(allChartDataTypes) | localized }} +
+
+ {{ $t('Sort By') }} + {{ query.sortingType | optionName(allSortingTypes, 'type', 'name', 'System Default') | localized }} +
+
+
+
+ + {{ statisticsData.totalAmount | currency(defaultCurrency) | finalAmount(showAccountBalance, query.chartDataType, allChartDataTypes) }} + + + {{ '---' | currency(defaultCurrency, true) }} + +
+
@@ -153,15 +168,6 @@ - -
- {{ query.chartDataType | totalAmountName(allChartDataTypes) | localized }} -
-
- {{ statisticsData.totalAmount | currency(defaultCurrency) | finalAmount(showAccountBalance, query.chartDataType, allChartDataTypes) }} -
-