From f1b8fedbe35bf8fa5e697c31cf49bff5c8d2d7de Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期二, 08 九月 2026 23:33:15 +0800
Subject: [PATCH] 更新
---
src/components/ConsoleChartPanel.vue | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/components/ConsoleChartPanel.vue b/src/components/ConsoleChartPanel.vue
index 11b3ba1..d8b8d02 100644
--- a/src/components/ConsoleChartPanel.vue
+++ b/src/components/ConsoleChartPanel.vue
@@ -408,13 +408,14 @@
const source = selectedRecords()
const cellIndexes = selectedCells.value.map(cell => props.cells.findIndex(item => item.no === cell.no))
const seriesData = selectedCells.value.map(cell => {
- return source.filter(record => record.batteryNo === cell.no && metricMatches(metric.key, record))
+ const points = source.filter(record => record.batteryNo === cell.no && metricMatches(metric.key, record))
.map(record => ({ time: recordTime(record), value: metricValue(metric.key, record) }))
.filter(point => point.time !== null && Number.isFinite(point.value))
.sort((a, b) => (a.time as number) - (b.time as number))
+ const zero = points[0]?.time
+ return points.map(point => ({ ...point, time: zero == null ? null : (point.time as number) - zero }))
})
const timestamps = [...new Set(seriesData.flat().map(point => point.time as number))].sort((a, b) => a - b)
- const start = timestamps[0]
const values = seriesData.flat().map(point => point.value)
const dataMin = values.length ? Math.min(...values) : 0
const dataMax = values.length ? Math.max(...values) : 1
@@ -457,7 +458,7 @@
name: '设备时间',
nameLocation: 'middle',
nameGap: 29,
- data: timestamps.map(value => start == null ? new Date(value).toISOString() : `${((value - start) / 3600000).toFixed(3)} h`),
+ data: timestamps.map(value => `${(value / 3600000).toFixed(3)} h`),
axisLine: { lineStyle: { color: '#cbd8e4' } },
axisLabel: { color: '#8795a3', fontSize: 10, interval: 4 },
nameTextStyle: { color: '#52606d', fontSize: 10 },
--
Gitblit v1.7.1