Prevent band input from triggering refresh

This commit is contained in:
2026-06-10 18:41:23 +08:00
parent e101f6120c
commit 1c25681d8d
2 changed files with 31 additions and 11 deletions
+15 -5
View File
@@ -490,14 +490,14 @@ svg {{ width:100%; height:230px; display:block; }}
<label class="ctrl">维度 <select id="dim"><option>全部</option></select></label>
<label class="ctrl">板块 <select id="board"><option>全部</option></select></label>
<label class="ctrl">窗口 <input class="mini" id="bandWindow" type="number" min="3" max="90" step="1" value="15"></label>
<label class="ctrl">倍数 <input class="mini" id="bandK" type="number" min="0.5" max="6" step="0.5" value="3"></label>
<label class="ctrl">带宽 <input class="mini" id="bandK" type="number" min="0.5" max="6" step="0.5" value="3"></label>
<label class="ctrl">去尾 <input class="mini" id="bandTrim" type="number" min="0" max="40" step="5" value="10"></label>
<label class="ctrl">图始 <select id="chartStartYear"></select></label>
<label class="ctrl"><input id="includeDemand" type="checkbox" checked>需求计分</label>
<button class="tabbtn active" id="dashboardTab">面板</button>
<button class="tabbtn" id="historyTab">评分走势</button>
<button id="refreshData">刷新数据</button>
<button id="reset">重置</button>
<button type="button" class="tabbtn active" id="dashboardTab">面板</button>
<button type="button" class="tabbtn" id="historyTab">评分走势</button>
<button type="button" id="refreshData">刷新数据</button>
<button type="button" id="reset">重置</button>
<div class="stamp">完成度:<span id="completion"></span></div>
</div>
<section class="summary">
@@ -590,6 +590,16 @@ dashboardTab.onclick = () => {{ activeView="dashboard"; dashboardTab.classList.a
historyTab.onclick = () => {{ activeView="history"; historyTab.classList.add("active"); dashboardTab.classList.remove("active"); render(); }};
refreshData.onclick = refreshFromLocalProgram;
search.oninput = dimSel.onchange = boardSel.onchange = bandWindow.oninput = bandK.oninput = bandTrim.oninput = chartStartYear.onchange = includeDemand.onchange = historyStart.onchange = historyEnd.onchange = render;
[bandWindow, bandK, bandTrim].forEach(input => {{
input.addEventListener("keydown", ev => {{
if (ev.key === "Enter") {{
ev.preventDefault();
ev.stopPropagation();
input.blur();
render();
}}
}});
}});
function fmt(v, n=1) {{ return v == null || Number.isNaN(v) ? "--" : Number(v).toFixed(n); }}
function matches(c) {{