diff --git a/lib/common/static/hedge_plan.js b/lib/common/static/hedge_plan.js index 5f2a13c..7eace0d 100644 --- a/lib/common/static/hedge_plan.js +++ b/lib/common/static/hedge_plan.js @@ -37,7 +37,7 @@ ooCloseModeEnabled: root.getAttribute("data-oo-close-mode-enabled") !== "0", ooCloseMode: "close_all", direction: "long", - optionPrimary: false, + optionPrimary: true, opLevTouched: false, opRatioTouched: false, tradingUsdc: null, @@ -279,15 +279,18 @@ }); const ins = $("hp-po-fields-insurance"); const op = $("hp-po-fields-option-primary"); + // 保险模式只显示开仓价/张数/止盈止损;以期权为主只显示权利金等执行参数 if (ins) { ins.classList.toggle("hidden", on); if (on) ins.setAttribute("hidden", "hidden"); else ins.removeAttribute("hidden"); + ins.style.display = on ? "none" : ""; } if (op) { op.classList.toggle("hidden", !on); if (!on) op.setAttribute("hidden", "hidden"); else op.removeAttribute("hidden"); + op.style.display = on ? "" : "none"; } const otmBtn = document.querySelector(".hp-money-otm"); if (otmBtn) { @@ -2533,5 +2536,6 @@ applyBudgetBuffer(state.budgetBuffer); updateOoBudgetLine(null); bind(); + syncOptionPrimaryUI(); void refreshAll(); })(); diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index 4d43019..3749967 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -3480,6 +3480,11 @@ html[data-theme="light"] .opt-be-dist-down { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); } +/* display:grid 会盖掉 [hidden];模式切换必须显式 none */ +.hedge-plan-page-wrap .hp-po-fields.hidden, +.hedge-plan-page-wrap .hp-po-fields[hidden] { + display: none !important; +} .hedge-plan-page-wrap .hp-po-field { display: flex; flex-direction: column; diff --git a/lib/hedge_plan/templates/hedge_plan_panel.html b/lib/hedge_plan/templates/hedge_plan_panel.html index c39ffde..866643d 100644 --- a/lib/hedge_plan/templates/hedge_plan_panel.html +++ b/lib/hedge_plan/templates/hedge_plan_panel.html @@ -43,7 +43,7 @@