feat(edc-web): 线圈参数/模拟车辆参数管理 + 工装关联 + 测试环境显示

新增功能:
- 线圈参数管理页 (/coil-info): 增删改查,日志记录
- 模拟车辆管理页 (/simulate-car): 增删改查,日志记录
- 工装配置页新增线圈/模拟车辆选择区,保存时关联到 tb_fixture_param
- 测试信息查询页新增「测试环境」列,显示当前线圈和模拟车辆信息
- edc_server 写入测试数据时自动从 fixture 获取线圈/车辆关联

数据库:
- 新增 tb_coil_info、tb_simulate_car 表
- tb_fixture_param 增加 coil_id/simulate_car_id 字段
- tb_state_tst 增加 coil_id/simulate_car_id 字段

后端:
- models.py 新增线圈/模拟车辆 CRUD
- get_fixture_param 改为 LEFT JOIN 返回线圈/车辆详情
- upsert_fixture_param 支持 coil_id/simulate_car_id
- 测试数据查询 LEFT JOIN 线圈/车辆信息
This commit is contained in:
wangfq
2026-06-08 10:42:13 +08:00
parent e538efafb5
commit 431653d033
10 changed files with 1085 additions and 25 deletions

View File

@@ -0,0 +1,105 @@
{% extends "base.html" %}
{% block title %}线圈参数管理 - EDC 工装管理系统{% endblock %}
{% block content %}
<div class="test-header">
<a href="/">← 返回设备列表</a>
<h2>线圈参数管理</h2>
</div>
<div class="fixture-card">
<div class="vbt-header">
<div style="display:flex; gap:8px; align-items:center;">
<input type="text" id="search-input" placeholder="搜索编号/名称..."
style="padding:6px 10px; border:1px solid #ddd; border-radius:4px; font-size:13px; width:200px;"
oninput="loadList()">
</div>
<button class="btn-add" onclick="openModal()">+ 新增</button>
</div>
<table id="coil-table">
<thead>
<tr>
<th>线圈编号</th>
<th>名称</th>
<th>电感量</th>
<th>形状</th>
<th>尺寸 (cm)</th>
<th>圈数</th>
<th>电阻 (Ω)</th>
<th>材质</th>
<th>备注</th>
<th>操作</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- 编辑弹窗 -->
<div id="edit-modal" class="modal-overlay" style="display:none;" onclick="if(event.target===this)closeModal()">
<div class="modal-box">
<h3 id="modal-title">新增线圈参数</h3>
<div class="modal-form">
<div class="form-group">
<label>线圈编号 *</label>
<input type="text" id="edit-coil-num">
</div>
<div class="form-group">
<label>名称</label>
<input type="text" id="edit-name">
</div>
<div class="form-group">
<label>电感量</label>
<input type="number" id="edit-induct" step="0.01" value="0">
</div>
<div class="form-group">
<label>形状</label>
<select id="edit-shape">
<option value="">-- 请选择 --</option>
<option value="矩形">矩形</option>
<option value="圆形">圆形</option>
</select>
</div>
<div class="form-group">
<label>长度 (cm矩形有效)</label>
<input type="number" id="edit-length" step="0.1" value="0">
</div>
<div class="form-group">
<label>宽度 (cm矩形有效)</label>
<input type="number" id="edit-width" step="0.1" value="0">
</div>
<div class="form-group">
<label>半径 (cm圆形有效)</label>
<input type="number" id="edit-radius" step="0.1" value="0">
</div>
<div class="form-group">
<label>圈数</label>
<input type="number" id="edit-turns" value="0">
</div>
<div class="form-group">
<label>电阻 (Ω)</label>
<input type="number" id="edit-resistance" step="0.01" value="0">
</div>
<div class="form-group">
<label>材质</label>
<input type="text" id="edit-material" placeholder="如铜线">
</div>
<div class="form-group full">
<label>备注</label>
<textarea id="edit-remark" rows="2" style="resize:vertical;"></textarea>
</div>
</div>
<div class="modal-actions">
<button class="btn-cancel" onclick="closeModal()">取消</button>
<button class="btn-save" onclick="saveRecord()">保存</button>
</div>
</div>
</div>
<div id="toast" class="msg-toast"></div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/coil_info.js') }}"></script>
{% endblock %}