feat
This commit is contained in:
@@ -17,6 +17,7 @@ const getDaysInMonth = (date: any) => {
|
||||
const daysInMonth = new Date(year, month, 0).getDate();
|
||||
return Array.from({ length: daysInMonth }, (_, i) => i + 1);
|
||||
};
|
||||
const emit = defineEmits(['getPowerDate']);
|
||||
const getMeterRecordTrend = async (selectedDate: any) => {
|
||||
const res = await meterRecordTrend({
|
||||
day: dayjs().format('YYYY-MM-DD'),
|
||||
@@ -26,7 +27,7 @@ const getMeterRecordTrend = async (selectedDate: any) => {
|
||||
meterId: null,
|
||||
floorId: null,
|
||||
});
|
||||
|
||||
emit('getPowerDate',res);
|
||||
// 处理返回的数据
|
||||
const chartData = res.day.nowMonth.data || [];
|
||||
|
||||
@@ -45,11 +46,11 @@ const getMeterRecordTrend = async (selectedDate: any) => {
|
||||
});
|
||||
renderEcharts({
|
||||
grid: {
|
||||
bottom: 125,
|
||||
bottom: 20,
|
||||
containLabel: true,
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
top: '2%',
|
||||
top: '5%',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -133,6 +134,6 @@ defineExpose({
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<EchartsUI ref="chartRef" />
|
||||
<EchartsUI ref="chartRef" height="190px"/>
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user