refactor: establish standalone application boundary

This commit is contained in:
leefer
2026-08-03 21:42:25 +08:00
parent cc5fb8d73e
commit e1e76cd51e
324 changed files with 63090 additions and 44743 deletions
File diff suppressed because it is too large Load Diff
+85
View File
@@ -0,0 +1,85 @@
<section id="dragonView" class="workspace-view page redesigned-dragon-view">
<header class="dragon-page-head-v2 lad-head">
<div class="dragon-title-v2">
<h2>龙虎榜</h2>
<span>游资动向与席位明细</span>
<strong id="dragonDateLabel">--</strong>
</div>
<div class="dragon-head-actions-v2">
<div class="dragon-view-tabs-v2" role="group" aria-label="龙虎榜视图">
<button id="dragonDailyButton" class="active" type="button" data-dragon-view-mode="daily" aria-pressed="true">每日明细</button>
<button id="dragonProfilesButton" type="button" data-dragon-view-mode="profiles" aria-pressed="false">游资档案</button>
</div>
<button id="dragonRefreshButton" class="button dragon-action-v2" type="button"><i data-lucide="refresh-cw"></i><span>刷新</span></button>
<button id="dragonExportButton" class="button dragon-action-v2" type="button"><i data-lucide="download"></i><span>导出 CSV</span></button>
</div>
</header>
<section id="dragonEmptyState" class="dragon-empty-state-v2" hidden aria-live="polite">
<div class="dragon-empty-symbol-v2" aria-hidden="true"><i data-lucide="list-tree"></i></div>
<h3 id="dragonEmptyTitle">当日暂无龙虎榜明细</h3>
<p id="dragonEmptyDescription">龙虎榜明细通常在交易日盘后陆续披露,可稍后刷新或查看前一交易日。</p>
<div class="dragon-empty-actions-v2">
<button id="dragonPreviousButton" class="button" type="button"><i data-lucide="arrow-left"></i><span>查看前一交易日</span></button>
<button id="dragonEmptyRefreshButton" class="button primary" type="button"><i data-lucide="refresh-cw"></i><span>重新检查</span></button>
</div>
</section>
<div id="dragonDailyContent" class="dragon-daily-content-v2">
<div id="dragonSummary" class="dragon-summary-v2"></div>
<div class="dragon-filterbar-v2">
<div class="dragon-filter-copy-v2"><h3>每日明细</h3><span>按公开席位归集当日游资操作</span></div>
<div class="dragon-filter-actions-v2">
<div class="dragon-segments-v2" role="group" aria-label="龙虎榜筛选">
<button type="button" class="dragon-filter-v2 active" data-dragon-filter="all">全部游资</button>
<button type="button" class="dragon-filter-v2" data-dragon-filter="buy">净买入</button>
<button type="button" class="dragon-filter-v2" data-dragon-filter="sell">净卖出</button>
<button id="dragonUnclassifiedFilter" type="button" class="dragon-filter-v2" data-dragon-filter="unclassified">待归类</button>
</div>
<label class="dragon-search-v2"><i data-lucide="search" aria-hidden="true"></i><span class="visually-hidden">搜索游资龙虎榜</span><input id="dragonSearch" type="search" placeholder="搜索游资、席位或股票" autocomplete="off"></label>
</div>
</div>
<section class="dragon-card-stage dragon-card-stage-v2 card">
<div class="dragon-stage-heading-v2"><div><h3>活跃游资</h3><span>点击卡牌查看当日操作</span></div><small>净买入为红 · 净卖出为绿</small></div>
<div id="dragonTraderList" class="dragon-trader-list"></div>
</section>
<section id="dragonTraderDetail" class="dragon-trader-detail dragon-trader-detail-v2 card"><div class="empty-state dragon-empty">选择一位游资查看操作明细</div></section>
<details id="dragonUnclassifiedSection" class="unclassified-section dragon-unclassified-v2">
<summary class="unclassified-heading">
<div><h3 id="unclassifiedTitle">待归类席位</h3><span>为营业部设置游资名后,同名席位会自动合并</span></div>
<strong id="unclassifiedCount">0 个</strong>
</summary>
<div id="unclassifiedSeatList" class="unclassified-seat-list"></div>
</details>
</div>
<section id="dragonProfilesContent" class="hot-money-profiles-v2" hidden aria-label="游资档案">
<header class="hot-money-profile-toolbar-v2">
<div class="dragon-filter-copy-v2">
<h3>游资名录</h3>
<span>公开收录的游资简介与关联营业部</span>
</div>
<div id="hotMoneyProfileSummary" class="hot-money-profile-summary-v2" aria-label="名录统计"></div>
<label class="dragon-search-v2 hot-money-profile-search-v2">
<i data-lucide="search" aria-hidden="true"></i>
<span class="visually-hidden">搜索游资档案</span>
<input id="hotMoneyProfileSearch" type="search" placeholder="搜索游资、简介或营业部" autocomplete="off">
</label>
</header>
<div class="hot-money-profile-workspace-v2">
<section class="hot-money-profile-directory-v2" aria-label="游资名录列表">
<header class="hot-money-profile-directory-head-v2">
<strong>全部游资</strong>
<span id="hotMoneyProfileResultCount">0 位</span>
</header>
<div id="hotMoneyProfileList" class="hot-money-profile-list-v2" role="listbox" aria-label="选择游资档案"></div>
</section>
<article id="hotMoneyProfileDetail" class="hot-money-profile-detail-v2" aria-live="polite">
<div class="hot-money-profile-empty-v2">
<i data-lucide="contact" aria-hidden="true"></i>
<strong>选择一位游资查看档案</strong>
</div>
</article>
</div>
</section>
</section>
+43 -2
View File
@@ -1,8 +1,8 @@
window.XiaobaiPageModules.register("dragon_tiger", ["dragonView"], {
bind: bindDragonTigerEvents,
enter: ["loadDragonTiger"],
});
/* PRESERVATION-SOURCE-BEGIN app.js:2660-3028 */
function selectDragonViewMode(mode) {
state.dragonViewMode = mode === "profiles" ? "profiles" : "daily";
document.querySelectorAll("[data-dragon-view-mode]").forEach((button) => {
@@ -372,4 +372,45 @@ async function saveSeatAlias(event) {
}
}
/* PRESERVATION-SOURCE-END app.js:2660-3028 */
function bindDragonTigerEvents() {
document.querySelector("#dragonRefreshButton").addEventListener("click", () => {
if (state.dragonViewMode === "profiles") loadHotMoneyProfiles(true);
else loadDragonTiger(true);
});
document.querySelector("#dragonEmptyRefreshButton").addEventListener("click", () => loadDragonTiger(true));
document.querySelector("#dragonPreviousButton").addEventListener("click", () => shiftDate(-1));
document.querySelector("#dragonExportButton").addEventListener("click", () => {
if (state.dragonViewMode === "profiles") exportHotMoneyProfiles();
else exportDragonTiger();
});
document.querySelectorAll("[data-dragon-view-mode]").forEach((button) => {
button.addEventListener("click", () => selectDragonViewMode(button.dataset.dragonViewMode));
});
document.querySelector("#dragonSearch").addEventListener("input", (event) => {
state.dragonQuery = event.target.value.trim().toLowerCase();
renderDragonTraderList();
});
document.querySelectorAll("[data-dragon-filter]").forEach((button) => {
button.addEventListener("click", () => {
state.dragonFilter = button.dataset.dragonFilter;
document.querySelectorAll("[data-dragon-filter]").forEach((item) => {
item.classList.toggle("active", item === button);
});
renderDragonTraderList();
});
});
document.querySelector("#hotMoneyProfileSearch").addEventListener("input", (event) => {
state.hotMoneyProfileQuery = event.target.value.trim().toLocaleLowerCase("zh-CN");
renderHotMoneyProfiles();
});
document.querySelector("#hotMoneyProfileList").addEventListener("click", (event) => {
const button = event.target.closest("[data-hot-money-profile]");
if (!button) return;
state.selectedHotMoneyProfileId = button.dataset.hotMoneyProfile;
renderHotMoneyProfiles();
});
window.addEventListener("resize", () => {
if (state.activeView === "dragonView") layoutDragonCards();
});
}