From c7043c13b0f101158dd7942021b9e838350e4ffe Mon Sep 17 00:00:00 2001 From: zhaojie <17108846169@qq.com> Date: Wed, 10 Sep 2025 23:19:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=86=E6=9E=90=E9=A1=B5=E9=9D=A2JavaScript=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加缺失的updateAnalyticsReport函数 - 完善分析报告显示功能 - 修复图表更新失败的问题 --- src/web/static/js/dashboard.js | 159 +++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) diff --git a/src/web/static/js/dashboard.js b/src/web/static/js/dashboard.js index 270affa..8818208 100644 --- a/src/web/static/js/dashboard.js +++ b/src/web/static/js/dashboard.js @@ -2009,6 +2009,165 @@ class TSPDashboard { window.print(); } + // 更新分析报告 + updateAnalyticsReport(data) { + const reportContainer = document.getElementById('analytics-report'); + + if (!reportContainer) return; + + const summary = data.summary || {}; + const workorders = data.workorders || {}; + const satisfaction = data.satisfaction || {}; + const alerts = data.alerts || {}; + const performance = data.performance || {}; + + const reportHtml = ` +
| 总工单数 | +${workorders.total || 0} | +
| 待处理 | +${workorders.open || 0} | +
| 处理中 | +${workorders.in_progress || 0} | +
| 已解决 | +${workorders.resolved || 0} | +
| 已关闭 | +${workorders.closed || 0} | +
| 平均满意度 | +${satisfaction.average || 0}/5.0 | +
| 5星评价 | +${satisfaction.distribution?.['5'] || 0} 个 | +
| 4星评价 | +${satisfaction.distribution?.['4'] || 0} 个 | +
| 3星评价 | +${satisfaction.distribution?.['3'] || 0} 个 | +
| 2星及以下 | +${(satisfaction.distribution?.['2'] || 0) + (satisfaction.distribution?.['1'] || 0)} 个 | +
| 总预警数 | +${alerts.total || 0} | +
| 活跃预警 | +${alerts.active || 0} | +
| 已解决 | +${alerts.resolved || 0} | +
| 响应时间 | +${performance.response_time || 0} 秒 | +
| 系统可用性 | +${performance.uptime || 0}% | +
| 错误率 | +${performance.error_rate || 0}% | +
| 吞吐量 | +${performance.throughput || 0} 请求/小时 | +
解决率
+平均满意度
+活跃预警
+总工单数
+