diff --git a/assets/image_20260710151918709.png b/assets/image_20260710151918709.png new file mode 100644 index 0000000..9f33b55 Binary files /dev/null and b/assets/image_20260710151918709.png differ diff --git a/templates/index.html b/templates/index.html index 4564604..adbf9b7 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1216,12 +1216,15 @@ } }); - // 设置当前时段的样式 - if (timePeriodConfig[periodKey].includes(hour)) { - const cell = document.querySelector(`.tp-cell[data-hour="${hour}"][data-period="${periodKey}"]`); - if (cell) { - cell.classList.add(periodKey); - cell.textContent = '✓'; + // 检查该小时属于哪个时段,并设置对应的样式 + for (const p of TIME_PERIODS) { + if (timePeriodConfig[p.key].includes(hour)) { + const cell = document.querySelector(`.tp-cell[data-hour="${hour}"][data-period="${p.key}"]`); + if (cell) { + cell.classList.add(p.key); + cell.textContent = '✓'; + } + break; // 每个小时只能属于一个时段 } } }