fix: 修复时段编辑器显示bug,确保所有时段的选中状态正确显示
Coze-Commit-Type: user Coze-User-ID: 3722323274763196 Coze-Conversation-ID: 9894087
This commit is contained in:
BIN
assets/image_20260710151918709.png
Normal file
BIN
assets/image_20260710151918709.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@@ -1216,13 +1216,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
// 设置当前时段的样式
|
||||
if (timePeriodConfig[periodKey].includes(hour)) {
|
||||
const cell = document.querySelector(`.tp-cell[data-hour="${hour}"][data-period="${periodKey}"]`);
|
||||
// 检查该小时属于哪个时段,并设置对应的样式
|
||||
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(periodKey);
|
||||
cell.classList.add(p.key);
|
||||
cell.textContent = '✓';
|
||||
}
|
||||
break; // 每个小时只能属于一个时段
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user