| + 教室 + | + {WEEKDAYS.map((day, idx) => ( ++ {day} + | + ))} +
|---|---|
|
+ {classroom.name}
+ {classroom.building && (
+
+ {classroom.building}
+ {classroom.floor ? ` ${classroom.floor}F` : ''}
+
+ )}
+ |
+ {WEEKDAY_NUMBERS.map((wd) => {
+ const schedules = displayMatrix[classroom.id]?.[wd] || [];
+ const hasContent = schedules.length > 0;
+ return (
+ handleCellClick(classroom.id, wd)}
+ style={{
+ padding: 4,
+ border: '1px solid #f0f0f0',
+ verticalAlign: 'top',
+ cursor: 'pointer',
+ minHeight: 56,
+ transition: 'background 0.15s',
+ }}
+ onMouseEnter={(e) => {
+ (e.currentTarget as HTMLElement).style.background = '#f6f8fa';
+ }}
+ onMouseLeave={(e) => {
+ (e.currentTarget as HTMLElement).style.background = '';
+ }}
+ >
+ {hasContent ? (
+
+ {schedules.map((s) => (
+
+ ) : (
+
+
+
+ {s.subject}
+
+
+ {s.startTime}-{s.endTime}
+
+
+ —
+
+ )}
+ |
+ );
+ })}
+