Files
vd_test_fixture/edc-web/app/templates/simulate_car.html
wangfq 431653d033 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 线圈/车辆信息
2026-06-08 10:42:13 +08:00

91 lines
3.3 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% 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="car-table">
<thead>
<tr>
<th>模拟编号</th>
<th>名称</th>
<th>形状</th>
<th>尺寸 (cm)</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-simulate-num">
</div>
<div class="form-group">
<label>名称</label>
<input type="text" id="edit-name">
</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="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/simulate_car.js') }}"></script>
{% endblock %}