This commit is contained in:
FLL
2025-09-11 16:17:05 +08:00
parent 60eed1ab12
commit fd01748a4f
3 changed files with 130 additions and 361 deletions

View File

@@ -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>