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,12 +1216,15 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 设置当前时段的样式
|
// 检查该小时属于哪个时段,并设置对应的样式
|
||||||
if (timePeriodConfig[periodKey].includes(hour)) {
|
for (const p of TIME_PERIODS) {
|
||||||
const cell = document.querySelector(`.tp-cell[data-hour="${hour}"][data-period="${periodKey}"]`);
|
if (timePeriodConfig[p.key].includes(hour)) {
|
||||||
if (cell) {
|
const cell = document.querySelector(`.tp-cell[data-hour="${hour}"][data-period="${p.key}"]`);
|
||||||
cell.classList.add(periodKey);
|
if (cell) {
|
||||||
cell.textContent = '✓';
|
cell.classList.add(p.key);
|
||||||
|
cell.textContent = '✓';
|
||||||
|
}
|
||||||
|
break; // 每个小时只能属于一个时段
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user