From c0955308792933d4767749b34fe34251e7d5b4ba Mon Sep 17 00:00:00 2001 From: butubb Date: Thu, 22 Oct 2026 14:06:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(report):=20=E7=9F=A9=E9=98=B5=E6=96=B9?= =?UTF-8?q?=E5=90=91=E6=94=B9=E5=9B=9E=E3=80=8C=E5=8D=9A=E4=B8=BB=E5=81=9A?= =?UTF-8?q?=E8=A1=8C=E3=80=81=E6=97=A5=E6=9C=9F=E5=81=9A=E5=88=97=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户要的是日期在上、昵称在左。上一版转置反了:日期做行、博主做列。 只改渲染方向,数据接口不变(它返回的是长表,两个方向都能拼)。 --- api/reports/matrix.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/api/reports/matrix.html b/api/reports/matrix.html index 4ad897d..8357590 100644 --- a/api/reports/matrix.html +++ b/api/reports/matrix.html @@ -250,25 +250,27 @@ const table = document.createElement('table'); const thead = document.createElement('thead'); const headRow = document.createElement('tr'); + // 左上角那一格钉住两个方向 —— 横着滚日期、竖着滚博主都要能看到它。 const corner = document.createElement('th'); - corner.textContent = '日期'; + corner.textContent = '博主 \\ 日期'; headRow.appendChild(corner); - for (const creator of data.creators) { + for (const day of data.dates) { const th = document.createElement('th'); - th.textContent = creator.name; + th.textContent = day; headRow.appendChild(th); } thead.appendChild(headRow); table.appendChild(thead); const tbody = document.createElement('tbody'); - for (const day of data.dates) { + for (const creator of data.creators) { const tr = document.createElement('tr'); const th = document.createElement('th'); - th.textContent = day; + th.textContent = creator.name; + th.title = creator.name; tr.appendChild(th); - const rowCells = data.cells[day] || {}; - for (const creator of data.creators) { + for (const day of data.dates) { + const rowCells = data.cells[day] || {}; tr.appendChild(cellNode(rowCells[creator.hash])); } tbody.appendChild(tr);