mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 15:37:33 +08:00
remove unused code
This commit is contained in:
@@ -20,7 +20,6 @@ export default {
|
|||||||
'nameField',
|
'nameField',
|
||||||
'valueField',
|
'valueField',
|
||||||
'percentField',
|
'percentField',
|
||||||
'currencyField',
|
|
||||||
'colorField',
|
'colorField',
|
||||||
'hiddenField',
|
'hiddenField',
|
||||||
'minValidPercent',
|
'minValidPercent',
|
||||||
@@ -86,7 +85,6 @@ export default {
|
|||||||
value: item[this.valueField],
|
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),
|
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,
|
actualPercent: item[this.valueField] / totalValidValue,
|
||||||
currency: item[this.currencyField],
|
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: this.getColor(item[this.colorField] ? item[this.colorField] : colorConstants.defaultChartColors[validItems.length % colorConstants.defaultChartColors.length]),
|
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.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);
|
validItems.push(finalItem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ export default {
|
|||||||
'idField',
|
'idField',
|
||||||
'nameField',
|
'nameField',
|
||||||
'valueField',
|
'valueField',
|
||||||
'currencyField',
|
|
||||||
'colorField',
|
'colorField',
|
||||||
'hiddenField',
|
'hiddenField',
|
||||||
'defaultCurrency',
|
'defaultCurrency',
|
||||||
@@ -139,7 +138,6 @@ export default {
|
|||||||
const finalItem = {
|
const finalItem = {
|
||||||
id: (this.idField && item[this.idField]) ? item[this.idField] : item[this.nameField],
|
id: (this.idField && item[this.idField]) ? item[this.idField] : item[this.nameField],
|
||||||
name: (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: {
|
itemStyle: {
|
||||||
color: this.getColor(item[this.colorField] ? item[this.colorField] : colorConstants.defaultChartColors[i % colorConstants.defaultChartColors.length]),
|
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;
|
const name = self.itemsMap[id] && self.nameField && self.itemsMap[id][self.nameField] ? self.itemsMap[id][self.nameField] : id;
|
||||||
|
|
||||||
if (params[i].data !== 0) {
|
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, self.defaultCurrency);
|
||||||
const value = self.getDisplayCurrency(params[i].data, currency);
|
|
||||||
tooltip += '<div><span class="chart-pointer" style="background-color: ' + params[i].color + '"></span>';
|
tooltip += '<div><span class="chart-pointer" style="background-color: ' + params[i].color + '"></span>';
|
||||||
tooltip += `<span>${name}</span><span style="margin-left: 20px; float: right">${value}</span><br/>`;
|
tooltip += `<span>${name}</span><span style="margin-left: 20px; float: right">${value}</span><br/>`;
|
||||||
tooltip += '</div>';
|
tooltip += '</div>';
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ export default {
|
|||||||
'nameField',
|
'nameField',
|
||||||
'valueField',
|
'valueField',
|
||||||
'percentField',
|
'percentField',
|
||||||
'currencyField',
|
|
||||||
'colorField',
|
'colorField',
|
||||||
'hiddenField',
|
'hiddenField',
|
||||||
'minValidPercent',
|
'minValidPercent',
|
||||||
@@ -139,13 +138,12 @@ export default {
|
|||||||
value: item[this.valueField],
|
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),
|
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,
|
actualPercent: item[this.valueField] / totalValidValue,
|
||||||
currency: item[this.currencyField],
|
|
||||||
color: item[this.colorField] ? item[this.colorField] : colorConstants.defaultChartColors[validItems.length % colorConstants.defaultChartColors.length],
|
color: item[this.colorField] ? item[this.colorField] : colorConstants.defaultChartColors[validItems.length % colorConstants.defaultChartColors.length],
|
||||||
sourceItem: item
|
sourceItem: item
|
||||||
};
|
};
|
||||||
|
|
||||||
finalItem.displayPercent = formatPercent(finalItem.percent, 2, '<0.01');
|
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);
|
validItems.push(finalItem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,6 @@
|
|||||||
name-field="name"
|
name-field="name"
|
||||||
value-field="totalAmount"
|
value-field="totalAmount"
|
||||||
percent-field="percent"
|
percent-field="percent"
|
||||||
currency-field="currency"
|
|
||||||
hidden-field="hidden"
|
hidden-field="hidden"
|
||||||
v-else-if="!initing"
|
v-else-if="!initing"
|
||||||
@click="clickPieChartItem"
|
@click="clickPieChartItem"
|
||||||
@@ -247,7 +246,6 @@
|
|||||||
id-field="id"
|
id-field="id"
|
||||||
name-field="name"
|
name-field="name"
|
||||||
value-field="totalAmount"
|
value-field="totalAmount"
|
||||||
currency-field="currency"
|
|
||||||
hidden-field="hidden"
|
hidden-field="hidden"
|
||||||
v-else-if="!initing"
|
v-else-if="!initing"
|
||||||
@click="clickTrendChartItem"
|
@click="clickTrendChartItem"
|
||||||
|
|||||||
@@ -59,7 +59,6 @@
|
|||||||
name-field="name"
|
name-field="name"
|
||||||
value-field="totalAmount"
|
value-field="totalAmount"
|
||||||
percent-field="percent"
|
percent-field="percent"
|
||||||
currency-field="currency"
|
|
||||||
hidden-field="hidden"
|
hidden-field="hidden"
|
||||||
v-else-if="!loading"
|
v-else-if="!loading"
|
||||||
@click="clickPieChartItem"
|
@click="clickPieChartItem"
|
||||||
|
|||||||
Reference in New Issue
Block a user