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