diff --git a/lib/common/static/options_panel.js b/lib/common/static/options_panel.js index b546ea1..99ed92b 100644 --- a/lib/common/static/options_panel.js +++ b/lib/common/static/options_panel.js @@ -28,6 +28,8 @@ posTab: "live", /** 未点设定前的目标输入草稿,避免持仓轮询重绘清空 */ targetDraftByInst: {}, + /** 翻倍倍数草稿,避免轮询重绘把正在输入的值刷回 1 */ + profitExitDraftByInst: {}, }; let lastGoodPositions = null; @@ -1556,21 +1558,28 @@ return ""; } const enabled = !!p.profit_exit_enabled; - const mult = p.profit_exit_mult != null && Number(p.profit_exit_mult) > 0 + const serverMult = p.profit_exit_mult != null && Number(p.profit_exit_mult) > 0 ? Number(p.profit_exit_mult) : 1; - const state = String(p.profit_exit_state || (enabled ? "active" : "idle")); + const draft = state.profitExitDraftByInst[inst]; + const multDisp = draft != null && String(draft).trim() !== "" + ? String(draft) + : String(serverMult); + const multNum = Number(multDisp); + const multLabel = formatProfitExitMultLabel( + Number.isFinite(multNum) && multNum > 0 ? multNum : serverMult + ); + const statePe = String(p.profit_exit_state || (enabled ? "active" : "idle")); const req = p.profit_exit_required_recycle; - const multLabel = formatProfitExitMultLabel(mult); let statusTxt = enabled ? ("监控中 · " + multLabel) : "未开启"; - if (enabled && state === "closing") statusTxt = "平仓挂单中 · " + multLabel; + if (enabled && statePe === "closing") statusTxt = "平仓挂单中 · " + multLabel; return ( '
' + '翻倍' + '" + '' + '
- +