From 3681b1d173f8f5f43428613a3b72bcb33146c5e3 Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 26 Mar 2025 14:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B6=8B=E5=8A=BF=E5=9B=BE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=8A=A0=E5=85=A5=E4=BA=86=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=95=B0=E6=8D=AE=E5=BA=93=EF=BC=8C=E5=88=86=E6=9E=90?= =?UTF-8?q?=E7=BE=A4=E8=81=8A=E8=81=8A=E5=A4=A9=E6=95=B0=E9=87=8F=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats_dashboard/templates/robot_management.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/stats_dashboard/templates/robot_management.html b/plugins/stats_dashboard/templates/robot_management.html index 56146a3..1a04ce3 100644 --- a/plugins/stats_dashboard/templates/robot_management.html +++ b/plugins/stats_dashboard/templates/robot_management.html @@ -151,7 +151,7 @@

消息数量趋势

- +
@@ -452,11 +452,11 @@ renderTrendChart(data) { try { - // 获取Canvas元素 - const canvas = document.getElementById('messageTrendChart'); + // 使用Vue的ref获取Canvas元素 + const canvas = this.$refs.messageTrendChart; if (!canvas) { - console.error('找不到Canvas元素,ID: messageTrendChart'); + console.error('找不到Canvas元素,ref: messageTrendChart'); this.$message.error('无法找到图表元素,请尝试重新打开对话框'); this.trendLoading = false; return; @@ -475,8 +475,8 @@ } // 准备数据 - const labels = data.dates; - const messageData = data.counts.map(count => parseInt(count) || 0); + const labels = data.dates || []; + const messageData = (data.counts || []).map(count => parseInt(count) || 0); // 创建新图表 this.charts.trendChart = new Chart(ctx, {