四个合约页面统一添加表头

This commit is contained in:
fish
2026-07-24 17:43:46 +08:00
parent 4c3dd86c37
commit d95aa8d215
4 changed files with 56 additions and 5 deletions
+14 -1
View File
@@ -51,6 +51,11 @@
.drawer .close-btn:hover { color: var(--fg); }
.amp-cell { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.amp-cell:hover { color: #3b82f6; }
.section { margin-bottom: 8px; }
.section h2 { font-size: 1.1rem; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; margin: 28px 0 10px; padding: 4px 0; }
.section h2 .arrow { display: inline-block; transition: transform .2s; font-size: 0.8rem; }
.section.collapsed h2 .arrow { transform: rotate(-90deg); }
.section.collapsed table { display: none; }
</style>
</head>
<body>
@@ -61,6 +66,8 @@
<p class="sub"><a href="index.html">返回总览</a> &nbsp;|&nbsp; <a href="fg2609.html">FG2609</a> &nbsp;|&nbsp; <a href="fg2610.html">FG2610</a> &nbsp;|&nbsp; <a href="fg2611.html">FG2611</a> &nbsp;|&nbsp; <span>FG2701</span></p>
<p class="formula">振幅算法:近 5 日均振幅 = 过去 5 个交易日 (最高 − 最低) 的均值,结果四舍五入取整</p>
<div class="section" id="sec-fg2701">
<h2 onclick="toggleSection('sec-fg2701')"><span class="arrow"></span> FG2701 玻璃</h2>
<table>
<tr><th>日期</th><th>星期</th><th>开盘</th><th>收盘</th><th>最高</th><th>最低</th><th>最高最低差价</th><th>振幅</th></tr>
<tr><td>2026/7/1</td><td>周三</td><td>1059</td><td>1054</td><td>1062</td><td>1050</td><td>12</td><td class="na">-</td></tr>
@@ -83,6 +90,7 @@
<tr><td>2026/7/24</td><td>周五</td><td>978</td><td>985</td><td>987</td><td>972</td><td>15</td><td class="amp-cell">17</td></tr>
<tr><td>2026/7/27</td><td>周一</td><td class="na">-</td><td class="na">-</td><td class="na">-</td><td class="na">-</td><td>0</td><td class="amp-cell">14</td></tr>
</table>
</div>
<div class="drawer-overlay" id="overlay" onclick="closeDrawer()"></div>
<div class="drawer" id="drawer">
@@ -116,6 +124,10 @@ function toggleTheme() {
} catch(e) {}
})();
function toggleSection(id) {
document.getElementById(id).classList.toggle('collapsed');
}
var activeRow = null;
function closeDrawer() {
document.getElementById('overlay').classList.remove('show');
@@ -144,7 +156,8 @@ document.querySelectorAll('.amp-cell').forEach(function(cell) {
if (start < 0) return;
var ampVal = cell.textContent.trim();
document.getElementById('drawer-title').textContent = 'FG2701 玻璃';
var h2 = tbl.closest('.section').querySelector('h2');
document.getElementById('drawer-title').textContent = h2.childNodes[h2.childNodes.length - 1].textContent.trim();
document.getElementById('drawer-date').textContent = '目标日期: ' + ranges[idx].date + ' ' + ranges[idx].wk + ' 振幅 ' + ampVal;
var html = '<tr><td>日期</td><td>最高−最低</td></tr>';