|
@@ -4,9 +4,8 @@ import apiDashboard from "@/api/dashboard/apiDashboard";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- dataIndexes: ["saving", "amountSubsidy"],
|
|
|
+ dataIndexes: ["subsidy", "saving","earning"],
|
|
|
option: {
|
|
|
- color: ["#80D4FF", "#FFDF80"],
|
|
|
tooltip: {
|
|
|
trigger: "item",
|
|
|
},
|
|
@@ -56,9 +55,24 @@ export default {
|
|
|
},
|
|
|
getData() {
|
|
|
return apiDashboard.getPvProfitOverview(this.queryData).then((res) => {
|
|
|
- this.option.series[0].data[0].value = res.subsidy;
|
|
|
- this.option.series[0].data[1].value = res.saving;
|
|
|
- this.option.series[0].data[2].value = res.earning;
|
|
|
+ this.option.series[0].data = res.map((v) => {
|
|
|
+ if (v.name === "subsidy") {
|
|
|
+ return {
|
|
|
+ value: v.value,
|
|
|
+ name: "补贴金额",
|
|
|
+ };
|
|
|
+ } else if (v.name === "saving") {
|
|
|
+ return {
|
|
|
+ value: v.value,
|
|
|
+ name: "节约金额",
|
|
|
+ };
|
|
|
+ } else if (v.name === "earning") {
|
|
|
+ return {
|
|
|
+ value: v.value,
|
|
|
+ name: "并网收入",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
this.chart.setOption(this.option);
|
|
|
});
|
|
|
},
|