mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 09:44:26 +08:00
don't show account balance when account balance is set to hidden
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
<span class="skeleton-text" v-if="skeleton">Name</span>
|
<span class="skeleton-text" v-if="skeleton">Name</span>
|
||||||
<span v-else-if="!skeleton && selectedItem.name">{{ selectedItem.name }}</span>
|
<span v-else-if="!skeleton && selectedItem.name">{{ selectedItem.name }}</span>
|
||||||
<span class="skeleton-text" v-if="skeleton">Value</span>
|
<span class="skeleton-text" v-if="skeleton">Value</span>
|
||||||
<span v-else-if="!skeleton" :style="(selectedItem ? selectedItem.color : '') | iconStyle('default', 'var(--default-icon-color)')">{{ selectedItem.value | currency(selectedItem.currency || defaultCurrency) }}</span>
|
<span v-else-if="!skeleton && showValue" :style="(selectedItem ? selectedItem.color : '') | iconStyle('default', 'var(--default-icon-color)')">{{ selectedItem.value | currency(selectedItem.currency || defaultCurrency) }}</span>
|
||||||
<f7-icon class="item-navigate-icon" f7="chevron_right" v-if="enableClickItem"></f7-icon>
|
<f7-icon class="item-navigate-icon" f7="chevron_right" v-if="enableClickItem"></f7-icon>
|
||||||
</f7-link>
|
</f7-link>
|
||||||
<f7-link :no-link-class="true" v-else-if="!validItems || !validItems.length">
|
<f7-link :no-link-class="true" v-else-if="!validItems || !validItems.length">
|
||||||
@@ -101,6 +101,7 @@ export default {
|
|||||||
'hiddenField',
|
'hiddenField',
|
||||||
'minValidPercent',
|
'minValidPercent',
|
||||||
'defaultCurrency',
|
'defaultCurrency',
|
||||||
|
'showValue',
|
||||||
'showCenterText',
|
'showCenterText',
|
||||||
'showSelectedItemInfo',
|
'showSelectedItemInfo',
|
||||||
'enableClickItem',
|
'enableClickItem',
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
<pie-chart
|
<pie-chart
|
||||||
:items="statisticsData.items"
|
:items="statisticsData.items"
|
||||||
:min-valid-percent="0.0001"
|
:min-valid-percent="0.0001"
|
||||||
|
:show-value="showAmountInChart"
|
||||||
:show-center-text="true"
|
:show-center-text="true"
|
||||||
:show-selected-item-info="true"
|
:show-selected-item-info="true"
|
||||||
:enable-click-item="true"
|
:enable-click-item="true"
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
{{ query.chartDataType | totalAmountName(allChartDataTypes) | localized }}
|
{{ query.chartDataType | totalAmountName(allChartDataTypes) | localized }}
|
||||||
</text>
|
</text>
|
||||||
<text class="statistics-pie-chart-total-amount-value" v-if="statisticsData.items && statisticsData.items.length">
|
<text class="statistics-pie-chart-total-amount-value" v-if="statisticsData.items && statisticsData.items.length">
|
||||||
{{ statisticsData.totalAmount | currency(defaultCurrency) | textLimit(16) }}
|
{{ statisticsData.totalAmount | currency(defaultCurrency) | finalAmount(showAccountBalance, query.chartDataType, allChartDataTypes) | textLimit(16) }}
|
||||||
</text>
|
</text>
|
||||||
<text class="statistics-pie-chart-total-no-data" cy="50%" v-if="!statisticsData.items || !statisticsData.items.length">
|
<text class="statistics-pie-chart-total-no-data" cy="50%" v-if="!statisticsData.items || !statisticsData.items.length">
|
||||||
{{ $t('No data') }}
|
{{ $t('No data') }}
|
||||||
@@ -146,7 +147,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="title"
|
<div slot="title"
|
||||||
:class="{ 'statistics-list-item-overview-amount': true, 'text-color-teal': query.chartDataType === allChartDataTypes.ExpenseByAccount.type || query.chartDataType === allChartDataTypes.ExpenseByPrimaryCategory.type || query.chartDataType === allChartDataTypes.ExpenseBySecondaryCategory.type, 'text-color-red': query.chartDataType === allChartDataTypes.IncomeByAccount.type || query.chartDataType === allChartDataTypes.IncomeByPrimaryCategory.type || query.chartDataType === allChartDataTypes.IncomeBySecondaryCategory.type }">
|
:class="{ 'statistics-list-item-overview-amount': true, 'text-color-teal': query.chartDataType === allChartDataTypes.ExpenseByAccount.type || query.chartDataType === allChartDataTypes.ExpenseByPrimaryCategory.type || query.chartDataType === allChartDataTypes.ExpenseBySecondaryCategory.type, 'text-color-red': query.chartDataType === allChartDataTypes.IncomeByAccount.type || query.chartDataType === allChartDataTypes.IncomeByPrimaryCategory.type || query.chartDataType === allChartDataTypes.IncomeBySecondaryCategory.type }">
|
||||||
{{ statisticsData.totalAmount | currency(defaultCurrency) }}
|
{{ statisticsData.totalAmount | currency(defaultCurrency) | finalAmount(showAccountBalance, query.chartDataType, allChartDataTypes) }}
|
||||||
</div>
|
</div>
|
||||||
</f7-list-item>
|
</f7-list-item>
|
||||||
<f7-list-item v-for="(item, idx) in statisticsData.items" :key="idx"
|
<f7-list-item v-for="(item, idx) in statisticsData.items" :key="idx"
|
||||||
@@ -172,7 +173,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="after">
|
<div slot="after">
|
||||||
<span>{{ item.totalAmount | currency(item.currency || defaultCurrency) }}</span>
|
<span>{{ item.totalAmount | currency(item.currency || defaultCurrency) | finalAmount(showAccountBalance, query.chartDataType, allChartDataTypes) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="inner-end" class="statistics-item-end">
|
<div slot="inner-end" class="statistics-item-end">
|
||||||
@@ -255,6 +256,7 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
loadingError: null,
|
loadingError: null,
|
||||||
sortBy: self.$settings.getStatisticsSortingType(),
|
sortBy: self.$settings.getStatisticsSortingType(),
|
||||||
|
showAccountBalance: self.$settings.isShowAccountBalance(),
|
||||||
showChartDataTypePopover: false,
|
showChartDataTypePopover: false,
|
||||||
showDatePopover: false,
|
showDatePopover: false,
|
||||||
showCustomDateRangeSheet: false,
|
showCustomDateRangeSheet: false,
|
||||||
@@ -355,6 +357,14 @@ export default {
|
|||||||
totalAmount: combinedData.totalAmount,
|
totalAmount: combinedData.totalAmount,
|
||||||
items: allStatisticsItems
|
items: allStatisticsItems
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
showAmountInChart() {
|
||||||
|
if (!this.showAccountBalance
|
||||||
|
&& (this.query.chartDataType === this.allChartDataTypes.AccountTotalAssets.type || this.query.chartDataType === this.allChartDataTypes.AccountTotalLiabilities.type)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -605,6 +615,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
finalAmount(amount, isShowAccountBalance, dataType, allChartDataTypes) {
|
||||||
|
if (!isShowAccountBalance && (dataType === allChartDataTypes.AccountTotalAssets.type || dataType === allChartDataTypes.AccountTotalLiabilities.type)) {
|
||||||
|
return '***';
|
||||||
|
}
|
||||||
|
|
||||||
|
return amount;
|
||||||
|
},
|
||||||
chartDataTypeName(dataType, allChartDataTypes) {
|
chartDataTypeName(dataType, allChartDataTypes) {
|
||||||
for (let chartDataTypeField in allChartDataTypes) {
|
for (let chartDataTypeField in allChartDataTypes) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(allChartDataTypes, chartDataTypeField)) {
|
if (!Object.prototype.hasOwnProperty.call(allChartDataTypes, chartDataTypeField)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user