fix(hedge): hide mode-specific fields and default to option-primary

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-09 08:49:24 +08:00
parent e7e733d9a9
commit f7e5329915
3 changed files with 21 additions and 12 deletions
+5 -1
View File
@@ -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();
})();