复盘盈亏比自动计算与K线自动生成;居中页头导航

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 12:58:24 +08:00
parent 105f630388
commit a35a08d2f6
10 changed files with 352 additions and 56 deletions
+25 -23
View File
@@ -8,17 +8,16 @@
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#0a0a10;color:#eaeaea;min-height:100vh}
.page-wrap{max-width:1800px;margin:0 auto;min-height:100vh}
.topbar{background:#12121a;border-bottom:1px solid #242435;padding:0 1.5rem}
.topbar-inner{display:flex;align-items:center;gap:1.5rem;height:56px}
.logo{font-size:1.05rem;font-weight:600;background:linear-gradient(90deg,#4cc2ff,#7b42ff);-webkit-background-clip:text;-webkit-text-fill-color:transparent;white-space:nowrap}
.nav{display:flex;gap:.25rem;flex:1;flex-wrap:wrap}
.nav a{padding:.5rem 1rem;color:#a9a9c4;text-decoration:none;font-size:.9rem;border-radius:8px;transition:.2s}
.nav a:hover{color:#fff;background:#1a1a29}
.nav a.active{color:#4cc2ff;background:#1a1a29}
.user-bar{font-size:.85rem;color:#888;white-space:nowrap}
.site-header{text-align:center;padding:1.5rem 1rem 1.25rem;border-bottom:1px solid #1a1a28;position:relative}
.site-title{font-size:1.75rem;font-weight:700;color:#fff;margin-bottom:.55rem;line-height:1.3}
.site-badge{display:inline-block;padding:.22rem .85rem;border-radius:999px;border:1px solid #2d6a4f;background:#0d2818;color:#4cd97f;font-size:.75rem;margin-bottom:1.15rem}
.site-nav{display:flex;justify-content:center;gap:.45rem;flex-wrap:wrap}
.site-nav a{padding:.55rem 1.15rem;border-radius:8px;border:1px solid #2a2a40;background:#161625;color:#e8e8f0;text-decoration:none;font-size:.88rem;transition:.2s;white-space:nowrap}
.site-nav a:hover{background:#1e2533;border-color:#3a3a55;color:#fff}
.site-nav a.active{background:#2d5aa8;border-color:#3d6ec4;color:#fff}
.user-bar{position:absolute;top:1rem;right:1.5rem;font-size:.8rem;color:#888;white-space:nowrap}
.user-bar a{color:#ff6666;text-decoration:none;margin-left:.5rem}
.main{padding:1.5rem}
.page-title{font-size:1.5rem;margin-bottom:1.5rem;color:#fff}
.flash{padding:1rem;background:#1e2533;color:#4cc2ff;border-radius:10px;margin-bottom:1.5rem;text-align:center}
.card{background:#12121a;border-radius:16px;padding:1.5rem;border:1px solid #242435;margin-bottom:1.5rem}
.card h2{font-size:1.15rem;margin-bottom:1rem;color:#c4c4ff;display:flex;align-items:center;gap:.5rem}
@@ -26,6 +25,7 @@
.form-row{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem;align-items:center}
.form-compact{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem}
.form-compact .form-line{display:grid;gap:.5rem;align-items:center}
.form-compact .line-2{grid-template-columns:repeat(2,1fr)}
.form-compact .line-3{grid-template-columns:repeat(3,1fr)}
.form-compact .line-4{grid-template-columns:repeat(4,1fr)}
.form-compact .line-5{grid-template-columns:repeat(5,1fr)}
@@ -110,26 +110,28 @@
.split-grid .card{min-height:auto}
}
@media(max-width:768px){
.topbar-inner{flex-wrap:wrap;height:auto;padding:.75rem 0}
.nav{order:3;width:100%}
.site-header{padding:1.25rem .75rem 1rem}
.site-title{font-size:1.35rem}
.user-bar{position:static;text-align:center;margin-bottom:.75rem}
.site-nav{gap:.35rem}
.site-nav a{padding:.45rem .75rem;font-size:.82rem}
}
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
<div class="page-wrap">
<header class="topbar">
<div class="topbar-inner">
<div class="logo">期货监控复盘</div>
<nav class="nav">
<a href="{{ url_for('plans') }}" class="{% if request.endpoint == 'plans' %}active{% endif %}">开单计划</a>
<a href="{{ url_for('keys') }}" class="{% if request.endpoint == 'keys' %}active{% endif %}">关键位监控</a>
<a href="{{ url_for('records') }}" class="{% if request.endpoint == 'records' %}active{% endif %}">交易记录与复盘</a>
<a href="{{ url_for('stats') }}" class="{% if request.endpoint == 'stats' %}active{% endif %}">统计分析</a>
<a href="{{ url_for('settings') }}" class="{% if request.endpoint == 'settings' %}active{% endif %}">系统设置</a>
</nav>
<div class="user-bar">{{ session.username or '用户' }}<a href="{{ url_for('logout') }}">退出</a></div>
</div>
<header class="site-header">
<div class="user-bar">{{ session.username or '用户' }}<a href="{{ url_for('logout') }}">退出</a></div>
<h1 class="site-title">国内期货 | 交易监控 + 复盘一体化</h1>
<div class="site-badge">新浪行情</div>
<nav class="site-nav">
<a href="{{ url_for('plans') }}" class="{% if request.endpoint == 'plans' %}active{% endif %}">开单计划</a>
<a href="{{ url_for('keys') }}" class="{% if request.endpoint == 'keys' %}active{% endif %}">关键位监控</a>
<a href="{{ url_for('records') }}" class="{% if request.endpoint == 'records' %}active{% endif %}">交易记录与复盘</a>
<a href="{{ url_for('stats') }}" class="{% if request.endpoint == 'stats' %}active{% endif %}">统计分析</a>
<a href="{{ url_for('settings') }}" class="{% if request.endpoint == 'settings' %}active{% endif %}">系统设置</a>
</nav>
</header>
<main class="main">
{% with msg=get_flashed_messages() %}{% if msg %}<div class="flash">{{ msg[0] }}</div>{% endif %}{% endwith %}
-2
View File
@@ -1,8 +1,6 @@
{% extends "base.html" %}
{% block title %}关键位监控 - 国内期货监控系统{% endblock %}
{% block content %}
<h1 class="page-title">关键位监控</h1>
<div class="split-grid">
<div class="card">
<h2>新增监控</h2>
+1 -3
View File
@@ -1,11 +1,9 @@
{% extends "base.html" %}
{% block title %}开单计划 - 国内期货监控系统{% endblock %}
{% block content %}
<h1 class="page-title">开单计划 <span style="font-size:.9rem;color:#888;font-weight:normal">今日 {{ today }}</span></h1>
<div class="split-grid">
<div class="card">
<h2>今日计划</h2>
<h2>今日计划 <span style="font-size:.8rem;color:#888;font-weight:normal">今日 {{ today }}</span></h2>
<div class="card-body">
<p class="hint" style="margin-bottom:.75rem">开盘前制定,当日有效;下方为进行中计划。</p>
<form action="{{ url_for('add_plan') }}" method="post" class="form-compact">
+5 -9
View File
@@ -1,8 +1,6 @@
{% extends "base.html" %}
{% block title %}交易记录与复盘 - 国内期货监控系统{% endblock %}
{% block content %}
<h1 class="page-title page-title-sm">交易记录与复盘</h1>
<div class="split-grid records-split">
<div class="card">
<h2>复盘上传</h2>
@@ -30,11 +28,9 @@
<input id="holding_duration" type="text" readonly class="calc-readonly" placeholder="持仓时长(自动)">
<input name="pnl" type="number" step="0.01" placeholder="盈亏金额(手动)">
</div>
<div class="form-line line-4">
<input id="initial_pnl" type="text" readonly class="calc-readonly" placeholder="初始盈亏(自动)">
<input id="actual_pnl" type="text" readonly class="calc-readonly" placeholder="实际盈亏(自动)">
<input name="expected_rr" type="number" step="0.01" placeholder="预期RR">
<input name="actual_rr" type="number" step="0.01" placeholder="实际RR">
<div class="form-line line-2">
<input id="initial_rr" type="text" readonly class="calc-readonly" placeholder="初始盈亏(自动)">
<input id="actual_rr" type="text" readonly class="calc-readonly" placeholder="实际盈亏(自动)">
</div>
<div class="form-line line-4">
<select name="open_type" required>
@@ -61,7 +57,7 @@
<button type="submit" class="btn-primary">保存</button>
</div>
<div class="kline-row">
<label><input type="checkbox" name="auto_kline" value="1"> 自动K线</label>
<label><input type="checkbox" name="auto_kline" value="1" checked> 自动K线</label>
<select name="kline_period1" title="周期1">{% for p in kline_periods %}<option value="{{ p }}" {% if p=='15m' %}selected{% endif %}>{{ p }}</option>{% endfor %}</select>
<select name="kline_period2" title="周期2">{% for p in kline_periods %}<option value="{{ p }}" {% if p=='1h' %}selected{% endif %}>{{ p }}</option>{% endfor %}</select>
<input name="kline_count" type="number" value="300" placeholder="K线数" title="K线数">
@@ -121,7 +117,7 @@
"open_time": r.open_time, "close_time": r.close_time,
"holding_duration": r.holding_duration, "initial_pnl": r.initial_pnl,
"actual_pnl": r.actual_pnl, "pnl": r.pnl,
"open_type": r.open_type, "expected_rr": r.expected_rr, "actual_rr": r.actual_rr,
"open_type": r.open_type,
"exit_trigger": r.exit_trigger, "exit_supplement": r.exit_supplement,
"is_emotion": r.is_emotion, "behavior_tags": r.behavior_tags,
"notes": r.notes, "screenshot": r.screenshot
-1
View File
@@ -1,7 +1,6 @@
{% extends "base.html" %}
{% block title %}系统设置 - 国内期货监控系统{% endblock %}
{% block content %}
<h1 class="page-title">系统设置</h1>
<div class="card">
<h2>行情说明</h2>
-1
View File
@@ -1,7 +1,6 @@
{% extends "base.html" %}
{% block title %}统计分析 - 国内期货监控系统{% endblock %}
{% block content %}
<h1 class="page-title">统计分析</h1>
<div class="stat-grid">
<div class="stat-item"><div class="label">总交易</div><div class="value">{{ total }}</div></div>