交易记录拆分为持仓和已平仓两个子页面

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-26 11:03:45 +08:00
parent 4724741fdd
commit 5dd58b8297
2 changed files with 41 additions and 10 deletions
+19 -3
View File
@@ -59,6 +59,11 @@
border-left-color: var(--accent); font-weight: 600;
}
.sidebar-nav .icon { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-group .nav-arrow { font-size: 0.65rem; margin-left: auto; transition: transform .2s; color: var(--sub); }
.nav-group.open .nav-arrow { transform: rotate(-180deg); }
.nav-group .nav-children { display: none; }
.nav-group.open .nav-children { display: block; }
.nav-children a { padding-left: 48px !important; font-size: 0.84rem !important; }
.sidebar-footer {
padding: 16px 20px; border-top: 1px solid var(--border);
}
@@ -201,9 +206,20 @@
<a href="/positions/" class="{% if active_nav == 'positions' %}active{% endif %}">
<span class="icon">📐</span> 仓位管理
</a>
<a href="/trades/" class="{% if active_nav == 'trades' %}active{% endif %}">
<span class="icon">📝</span> 交易记录
</a>
<div class="nav-group{% if active_nav == 'trades' %} open{% endif %}" id="nav-trades">
<a class="nav-parent{% if active_nav == 'trades' %} active{% endif %}" onclick="toggleNavGroup(event, 'nav-trades')" href="#">
<span class="icon">📝</span> 交易记录
<span class="nav-arrow"></span>
</a>
<div class="nav-children">
<a href="/trades/" class="{% if active_nav == 'trades' and not request.query_params.get('view') %}active{% endif %}">
<span class="icon">📋</span> 持仓
</a>
<a href="/trades/?view=closed" class="{% if request.query_params.get('view') == 'closed' %}active{% endif %}">
<span class="icon">📊</span> 已平仓
</a>
</div>
</div>
<a href="/admin/" class="{% if active_nav == 'admin' %}active{% endif %}">
<span class="icon">⚙️</span> 系统管理
</a>