|
@@ -231,6 +231,8 @@ class WaterInfo extends BaseWidget {
|
|
|
var setChart = (res) => {
|
|
|
var chart = echarts.init(document.getElementById('waterInfo-c3'))
|
|
|
var data = res.monSupSellWater.map(e => [e.month, e.gsl, e.ssl])
|
|
|
+ var yearSupSellWater = res.yearSupSellWater[0] || { gsl: '-', ssl: '-' }
|
|
|
+ var yearSupSellWaterPlan = res.yearSupSellWaterPlan[0] || { gsl: '-', ssl: '-' }
|
|
|
chart.setOption({
|
|
|
color:['rgb(52,104,252)','rgb(15,195,132)','rgb(228,218,120)', 'rgb(52,151,253)'],
|
|
|
tooltip: { trigger: 'axis', padding: 10, textStyle: { fontSize: 28} },
|
|
@@ -253,8 +255,8 @@ class WaterInfo extends BaseWidget {
|
|
|
],
|
|
|
grid: [{ right: '70%',bottom: '70px',left:'80px',top:'30px' }, { left: '40%',bottom: '70px',right:'20px',top:'40px' }],
|
|
|
series: [
|
|
|
- { name: '供水量', type: 'bar', stack: 'total', data: [res.yearSupSellWater[0].gsl, res.yearSupSellWater[0].ssl], itemStyle: { borderWidth:'4',borderColor:'rgba(0,0,0,0.3)' } },
|
|
|
- { name: '售水量', type: 'bar', stack: 'total', data: [res.yearSupSellWaterPlan[0].gsl, res.yearSupSellWaterPlan[0].ssl], itemStyle: { borderWidth:'4',borderColor:'rgba(0,0,0,0.3)' } },
|
|
|
+ { name: '供水量', type: 'bar', stack: 'total', data: [yearSupSellWater.gsl, yearSupSellWater.ssl], itemStyle: { borderWidth:'4',borderColor:'rgba(0,0,0,0.3)' } },
|
|
|
+ { name: '售水量', type: 'bar', stack: 'total', data: [yearSupSellWaterPlan.gsl, yearSupSellWaterPlan.ssl], itemStyle: { borderWidth:'4',borderColor:'rgba(0,0,0,0.3)' } },
|
|
|
{ data: data.map(e => e[1]), name: '当月供水量', smooth: true, type: 'line', barWidth: '20%', xAxisIndex: 1, yAxisIndex: 1 },
|
|
|
{ data: data.map(e => e[2]), name: '当月售水量', smooth: true, type: 'line', barWidth: '20%', xAxisIndex: 1, yAxisIndex: 1 }
|
|
|
]
|
|
@@ -456,6 +458,7 @@ class WaterInfo extends BaseWidget {
|
|
|
var dw = ['一厂', '二厂', '全部'][works.value]
|
|
|
var dy = yearsSelect.value
|
|
|
var dr = res[yearsSelect.value]
|
|
|
+ if(!dr.cost) dr.cost = {}
|
|
|
var data = {
|
|
|
year: dy,
|
|
|
fixed: isByMonth ? Array['from']({length:12}, (e, i) => '-') : Array['from']({length:4}, (e, i) => '-'),
|