fix: 修复时段编辑器显示bug,确保所有时段的选中状态正确显示

Coze-Commit-Type: user
Coze-User-ID: 3722323274763196
Coze-Conversation-ID: 9894087
This commit is contained in:
user9994793890
2026-07-10 15:21:52 +08:00
parent 58b90a3ad7
commit f1e74b3713
2 changed files with 9 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -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; // 每个小时只能属于一个时段
}
}
}