|
@@ -5,7 +5,7 @@
|
|
|
<el-row type="flex" :gutter="20" style="margin-top: 20px">
|
|
|
<el-col :span="12">
|
|
|
<PieChartBlock
|
|
|
- title="单日供电量(单位:kw·h)"
|
|
|
+ title="当日供电量(单位:kw·h)"
|
|
|
:opt-cfg="elecQuantity"
|
|
|
/>
|
|
|
</el-col>
|
|
@@ -16,8 +16,8 @@
|
|
|
<el-row type="flex" :gutter="20" style="margin-top: 20px">
|
|
|
<el-col :span="24">
|
|
|
<BarChartBlock
|
|
|
- title="单日供电量柱状图"
|
|
|
- :opt-cfg="devcNum"
|
|
|
+ title="当日供电量柱状图"
|
|
|
+ :opt-cfg="pvSupplyIndex"
|
|
|
/>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -215,6 +215,14 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
+ pvSupplyIndex: {
|
|
|
+ unit: ' ',
|
|
|
+ xAxis: {
|
|
|
+ type: 'category',
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ series: [],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -466,7 +474,42 @@ export default {
|
|
|
data,
|
|
|
code,
|
|
|
} = await get('pg/supply/hour/summery/h');
|
|
|
-
|
|
|
+ if (ApiCode.SUCCESS !== code || !data || data.length < 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const xaxis = DateTool.getTime(60);
|
|
|
+ const {
|
|
|
+ pv,
|
|
|
+ supply,
|
|
|
+ } = data;
|
|
|
+ const series = [
|
|
|
+ {
|
|
|
+ name: '光伏',
|
|
|
+ type: 'bar',
|
|
|
+ barWidth: '30%', // 调整柱状图宽度
|
|
|
+ data: [],
|
|
|
+ }, {
|
|
|
+ name: '市电',
|
|
|
+ type: 'bar',
|
|
|
+ barWidth: '30%', // 调整柱状图宽度
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ xaxis.forEach((item, index) => {
|
|
|
+ let timeIndex = index + 1;
|
|
|
+ if (!pv || !pv[timeIndex]) {
|
|
|
+ series[0].data.push(0);
|
|
|
+ } else {
|
|
|
+ series[0].data.push(pv[timeIndex].useQuantity);
|
|
|
+ }
|
|
|
+ if (!supply || !supply[timeIndex]) {
|
|
|
+ series[1].data.push(0);
|
|
|
+ } else {
|
|
|
+ series[1].data.push(supply[timeIndex].quantity);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.pvSupplyIndex.series = series;
|
|
|
+ this.pvSupplyIndex.xAxis.data = xaxis;
|
|
|
},
|
|
|
getList() {
|
|
|
this.loading = true;
|