Files
qihuo/templates/fees.html
T

68 lines
4.3 KiB
HTML
Raw 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 %}手续费配置 - 国内期货监控系统{% endblock %}
{% block content %}
<div class="card">
<h2>手续费倍率</h2>
<div class="card-body">
<form action="{{ url_for('fees') }}" method="post" class="form-row">
<input type="hidden" name="action" value="multiplier">
<label class="text-muted" style="font-size:.85rem">第三方标准费率 ×</label>
<input name="fee_multiplier" type="number" step="0.1" min="0" value="{{ multiplier }}" style="width:100px">
<button type="submit" class="btn-primary">保存倍率</button>
</form>
<p class="hint">默认 2 倍:从第三方拉取交易所参考标准后自动乘以该倍率写入本地表。模拟盘估算用,非实盘账单。</p>
<div class="form-row" style="margin-top:.75rem">
<form action="{{ url_for('fees') }}" method="post" style="display:inline">
<input type="hidden" name="action" value="sync">
<button type="submit" class="btn-primary">从第三方同步(AKShare</button>
</form>
<form action="{{ url_for('fees') }}" method="post" style="display:inline">
<input type="hidden" name="action" value="reload_json">
<button type="submit" class="btn-link" style="padding:.5rem 1rem;border:1px solid var(--card-border);border-radius:8px">重载本地 JSON 默认表</button>
</form>
</div>
</div>
</div>
<div class="card">
<h2>品种费率表(已含倍率)</h2>
<div class="card-body card-scroll">
<table class="trade-table">
<thead>
<tr>
<th>品种</th><th>交易所</th><th>乘数</th>
<th>开仓(元/手)</th><th>开仓(比例)</th>
<th>平昨(元/手)</th><th>平昨(比例)</th>
<th>平今(元/手)</th><th>平今(比例)</th>
<th>更新</th><th>操作</th>
</tr>
</thead>
<tbody>
{% for r in rates %}
<tr>
<form action="{{ url_for('fees') }}" method="post" style="display:contents">
<input type="hidden" name="action" value="save_row">
<input type="hidden" name="product" value="{{ r.product }}">
<td><strong>{{ r.product }}</strong></td>
<td><input name="exchange" value="{{ r.exchange or '' }}" style="width:72px;padding:.3rem"></td>
<td><input name="mult" type="number" value="{{ r.mult }}" style="width:56px;padding:.3rem"></td>
<td><input name="open_fixed" type="number" step="0.0001" value="{{ r.open_fixed }}" style="width:72px;padding:.3rem"></td>
<td><input name="open_ratio" type="number" step="0.0000001" value="{{ r.open_ratio }}" style="width:88px;padding:.3rem"></td>
<td><input name="close_yesterday_fixed" type="number" step="0.0001" value="{{ r.close_yesterday_fixed }}" style="width:72px;padding:.3rem"></td>
<td><input name="close_yesterday_ratio" type="number" step="0.0000001" value="{{ r.close_yesterday_ratio }}" style="width:88px;padding:.3rem"></td>
<td><input name="close_today_fixed" type="number" step="0.0001" value="{{ r.close_today_fixed }}" style="width:72px;padding:.3rem"></td>
<td><input name="close_today_ratio" type="number" step="0.0000001" value="{{ r.close_today_ratio }}" style="width:88px;padding:.3rem"></td>
<td class="text-muted" style="font-size:.72rem">{{ (r.updated_at or '')[:16] }}</td>
<td><button type="submit" class="btn-link">保存</button></td>
</form>
</tr>
{% else %}
<tr><td colspan="11" class="text-muted">暂无费率,请同步或重载 JSON</td></tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="hint" style="margin-top:.75rem">比例按「成交价×乘数×手数×比例」计费;元/手为固定每手。开+平合计为一笔往返手续费。</p>
</div>
{% endblock %}