|
@@ -76,7 +76,11 @@
|
|
import BaseChart from '@/components/BaseChart'
|
|
import BaseChart from '@/components/BaseChart'
|
|
import SubTitle from '@/components/SubTitle/index.vue'
|
|
import SubTitle from '@/components/SubTitle/index.vue'
|
|
import {
|
|
import {
|
|
|
|
+ qryDateElecMeterByDate,
|
|
|
|
+ qryDateWaterMeterByDate,
|
|
|
|
+ qryDateWaterMeterByYear,
|
|
qryElecMeterByDate,
|
|
qryElecMeterByDate,
|
|
|
|
+ qryElecMeterByYear,
|
|
qryTimeIndexElecMeterByDay,
|
|
qryTimeIndexElecMeterByDay,
|
|
qryTimeIndexWaterMeterByDay,
|
|
qryTimeIndexWaterMeterByDay,
|
|
qryWaterMeterByDate
|
|
qryWaterMeterByDate
|
|
@@ -175,7 +179,7 @@ const dtCostConst = {
|
|
axisLabel: {
|
|
axisLabel: {
|
|
interval: 0,
|
|
interval: 0,
|
|
// color: '#c1cadf',
|
|
// color: '#c1cadf',
|
|
- fontSize: '15',
|
|
|
|
|
|
+ fontSize: '10',
|
|
}
|
|
}
|
|
}],
|
|
}],
|
|
yAxis: [{
|
|
yAxis: [{
|
|
@@ -275,13 +279,13 @@ export default {
|
|
{
|
|
{
|
|
name: '月', value: '3',
|
|
name: '月', value: '3',
|
|
date: () => {
|
|
date: () => {
|
|
- return DateTool.now(DateTool.DateFormat.YYYY_MM)
|
|
|
|
|
|
+ return DateTool.lastMonth(DateTool.DateFormat.YYYY_MM_DD)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '年', value: '4',
|
|
name: '年', value: '4',
|
|
date: () => {
|
|
date: () => {
|
|
- return DateTool.now(DateTool.DateFormat.YYYY)
|
|
|
|
|
|
+ return DateTool.lastYearMonthStart()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
],
|
|
],
|
|
@@ -325,8 +329,54 @@ export default {
|
|
const {data: timeWaterIndex} = await qryTimeIndexWaterMeterByDay(day, timeIndex)
|
|
const {data: timeWaterIndex} = await qryTimeIndexWaterMeterByDay(day, timeIndex)
|
|
options.xAxis[0].data = _24Time;
|
|
options.xAxis[0].data = _24Time;
|
|
_24Time.map((item, index) => {
|
|
_24Time.map((item, index) => {
|
|
- options.series[0].data.push(timeWaterIndex[index] ? timeWaterIndex[index].waterQuantity : 0)
|
|
|
|
- options.series[1].data.push(timeElecIndex[index] ? timeElecIndex[index].elecQuantity : 0)
|
|
|
|
|
|
+ options.series[0].data.push(timeWaterIndex[index] ? this.decimalFormat(timeWaterIndex[index].useWaterCost) : 0)
|
|
|
|
+ options.series[1].data.push(timeElecIndex[index] ? this.decimalFormat(timeElecIndex[index].useElecCost) : 0)
|
|
|
|
+ })
|
|
|
|
+ options.xAxis[0].axisLabel.formatter = function (value) {
|
|
|
|
+ // 按空格分割字符串并换行显示
|
|
|
|
+ return value.split(' ').join('\n');
|
|
|
|
+ }
|
|
|
|
+ this.dtCost = options
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (item.value === '3') {
|
|
|
|
+ const day = item.date()
|
|
|
|
+ const days = DateTool.getDayOfRange(day, DateTool.now(), DateTool.DateFormat.MM_DD);
|
|
|
|
+ const {data: timeElecIndex} = await qryDateElecMeterByDate(day)
|
|
|
|
+ const {data: timeWaterIndex} = await qryDateWaterMeterByDate(day)
|
|
|
|
+ options.xAxis[0].data = days;
|
|
|
|
+ days.map((item, index) => {
|
|
|
|
+ options.series[0].data.push(timeWaterIndex[index] ? this.decimalFormat(timeWaterIndex[index].useWaterCost) : 0)
|
|
|
|
+ options.series[1].data.push(timeElecIndex[index] ? this.decimalFormat(timeElecIndex[index].useElecCost) : 0)
|
|
|
|
+ })
|
|
|
|
+ options.xAxis[0].axisLabel.formatter = function (value) {
|
|
|
|
+ // 按空格分割字符串并换行显示
|
|
|
|
+ return value.split(' ').join('\n');
|
|
|
|
+ }
|
|
|
|
+ this.dtCost = options
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (item.value === '4') {
|
|
|
|
+ const day = item.date()
|
|
|
|
+ const days = DateTool.getMonthOfRange(day, DateTool.now(), DateTool.DateFormat.YYYY_MM);
|
|
|
|
+ const {data: timeElecIndex} = await qryElecMeterByYear(day)
|
|
|
|
+ const {data: timeWaterIndex} = await qryDateWaterMeterByYear(day)
|
|
|
|
+ options.xAxis[0].data = days;
|
|
|
|
+ const indexMap = {
|
|
|
|
+ elec:{},
|
|
|
|
+ water:{}
|
|
|
|
+ }
|
|
|
|
+ timeElecIndex.map((item, index) => {
|
|
|
|
+ indexMap.elec[item.startRecTime] = item.useElecCost
|
|
|
|
+ })
|
|
|
|
+ timeWaterIndex.map((item, index) => {
|
|
|
|
+ indexMap.water[item.startRecTime] = item.useWaterCost
|
|
|
|
+ })
|
|
|
|
+ days.map((item, index) => {
|
|
|
|
+ options.series[0].data.push(indexMap.water[item] ? this.decimalFormat(indexMap.water[item]) : 0)
|
|
|
|
+ options.series[1].data.push(indexMap.elec[item] ? this.decimalFormat(indexMap.elec[item]) : 0)
|
|
})
|
|
})
|
|
options.xAxis[0].axisLabel.formatter = function (value) {
|
|
options.xAxis[0].axisLabel.formatter = function (value) {
|
|
// 按空格分割字符串并换行显示
|
|
// 按空格分割字符串并换行显示
|