增加导航栏
This commit is contained in:
@@ -737,13 +737,17 @@ function wireKeyMonitorSegGroup(groupId, hiddenInputId, onChange) {
|
|||||||
|
|
||||||
function initKeyMonitorSegGroups() {
|
function initKeyMonitorSegGroups() {
|
||||||
wireKeyMonitorSegGroup("keyMonitorTypeSeg", "keyMonitorTypeInput");
|
wireKeyMonitorSegGroup("keyMonitorTypeSeg", "keyMonitorTypeInput");
|
||||||
wireKeyMonitorSegGroup("keyDirectionSeg", "keyDirectionInput");
|
}
|
||||||
wireKeyMonitorSegGroup("keySlTpModeSeg", "keySlTpModeInput", syncKeySlTpFields);
|
|
||||||
|
function setKeyMonitorActiveCount(n) {
|
||||||
|
const el = document.getElementById("keyMonitorActiveCount");
|
||||||
|
if (el) el.textContent = String(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderKeyMonitorActiveList(rows) {
|
function renderKeyMonitorActiveList(rows) {
|
||||||
const target = document.getElementById("keyMonitorActive");
|
const target = document.getElementById("keyMonitorActive");
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
setKeyMonitorActiveCount(rows.length);
|
||||||
target.innerHTML = "";
|
target.innerHTML = "";
|
||||||
if (!rows.length) {
|
if (!rows.length) {
|
||||||
target.innerHTML = '<div class="matrix-dim">暂无监控中的关键位</div>';
|
target.innerHTML = '<div class="matrix-dim">暂无监控中的关键位</div>';
|
||||||
@@ -836,6 +840,8 @@ async function addKeyMonitor() {
|
|||||||
|
|
||||||
function wireKeyMonitorPanel() {
|
function wireKeyMonitorPanel() {
|
||||||
initKeyMonitorSegGroups();
|
initKeyMonitorSegGroups();
|
||||||
|
const modeSel = document.getElementById("keySlTpModeInput");
|
||||||
|
if (modeSel) modeSel.addEventListener("change", syncKeySlTpFields);
|
||||||
syncKeySlTpFields();
|
syncKeySlTpFields();
|
||||||
const addBtn = document.getElementById("keyAddBtn");
|
const addBtn = document.getElementById("keyAddBtn");
|
||||||
if (addBtn) addBtn.addEventListener("click", addKeyMonitor);
|
if (addBtn) addBtn.addEventListener("click", addKeyMonitor);
|
||||||
|
|||||||
@@ -1298,6 +1298,26 @@ pre {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.key-monitor-active-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key-monitor-count {
|
||||||
|
font-size: 10px;
|
||||||
|
padding: 2px 8px;
|
||||||
|
min-width: 1.5rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key-monitor-active-list {
|
||||||
|
max-height: calc(8 * 52px + 7 * 8px);
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
.key-monitor-row {
|
.key-monitor-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -1781,6 +1801,10 @@ body.matrix-theme {
|
|||||||
font-size: 8px;
|
font-size: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.key-monitor-active-list {
|
||||||
|
max-height: calc(8 * 48px + 7 * 8px);
|
||||||
|
}
|
||||||
|
|
||||||
.matrix-grid {
|
.matrix-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,18 +141,17 @@
|
|||||||
<button type="button" class="matrix-seg-btn" data-value="收敛突破">收敛</button>
|
<button type="button" class="matrix-seg-btn" data-value="收敛突破">收敛</button>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" id="keyMonitorTypeInput" value="箱体突破" />
|
<input type="hidden" id="keyMonitorTypeInput" value="箱体突破" />
|
||||||
<div class="matrix-seg-group" id="keyDirectionSeg" aria-label="方向">
|
<select id="keyDirectionInput" class="matrix-input key-monitor-field">
|
||||||
<button type="button" class="matrix-seg-btn" data-value="long">做多</button>
|
<option value="">方向</option>
|
||||||
<button type="button" class="matrix-seg-btn" data-value="short">做空</button>
|
<option value="long">做多</option>
|
||||||
</div>
|
<option value="short">做空</option>
|
||||||
<input type="hidden" id="keyDirectionInput" value="" />
|
</select>
|
||||||
<input id="keyUpperInput" class="matrix-input key-monitor-field" type="number" step="any" placeholder="上沿/阻力" />
|
<input id="keyUpperInput" class="matrix-input key-monitor-field" type="number" step="any" placeholder="上沿/阻力" />
|
||||||
<input id="keyLowerInput" class="matrix-input key-monitor-field" type="number" step="any" placeholder="下沿/支撑" />
|
<input id="keyLowerInput" class="matrix-input key-monitor-field" type="number" step="any" placeholder="下沿/支撑" />
|
||||||
<div class="matrix-seg-group" id="keySlTpModeSeg" aria-label="突破方案">
|
<select id="keySlTpModeInput" class="matrix-input key-monitor-field" title="止盈止损方案">
|
||||||
<button type="button" class="matrix-seg-btn is-active" data-value="standard">标准</button>
|
<option value="standard">标准突破</option>
|
||||||
<button type="button" class="matrix-seg-btn" data-value="trend_manual">趋势</button>
|
<option value="trend_manual">趋势突破</option>
|
||||||
</div>
|
</select>
|
||||||
<input type="hidden" id="keySlTpModeInput" value="standard" />
|
|
||||||
<input id="keyManualTpInput" class="matrix-input key-monitor-field key-monitor-tp" type="number" step="any" placeholder="趋势止盈价" style="display:none" />
|
<input id="keyManualTpInput" class="matrix-input key-monitor-field key-monitor-tp" type="number" step="any" placeholder="趋势止盈价" style="display:none" />
|
||||||
<label class="matrix-hint key-monitor-check" style="display:inline-flex;align-items:center;gap:4px">
|
<label class="matrix-hint key-monitor-check" style="display:inline-flex;align-items:center;gap:4px">
|
||||||
<input id="keyBreakevenInput" type="checkbox" /> 移动保本
|
<input id="keyBreakevenInput" type="checkbox" /> 移动保本
|
||||||
@@ -162,8 +161,11 @@
|
|||||||
<p id="keyMonitorSaveMsg" class="matrix-msg"></p>
|
<p id="keyMonitorSaveMsg" class="matrix-msg"></p>
|
||||||
<div class="matrix-two-col" style="margin-top:12px">
|
<div class="matrix-two-col" style="margin-top:12px">
|
||||||
<div>
|
<div>
|
||||||
<h3 class="matrix-hint" style="margin-bottom:8px">监控中</h3>
|
<div class="key-monitor-active-head">
|
||||||
<div id="keyMonitorActive" class="matrix-list"></div>
|
<h3 class="matrix-hint" style="margin:0">监控中</h3>
|
||||||
|
<span id="keyMonitorActiveCount" class="matrix-chip key-monitor-count">0</span>
|
||||||
|
</div>
|
||||||
|
<div id="keyMonitorActive" class="matrix-list key-monitor-active-list"></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px">
|
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px">
|
||||||
|
|||||||
Reference in New Issue
Block a user