修改
This commit is contained in:
@@ -864,7 +864,7 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/ai_review_render.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=2"></script>
|
||||
<script>
|
||||
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
|
||||
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
|
||||
@@ -1745,10 +1745,15 @@ function cancelExchangeTpsl(orderId, role){
|
||||
}
|
||||
|
||||
function allowManualOrderSubmit(form){
|
||||
if(window.FormSubmitGuard && FormSubmitGuard.isLocked(form) && form.dataset.rrOk !== "1") return;
|
||||
form.dataset.rrOk = "1";
|
||||
if(window.FormSubmitGuard) FormSubmitGuard.nativeSubmitOnce(form, "开仓提交中…");
|
||||
else form.submit();
|
||||
if(window.FormSubmitGuard){
|
||||
if(FormSubmitGuard.isLocked(form)){
|
||||
FormSubmitGuard.setSubmitLabel(form, "开仓提交中…");
|
||||
} else {
|
||||
FormSubmitGuard.lock(form, "开仓提交中…");
|
||||
}
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
|
||||
let latestAvailableUsdt = null;
|
||||
|
||||
@@ -864,7 +864,7 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/ai_review_render.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=2"></script>
|
||||
<script>
|
||||
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
|
||||
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
|
||||
@@ -1745,10 +1745,15 @@ function cancelExchangeTpsl(orderId, role){
|
||||
}
|
||||
|
||||
function allowManualOrderSubmit(form){
|
||||
if(window.FormSubmitGuard && FormSubmitGuard.isLocked(form) && form.dataset.rrOk !== "1") return;
|
||||
form.dataset.rrOk = "1";
|
||||
if(window.FormSubmitGuard) FormSubmitGuard.nativeSubmitOnce(form, "开仓提交中…");
|
||||
else form.submit();
|
||||
if(window.FormSubmitGuard){
|
||||
if(FormSubmitGuard.isLocked(form)){
|
||||
FormSubmitGuard.setSubmitLabel(form, "开仓提交中…");
|
||||
} else {
|
||||
FormSubmitGuard.lock(form, "开仓提交中…");
|
||||
}
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
|
||||
let latestAvailableUsdt = null;
|
||||
|
||||
@@ -703,7 +703,7 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/ai_review_render.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=2"></script>
|
||||
<script>
|
||||
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
|
||||
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
|
||||
|
||||
@@ -873,7 +873,7 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/ai_review_render.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=1"></script>
|
||||
<script src="/static/form_submit_guard.js?v=2"></script>
|
||||
<script>
|
||||
const JOURNAL_ENTRY_REASON_OPTIONS = {{ entry_reason_options | tojson }};
|
||||
const JOURNAL_ENTRY_REASON_OTHER = {{ entry_reason_other_value | tojson }};
|
||||
@@ -1755,10 +1755,15 @@ function cancelExchangeTpsl(orderId, role){
|
||||
}
|
||||
|
||||
function allowManualOrderSubmit(form){
|
||||
if(window.FormSubmitGuard && FormSubmitGuard.isLocked(form) && form.dataset.rrOk !== "1") return;
|
||||
form.dataset.rrOk = "1";
|
||||
if(window.FormSubmitGuard) FormSubmitGuard.nativeSubmitOnce(form, "开仓提交中…");
|
||||
else form.submit();
|
||||
if(window.FormSubmitGuard){
|
||||
if(FormSubmitGuard.isLocked(form)){
|
||||
FormSubmitGuard.setSubmitLabel(form, "开仓提交中…");
|
||||
} else {
|
||||
FormSubmitGuard.lock(form, "开仓提交中…");
|
||||
}
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
|
||||
let latestAvailableUsdt = null;
|
||||
|
||||
@@ -49,10 +49,24 @@
|
||||
return !!(form && form.dataset.submitGuard === "locked");
|
||||
}
|
||||
|
||||
/** 已锁定时仅更新按钮文案(校验通过 → 真正提交前) */
|
||||
function setSubmitLabel(form, label) {
|
||||
if (!form || !label) return;
|
||||
submitButtons(form).forEach(function (btn) {
|
||||
if (btn.tagName === "BUTTON") btn.textContent = label;
|
||||
else btn.value = label;
|
||||
});
|
||||
}
|
||||
|
||||
/** 已通过前端校验,发起最终 POST(页面将跳转) */
|
||||
function nativeSubmitOnce(form, label) {
|
||||
if (!form) return;
|
||||
lockForm(form, label || "提交中…");
|
||||
var text = label || "提交中…";
|
||||
if (form.dataset.submitGuard === "locked") {
|
||||
setSubmitLabel(form, text);
|
||||
} else {
|
||||
lockForm(form, text);
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
|
||||
@@ -60,6 +74,7 @@
|
||||
lock: lockForm,
|
||||
unlock: unlockForm,
|
||||
isLocked: isLocked,
|
||||
setSubmitLabel: setSubmitLabel,
|
||||
nativeSubmitOnce: nativeSubmitOnce,
|
||||
};
|
||||
})(typeof window !== "undefined" ? window : this);
|
||||
|
||||
Reference in New Issue
Block a user