完成水电表列表

This commit is contained in:
Zy
2026-04-18 18:14:07 +08:00
parent 9a95e2b7e3
commit d0888c6afb
115 changed files with 2842 additions and 343 deletions

View File

@@ -1,15 +1,7 @@
<script name="repairEcharts" setup lang="ts">
import Echarts from '@/components/Echarts/index.vue';
import { getLast7Days } from '@/utils/time';
import { EChartsOption } from 'echarts';
// 生成过去7天的日期
const getLast7Days = (days = 7) => {
const dates = [];
for (let i = days - 1; i >= 0; i--) {
dates.push(new Date(new Date().getTime() - i * 24 * 60 * 60 * 1000).toLocaleDateString());
}
return dates;
};
const chartConfig = shallowRef<EChartsOption>({
grid: {
left: '1%',
@@ -24,11 +16,15 @@ const chartConfig = shallowRef<EChartsOption>({
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis'
},
series: [
{
data: [5, 92, 12, 34, 120, 10, 120],
data: [100, 140, 230, 100, 130, 180, 173],
type: 'line',
smooth: true,
name: '维修单数',
areaStyle: {
color: {
type: 'linear',
@@ -45,32 +41,14 @@ const chartConfig = shallowRef<EChartsOption>({
lineStyle: {
color: '#1a75ff'
},
itemStyle: {
color: '#1a75ff'
},
label: {
show: true,
color: '#3f8afc',
position: 'top'
}
},
{
data: [5, 92, 12, 34, 120, 10, 120].reverse(),
type: 'line',
smooth: true,
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1, // 从上到下渐变
colorStops: [
{ offset: 0, color: '#e2edff' }, // 顶部:半透明蓝色
{ offset: 1, color: '#f2f9ff' } // 底部:极浅蓝/透明
]
}
},
lineStyle: {
color: '#ffc800'
}
}
]
});