fix: 修复斐波/突破滚仓重复脚本导致无法提交

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-26 23:25:27 +08:00
parent 6352fa6be3
commit 02255a3b02
8 changed files with 16 additions and 14 deletions
+1 -1
View File
@@ -834,7 +834,7 @@
<script src="/static/ai_review_render.js?v=2"></script>
<script src="/static/form_submit_guard.js?v=2"></script>
<script src="/static/manual_order_rr_preview.js?v=4"></script>
<script src="/static/strategy_roll.js?v=4"></script>
<script src="/static/strategy_roll.js?v=5"></script>
<script>
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
+1 -1
View File
@@ -801,7 +801,7 @@
<script src="/static/ai_review_render.js?v=2"></script>
<script src="/static/form_submit_guard.js?v=2"></script>
<script src="/static/manual_order_rr_preview.js?v=4"></script>
<script src="/static/strategy_roll.js?v=4"></script>
<script src="/static/strategy_roll.js?v=5"></script>
<script>
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
+1 -1
View File
@@ -801,7 +801,7 @@
<script src="/static/ai_review_render.js?v=2"></script>
<script src="/static/form_submit_guard.js?v=2"></script>
<script src="/static/manual_order_rr_preview.js?v=4"></script>
<script src="/static/strategy_roll.js?v=4"></script>
<script src="/static/strategy_roll.js?v=5"></script>
<script>
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
+1 -1
View File
@@ -830,7 +830,7 @@
<script src="/static/ai_review_render.js?v=2"></script>
<script src="/static/form_submit_guard.js?v=2"></script>
<script src="/static/manual_order_rr_preview.js?v=4"></script>
<script src="/static/strategy_roll.js?v=4"></script>
<script src="/static/strategy_roll.js?v=5"></script>
<script>
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
+1 -1
View File
@@ -114,7 +114,7 @@
<script src="/static/ai_review_render.js?v=2"></script>
<script src="/static/form_submit_guard.js?v=2"></script>
<script src="/static/manual_order_rr_preview.js?v=4"></script>
<script src="/static/strategy_roll.js?v=4"></script>
<script src="/static/strategy_roll.js?v=5"></script>
<script src="/static/key_monitor_form.js?v=1"></script>
{% include 'embed_boot_scripts.html' %}
<script src="/static/instance_embed.js?v=4"></script>
+10 -8
View File
@@ -32,6 +32,8 @@
const form = document.getElementById("roll-form");
if (!form) return;
if (form.dataset.rollJsInit === "1") return;
form.dataset.rollJsInit = "1";
const symbolSel = document.getElementById("roll-symbol");
const dirInput = document.getElementById("roll-direction");
@@ -47,7 +49,7 @@
let countdownTimer = null;
let previewOk = false;
let lastPreviewMode = "";
let allowMonitorSubmit = false;
let monitorSubmitting = false;
function isMarketMode() {
return (modeSel.value || "market") === "market";
@@ -99,6 +101,7 @@
previewBox.classList.add("is-error");
previewText.textContent = msg || "无法执行";
if (countdownEl) countdownEl.style.display = "none";
previewBox.scrollIntoView({ behavior: "smooth", block: "nearest" });
}
function showPreviewResult(p) {
@@ -133,7 +136,7 @@
function resetPreview() {
previewOk = false;
allowMonitorSubmit = false;
monitorSubmitting = false;
clearMessageBox();
if (countdownTimer) {
clearInterval(countdownTimer);
@@ -193,13 +196,16 @@
}
function runMonitorSubmit() {
if (monitorSubmitting) return;
if (!symbolSel.value) {
showReject("请先选择持仓币种");
return;
}
monitorSubmitting = true;
if (submitBtn) submitBtn.disabled = true;
requestPreview()
.then(function (data) {
monitorSubmitting = false;
if (submitBtn && !trendLocked) submitBtn.disabled = false;
if (!data.ok) {
showReject(data.msg || "无法提交监控");
@@ -217,10 +223,10 @@
if (!confirm("确认提交「" + modeLabel + "」?\n" + summary)) {
return;
}
allowMonitorSubmit = true;
form.requestSubmit();
form.submit();
})
.catch(function () {
monitorSubmitting = false;
if (submitBtn && !trendLocked) submitBtn.disabled = false;
showReject("校验请求失败,请稍后重试");
});
@@ -258,10 +264,6 @@
if (previewBtn) previewBtn.addEventListener("click", runPreview);
form.addEventListener("submit", function (e) {
if (isMonitorMode()) {
if (allowMonitorSubmit) {
allowMonitorSubmit = false;
return;
}
e.preventDefault();
runMonitorSubmit();
return;
+1
View File
@@ -14,5 +14,6 @@
{% include 'strategy_roll_panel.html' %}
<p class="rule-tip" style="margin-top:12px"><a href="/strategy/roll/docs" style="color:#8fc8ff">顺势加仓完整逻辑说明</a></p>
</div>
<script src="/static/strategy_roll.js?v=5"></script>
</body>
</html>
@@ -101,4 +101,3 @@
</table>
</div>
</div>
<script src="/static/strategy_roll.js?v=4"></script>