feat: 测试信息增加图表视图(ECharts),表格/图表一键切换

- B2视图:峰峰值/频率/距离/速度 趋势折线图,三Y轴
- B4视图:工作频率/距离/速度 趋势折线图,三Y轴
- dataZoom时间范围缩放,图例可切换系列显隐
- 新增 /api/test-data/chart 接口返回全量数据
This commit is contained in:
wangfq
2026-06-05 11:49:35 +08:00
parent 470c148861
commit 877770aeab
3 changed files with 179 additions and 0 deletions

View File

@@ -37,6 +37,19 @@ def api_test_data():
})
@bp.route("/api/test-data/chart")
def api_chart_data():
"""返回图表所需全部数据(不分页)"""
serial = request.args.get("serial", "", type=str)
date_from = request.args.get("date_from", "", type=str)
date_to = request.args.get("date_to", "", type=str)
test_mode = request.args.get("test_mode", "", type=str)
data_source = request.args.get("data_source", "", type=str)
records = get_all_test_data_for_export(serial, date_from, date_to,
test_mode, data_source)
return jsonify({"records": records, "total": len(records)})
@bp.route("/api/test-data/export")
def api_export():
"""导出测试数据为 CSV"""