品种增加每点价值字段,PNL计算支持不同品种差异化配置

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-07-28 09:49:37 +08:00
parent 5018eb2083
commit 833491b8d0
8 changed files with 66 additions and 18 deletions
+6 -1
View File
@@ -105,6 +105,10 @@
{% endfor %}
</select>
</div>
<div class="form-group" style="margin-bottom:0;flex:0 0 auto;min-width:80px;">
<label>每点价值</label>
<input type="number" name="point_value" value="20" min="1" required style="font-size:0.9rem;">
</div>
<button type="submit" class="btn btn-primary">新建</button>
</form>
</div>
@@ -112,12 +116,13 @@
{% if products %}
<div class="table-wrap">
<table>
<tr><th>代码</th><th>名称</th><th>交易所</th><th>合约数</th><th>操作</th></tr>
<tr><th>代码</th><th>名称</th><th>交易所</th><th>每点</th><th>合约数</th><th>操作</th></tr>
{% for p in products %}
<tr>
<td><strong>{{ p.code }}</strong></td>
<td>{{ p.name }}</td>
<td>{{ p.exchange }}</td>
<td>{{ p.point_value }}</td>
<td>{{ p.contracts|length }}</td>
<td>
<form method="post" action="/admin/product/{{ p.id }}/delete" onsubmit="return confirm('删除品种 {{ p.code }} 及其所有合约?')" style="display:inline;">