refactor: establish standalone application boundary
This commit is contained in:
+1247
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,54 @@
|
||||
<section id="rotationView" class="workspace-view page redesigned-rotation-view">
|
||||
<header class="rotation-page-head lad-head">
|
||||
<div>
|
||||
<h2>板块轮动</h2>
|
||||
<p id="rotationHistoryRange">最近 9 个交易日 · 由远到近,右侧为最新交易日</p>
|
||||
</div>
|
||||
<div class="rotation-head-actions">
|
||||
<div id="rotationOrderControl" class="rotation-order-control" role="group" aria-label="轮动日期排序">
|
||||
<button class="active" type="button" data-rotation-order="oldest">由远到近</button>
|
||||
<button type="button" data-rotation-order="latest">由近到远</button>
|
||||
</div>
|
||||
<button id="rotationExportButton" class="rotation-export-button" type="button">导出 CSV</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="rotation-trajectory-card card" aria-labelledby="rotationTrajectoryTitle">
|
||||
<header class="rotation-card-head card-h">
|
||||
<div>
|
||||
<h3 id="rotationTrajectoryTitle">热点轨迹</h3>
|
||||
<span id="rotationSelectionHint">点击任意板块追踪其连续性</span>
|
||||
</div>
|
||||
<span class="rotation-top-tag">每日 Top 12 热点</span>
|
||||
</header>
|
||||
<div class="rotation-legend" aria-label="板块强度图例">
|
||||
<span><i class="rotation-swatch strong"></i>强度高(90+)</span>
|
||||
<span><i class="rotation-swatch warm"></i>强度中(70–89)</span>
|
||||
<span><i class="rotation-swatch mild"></i>强度低(<70)</span>
|
||||
</div>
|
||||
<div id="rotationTracker" class="rotation-tracker" hidden></div>
|
||||
<div id="rotationHistory" class="rotation-history"><div class="empty-state">正在读取轮动历史</div></div>
|
||||
</section>
|
||||
|
||||
<section class="rotation-detail-card card" aria-labelledby="rotationDetailTitle">
|
||||
<header class="rotation-card-head card-h">
|
||||
<div>
|
||||
<h3 id="rotationDetailTitle">板块成分股</h3>
|
||||
<span>点击上方板块,查看目标交易日有效申万成分与行情</span>
|
||||
</div>
|
||||
<span id="rotationDetailMeta" class="rotation-top-tag">--</span>
|
||||
</header>
|
||||
<div class="rotation-table-frame tbl-wrap">
|
||||
<table id="rotationTable" class="data-table tbl rotation-table">
|
||||
<thead><tr>
|
||||
<th class="number num">序号</th><th>代码</th><th>股票</th>
|
||||
<th class="number num" data-auto-sort="true" title="涨跌幅:点击排序">涨跌幅(%)</th>
|
||||
<th class="number num">开盘价(元)</th><th class="number num">收盘价(元)</th>
|
||||
<th class="number num" data-auto-sort="true" title="成交额:点击排序">成交额(亿)</th><th>行情状态</th>
|
||||
</tr></thead>
|
||||
<tbody id="rotationTableBody"></tbody>
|
||||
</table>
|
||||
<div id="rotationMembersEmpty" class="empty-state">点击上方任意板块查看成分股</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
@@ -1,8 +1,8 @@
|
||||
window.XiaobaiPageModules.register("rotation", ["rotationView"], {
|
||||
bind: bindRotationEvents,
|
||||
enter: ["loadRotation"],
|
||||
});
|
||||
|
||||
/* PRESERVATION-SOURCE-BEGIN app.js:1958-2124 */
|
||||
async function loadRotationHistory(force = false) {
|
||||
if (!state.dashboard || state.rotationLoading) return;
|
||||
const key = `${elements.tradeDate.value}:9`;
|
||||
@@ -170,4 +170,14 @@ function renderRotationMembers() {
|
||||
bindStockRows(body);
|
||||
}
|
||||
|
||||
/* PRESERVATION-SOURCE-END app.js:1958-2124 */
|
||||
|
||||
function bindRotationEvents() {
|
||||
document.querySelector("#rotationExportButton").addEventListener("click", exportRotation);
|
||||
document.querySelectorAll("[data-rotation-order]").forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
state.rotationOrder = button.dataset.rotationOrder === "latest" ? "latest" : "oldest";
|
||||
localStorage.setItem("xiaobaiRotationOrder", state.rotationOrder);
|
||||
renderRotationHistory();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user