From 3b34cdbda2ef2f4cf5b3dac91c8af697abdaaf85 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 10 Jun 2024 22:26:57 +0800 Subject: [PATCH] remove unused code --- src/components/desktop/PieChart.vue | 4 +--- src/components/desktop/TrendsChart.vue | 5 +---- src/components/mobile/PieChart.vue | 4 +--- src/views/desktop/statistics/TransactionPage.vue | 2 -- src/views/mobile/statistics/TransactionPage.vue | 1 - 5 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/desktop/PieChart.vue b/src/components/desktop/PieChart.vue index 30b42031..00b4a411 100644 --- a/src/components/desktop/PieChart.vue +++ b/src/components/desktop/PieChart.vue @@ -20,7 +20,6 @@ export default { 'nameField', 'valueField', 'percentField', - 'currencyField', 'colorField', 'hiddenField', 'minValidPercent', @@ -86,7 +85,6 @@ export default { value: item[this.valueField], percent: (item[this.percentField] > 0 || item[this.percentField] === 0 || item[this.percentField] === '0') ? item[this.percentField] : (item[this.valueField] / totalValidValue * 100), actualPercent: item[this.valueField] / totalValidValue, - currency: item[this.currencyField], itemStyle: { color: this.getColor(item[this.colorField] ? item[this.colorField] : colorConstants.defaultChartColors[validItems.length % colorConstants.defaultChartColors.length]), }, @@ -95,7 +93,7 @@ export default { }; finalItem.displayPercent = formatPercent(finalItem.percent, 2, '<0.01'); - finalItem.displayValue = this.getDisplayCurrency(finalItem.value, (finalItem.currency || this.defaultCurrency)); + finalItem.displayValue = this.getDisplayCurrency(finalItem.value, this.defaultCurrency); validItems.push(finalItem); } diff --git a/src/components/desktop/TrendsChart.vue b/src/components/desktop/TrendsChart.vue index c5d6c7c8..4ffe61e1 100644 --- a/src/components/desktop/TrendsChart.vue +++ b/src/components/desktop/TrendsChart.vue @@ -28,7 +28,6 @@ export default { 'idField', 'nameField', 'valueField', - 'currencyField', 'colorField', 'hiddenField', 'defaultCurrency', @@ -139,7 +138,6 @@ export default { const finalItem = { id: (this.idField && item[this.idField]) ? item[this.idField] : item[this.nameField], name: (this.idField && item[this.idField]) ? item[this.idField] : item[this.nameField], - currency: item[this.currencyField], itemStyle: { color: this.getColor(item[this.colorField] ? item[this.colorField] : colorConstants.defaultChartColors[i % colorConstants.defaultChartColors.length]), }, @@ -230,8 +228,7 @@ export default { const name = self.itemsMap[id] && self.nameField && self.itemsMap[id][self.nameField] ? self.itemsMap[id][self.nameField] : id; if (params[i].data !== 0) { - const currency = self.itemsMap[id] && self.currencyField && self.itemsMap[id][self.currencyField] ? self.itemsMap[id][self.currencyField] : self.defaultCurrency; - const value = self.getDisplayCurrency(params[i].data, currency); + const value = self.getDisplayCurrency(params[i].data, self.defaultCurrency); tooltip += '
'; tooltip += `${name}${value}
`; tooltip += '
'; diff --git a/src/components/mobile/PieChart.vue b/src/components/mobile/PieChart.vue index 2902c789..25c308de 100644 --- a/src/components/mobile/PieChart.vue +++ b/src/components/mobile/PieChart.vue @@ -90,7 +90,6 @@ export default { 'nameField', 'valueField', 'percentField', - 'currencyField', 'colorField', 'hiddenField', 'minValidPercent', @@ -139,13 +138,12 @@ export default { value: item[this.valueField], percent: (item[this.percentField] > 0 || item[this.percentField] === 0 || item[this.percentField] === '0') ? item[this.percentField] : (item[this.valueField] / totalValidValue * 100), actualPercent: item[this.valueField] / totalValidValue, - currency: item[this.currencyField], color: item[this.colorField] ? item[this.colorField] : colorConstants.defaultChartColors[validItems.length % colorConstants.defaultChartColors.length], sourceItem: item }; finalItem.displayPercent = formatPercent(finalItem.percent, 2, '<0.01'); - finalItem.displayValue = this.getDisplayCurrency(finalItem.value, (finalItem.currency || this.defaultCurrency)); + finalItem.displayValue = this.getDisplayCurrency(finalItem.value, this.defaultCurrency); validItems.push(finalItem); } diff --git a/src/views/desktop/statistics/TransactionPage.vue b/src/views/desktop/statistics/TransactionPage.vue index a37bd592..7cc711ac 100644 --- a/src/views/desktop/statistics/TransactionPage.vue +++ b/src/views/desktop/statistics/TransactionPage.vue @@ -160,7 +160,6 @@ name-field="name" value-field="totalAmount" percent-field="percent" - currency-field="currency" hidden-field="hidden" v-else-if="!initing" @click="clickPieChartItem" @@ -247,7 +246,6 @@ id-field="id" name-field="name" value-field="totalAmount" - currency-field="currency" hidden-field="hidden" v-else-if="!initing" @click="clickTrendChartItem" diff --git a/src/views/mobile/statistics/TransactionPage.vue b/src/views/mobile/statistics/TransactionPage.vue index c0ca27fb..4881afb2 100644 --- a/src/views/mobile/statistics/TransactionPage.vue +++ b/src/views/mobile/statistics/TransactionPage.vue @@ -59,7 +59,6 @@ name-field="name" value-field="totalAmount" percent-field="percent" - currency-field="currency" hidden-field="hidden" v-else-if="!loading" @click="clickPieChartItem"