feat: edc-web 支持车检器序列号输入与显示

- 自动化测试区域新增「车检器序列号」输入框
- 回车键自动触发「开始」按钮
- /api/automation/start 接收 detector_serial,写入 tb_pending_detector
- 测试操作页 + 测试信息页(全部/B2/B4)显示序列号,空时显示 '-'
- 页面加载和测试结束后焦点自动回到序列号输入框(全选),方便连续测试
This commit is contained in:
wangfq
2026-06-15 10:02:51 +08:00
parent 4ac6cbb2fe
commit 521cbe4107
6 changed files with 73 additions and 6 deletions

View File

@@ -942,3 +942,21 @@ def delete_device_logs(serial: str = "", event_type: str = "",
return cnt
finally:
conn.close()
# ─── tb_pending_detector ───────────────────────────────────────────
def set_pending_detector_serial(dnt_id: int, detector_serial: str):
"""设置待插入的车检器序列号UPSERT"""
conn = get_conn()
try:
with conn.cursor() as cur:
cur.execute(
"""INSERT INTO tb_pending_detector (dnt_id, detector_serial)
VALUES (%s, %s)
ON DUPLICATE KEY UPDATE detector_serial = VALUES(detector_serial)""",
(dnt_id, detector_serial),
)
conn.commit()
finally:
conn.close()