feat期权盈亏按交易账户快照结算:一次一仓、持仓禁划转、卖回后冻结。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2598,6 +2598,12 @@
|
||||
paintPositions(list);
|
||||
paintSpotSellBanner(d, list);
|
||||
paintCondOrderLock(d);
|
||||
if (typeof window.OptionsFundsSetTransferBlocked === "function") {
|
||||
window.OptionsFundsSetTransferBlocked(
|
||||
!!(d && d.transfer_blocked),
|
||||
(d && d.transfer_block_msg) || "持仓或待卖回期间不可划转"
|
||||
);
|
||||
}
|
||||
const fromPos = list.reduce(function (targets, p) {
|
||||
if (!p) return targets;
|
||||
if (p.target_index != null) {
|
||||
|
||||
@@ -353,4 +353,32 @@
|
||||
intMsg: "opt-page-int-msg",
|
||||
});
|
||||
}
|
||||
|
||||
/** 持仓/待卖回时划转按钮置灰(规格). */
|
||||
window.OptionsFundsSetTransferBlocked = function (blocked, msg) {
|
||||
const idsList = [
|
||||
["opt-page-int-btn", "opt-page-int-all-btn", "opt-page-int-amount", "opt-page-int-msg"],
|
||||
["opt-set-int-btn", "opt-set-int-all-btn", "opt-set-int-amount", "opt-set-int-msg"],
|
||||
];
|
||||
idsList.forEach(function (ids) {
|
||||
const btn = document.getElementById(ids[0]);
|
||||
const allBtn = document.getElementById(ids[1]);
|
||||
const amount = document.getElementById(ids[2]);
|
||||
const msgEl = document.getElementById(ids[3]);
|
||||
[btn, allBtn].forEach(function (el) {
|
||||
if (!el) return;
|
||||
el.disabled = !!blocked;
|
||||
el.style.opacity = blocked ? "0.45" : "";
|
||||
el.title = blocked ? String(msg || "持仓中不可划转") : "";
|
||||
});
|
||||
if (amount) amount.disabled = !!blocked;
|
||||
if (blocked && msgEl && msg) {
|
||||
msgEl.textContent = String(msg);
|
||||
msgEl.classList.add("text-warn");
|
||||
} else if (!blocked && msgEl && /持仓|划转|卖回/.test(String(msgEl.textContent || ""))) {
|
||||
msgEl.textContent = "";
|
||||
msgEl.classList.remove("text-warn");
|
||||
}
|
||||
});
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user