品种管理交易所字段支持中英双语展示,加宽表单面板
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,10 @@
|
||||
</style>
|
||||
|
||||
{% set tab = request.query_params.get('tab', 'sync') %}
|
||||
{% set exchange_names = {} %}
|
||||
{% for ex in exchanges %}
|
||||
{% set _ = exchange_names.update({ex[0]: ex[1]}) %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="tabs">
|
||||
<button class="tab-btn{% if tab == 'sync' %} active{% endif %}" onclick="switchTab('sync')">📡 数据同步</button>
|
||||
@@ -51,7 +55,7 @@
|
||||
onclick="toggleProduct(this)">
|
||||
<span class="collapse-arrow" style="font-size:0.75rem;transition:transform .2s;display:inline-block;transform:rotate(-90deg);">▼</span>
|
||||
<strong style="font-size:0.92rem;">{{ p.code }} · {{ p.name }}</strong>
|
||||
<span style="font-size:0.78rem;color:var(--sub);">{{ p.exchange }}</span>
|
||||
<span style="font-size:0.78rem;color:var(--sub);">{{ exchange_names.get(p.exchange, p.exchange) }}</span>
|
||||
<span style="font-size:0.78rem;color:var(--sub);margin-left:8px;">{{ p.contracts|length }} 合约</span>
|
||||
<form method="post" action="/admin/sync/product/{{ p.id }}" style="display:inline;margin-left:auto;" onclick="event.stopPropagation()">
|
||||
<button type="submit" class="btn" style="font-size:0.78rem;padding:4px 14px;background:var(--accent);color:#fff;border-radius:5px;">同步行情</button>
|
||||
@@ -86,7 +90,7 @@
|
||||
|
||||
{# ═══════════════════ Tab: 品种管理 ═══════════════════ #}
|
||||
<div class="tab-panel{% if tab == 'product' %} active{% endif %}" id="tab-product">
|
||||
<div class="form-card" style="margin-bottom:24px;">
|
||||
<div class="form-card" style="margin-bottom:24px;max-width:720px;">
|
||||
<div class="section-title">新建品种</div>
|
||||
<form method="post" action="/admin/product" style="display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;">
|
||||
<div class="form-group" style="margin-bottom:0;flex:1;min-width:120px;">
|
||||
@@ -97,11 +101,11 @@
|
||||
<label>品种名称</label>
|
||||
<input type="text" name="name" required placeholder="玻璃">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:0;flex:1;min-width:120px;">
|
||||
<div class="form-group" style="margin-bottom:0;flex:1;min-width:200px;">
|
||||
<label>交易所</label>
|
||||
<select name="exchange" required>
|
||||
{% for ex in exchanges %}
|
||||
<option value="{{ ex }}">{{ ex }}</option>
|
||||
<option value="{{ ex[0] }}">{{ ex[1] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
@@ -121,7 +125,7 @@
|
||||
<tr>
|
||||
<td><strong>{{ p.code }}</strong></td>
|
||||
<td>{{ p.name }}</td>
|
||||
<td>{{ p.exchange }}</td>
|
||||
<td>{{ exchange_names.get(p.exchange, p.exchange) }}</td>
|
||||
<td>{{ p.point_value }}</td>
|
||||
<td>{{ p.contracts|length }}</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user