修正统计分析
This commit is contained in:
@@ -725,12 +725,21 @@
|
||||
<div class="stat-item"><div class="label">持仓占用导致错过(累计)</div><div class="value">{{ occupied_miss_total }}</div></div>
|
||||
</div>
|
||||
<div class="sub" style="margin-bottom:12px;color:#8892b0;font-size:.82rem">
|
||||
统计分析按<strong>北京时间 {{ stats_bundle.stats_reset_hour }}:00</strong>切日计入;下列为各品类已平仓。历史总开仓(累计):
|
||||
统计分析按<strong>北京时间 {{ stats_bundle.stats_reset_hour }}:00</strong>切日计入(与顶栏 UTC 列表窗无关)。历史总开仓(累计):
|
||||
<strong style="color:#cfd3ef">{{ stats_bundle.total_opens_all }}</strong> 次
|
||||
</div>
|
||||
<div class="form-row" style="margin-bottom:14px;align-items:center">
|
||||
<label style="display:flex;align-items:center;gap:8px;font-size:.88rem;color:#cfd3ef">
|
||||
统计品类
|
||||
<select id="stats-segment-select" onchange="switchStatsSegment()" style="min-width:200px">
|
||||
{% for seg in stats_bundle.segments %}
|
||||
<option value="{{ seg.key }}">{{ seg.title }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
{% for seg in stats_bundle.segments %}
|
||||
<div class="stats-segment-block">
|
||||
<h2>{{ seg.title }}</h2>
|
||||
<div class="stats-segment-block stats-segment-panel" data-stats-segment="{{ seg.key }}"{% if not loop.first %} style="display:none"{% endif %}>
|
||||
{{ period_stats("日统计", seg.day) }}
|
||||
{{ period_stats("周统计", seg.week) }}
|
||||
{{ period_stats("月统计", seg.month) }}
|
||||
@@ -1286,6 +1295,29 @@ function recomputeJournalRealRr(){
|
||||
}
|
||||
|
||||
|
||||
function switchStatsSegment(){
|
||||
const sel = document.getElementById("stats-segment-select");
|
||||
if(!sel) return;
|
||||
const key = sel.value;
|
||||
document.querySelectorAll(".stats-segment-panel").forEach(p=>{
|
||||
p.style.display = p.getAttribute("data-stats-segment") === key ? "block" : "none";
|
||||
});
|
||||
const q = new URLSearchParams(window.location.search);
|
||||
q.set("stats_segment", key);
|
||||
const qs = q.toString();
|
||||
history.replaceState(null, "", qs ? (window.location.pathname + "?" + qs) : window.location.pathname);
|
||||
}
|
||||
|
||||
function initStatsSegmentFromUrl(){
|
||||
const sel = document.getElementById("stats-segment-select");
|
||||
if(!sel) return;
|
||||
const key = new URLSearchParams(window.location.search).get("stats_segment");
|
||||
if(key && sel.querySelector('option[value="' + key.replace(/"/g, "") + '"]')){
|
||||
sel.value = key;
|
||||
}
|
||||
switchStatsSegment();
|
||||
}
|
||||
|
||||
function toggleStatsCard(){
|
||||
const card = document.getElementById("stats-card");
|
||||
const btn = document.getElementById("stats-toggle-btn");
|
||||
@@ -1296,6 +1328,7 @@ function toggleStatsCard(){
|
||||
|
||||
attachListWindowToExports();
|
||||
toggleListWindowCustom();
|
||||
initStatsSegmentFromUrl();
|
||||
if(document.getElementById("journal-list")) loadJournals();
|
||||
if(document.getElementById("review-list")) loadReviews();
|
||||
const reviewToggle = document.getElementById("review-mode-toggle");
|
||||
|
||||
Reference in New Issue
Block a user