From 86cf722117f34a26c1b22a03c099357b7f11c4ff Mon Sep 17 00:00:00 2001 From: dekun Date: Wed, 12 Aug 2026 16:20:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BF=BB=E5=80=8D=E5=80=8D?= =?UTF-8?q?=E6=95=B0=E8=BE=93=E5=85=A5=E8=A2=AB=E5=88=B7=E5=9B=9E1?= =?UTF-8?q?=EF=BC=9A=E6=8C=81=E4=BB=93=E8=BD=AE=E8=AF=A2=E9=87=8D=E7=BB=98?= =?UTF-8?q?=E6=97=B6=E4=BF=9D=E7=95=99=E8=8D=89=E7=A8=BF=EF=BC=8C=E8=81=9A?= =?UTF-8?q?=E7=84=A6=E8=BE=93=E5=85=A5=E6=97=B6=E8=B7=B3=E8=BF=87=E9=87=8D?= =?UTF-8?q?=E7=BB=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- lib/common/static/options_panel.js | 42 +++++++++++++++++++++--- lib/options/templates/options_panel.html | 2 +- 2 files changed, 38 insertions(+), 6 deletions(-) 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 ( '
' + '翻倍' + '" + '' + '
- +