diff --git a/TIMETABLES.md b/TIMETABLES.md index 5b41d6a..e3dfd92 100644 --- a/TIMETABLES.md +++ b/TIMETABLES.md @@ -25,7 +25,7 @@ 程序根据星期列、节次以及课程块覆盖范围整理周一至周五20个时段。完整定位的彩色课表可根据留白建议“无课”,仅保存 `busy` / `free`;课程名、教师、教室和识别原文留空。表格未完整展示、缺少可靠定位或不是彩色课表时,回退文字位置判断,无法确定的时段保持 `unknown`,不会把识别失败当作无课。节次与星期仅有少量漏字时可参考相邻标签定位;边界或行位置不可靠则交由本人核对。晚间和周末课程不参与当前四个值班时段判断。 -校对页面默认缩小显示完整原图,校对表先收起。点击“校对课表”后,在原图上显示半透明校对层;点击时段按钮即可切换“有课 / 无课”,定位失败时保留“待确认”。有课按钮用红色标注,可随时收起校对层或放大原图;收起、放大不丢失当前修改。界面显示有课、无课及待确认时段数,不再要求填写课程备注。核对后可将其余待确认设为无课。保存草稿不等于确认;只有20个时段均已明确,才能点击“核对无误并确认”。识别组件异常时仍保存图片并提供手动整理。自动结果始终需要核对,只有已确认的无课时段才可供排班使用。 +校对页面默认缩小显示完整原图,校对表先收起。点击“校对课表”后,在原图上显示透明底板与透明单元格的校对按钮层,原图保持原色;点击时段按钮即可切换“有课 / 无课”,定位失败时保留“待确认”。有课按钮用红色文字和边框标注,保存操作位于图片下方,避免遮挡课表。可点“看清原图”临时隐藏全部标注,再点“恢复校对标注”继续;也可随时收起校对层或放大原图;收起、放大不丢失当前修改。界面显示有课、无课及待确认时段数,不再要求填写课程备注。核对后可将其余待确认设为无课。保存草稿不等于确认;只有20个时段均已明确,才能点击“核对无误并确认”。识别组件异常时仍保存图片并提供手动整理。自动结果始终需要核对,只有已确认的无课时段才可供排班使用。 这次仅收取和整理数据,不会自动修改已有值班表或发送额外邮件。 diff --git a/dist/assets/styles.css b/dist/assets/styles.css index 3e5ddaa..47c0d7a 100644 --- a/dist/assets/styles.css +++ b/dist/assets/styles.css @@ -616,24 +616,24 @@ button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px s .timetable-source img { display:block; width:auto; height:auto; max-width:100%; max-height:calc(66vh - 20px); object-fit:contain; } .timetable-review-stage.is-expanded .timetable-source { display:block; } .timetable-review-stage.is-expanded .timetable-source img { width:100%; max-height:none; } -.timetable-review-panel { grid-area:1 / 1; z-index:1; width:calc(100% - 16px); max-height:calc(66vh - 16px); overflow:auto; justify-self:center; padding:14px; border:1px solid rgba(255,255,255,.85); border-radius:12px; background:rgba(255,255,255,.48); box-shadow:0 8px 28px rgba(38,60,53,.12); } +.timetable-review-panel { grid-area:1 / 1; z-index:1; width:calc(100% - 16px); max-height:calc(66vh - 16px); overflow:auto; justify-self:center; padding:14px; border:0; border-radius:12px; background:transparent; box-shadow:none; } .timetable-review-panel[hidden] { display:none; } +.timetable-review-stage.is-peeking .timetable-review-panel { visibility:hidden; pointer-events:none; } +#timetable-peek-image[hidden],#timetable-review-actions[hidden] { display:none; } .timetable-review-panel .timetable-grid-wrap { margin:0 0 10px; } .timetable-review-panel .timetable-grid { min-width:0; table-layout:fixed; } -.timetable-review-panel .timetable-grid th,.timetable-review-panel .timetable-grid td { padding:6px; min-width:0; border-color:rgba(38,60,53,.18); } -.timetable-review-panel .timetable-grid th { background:rgba(234,243,237,.65); } +.timetable-review-panel .timetable-grid th,.timetable-review-panel .timetable-grid td { padding:6px; min-width:0; border-color:rgba(38,60,53,.15); } +.timetable-review-panel .timetable-grid th { background:rgba(255,255,255,.28); text-shadow:0 0 3px #fff,0 1px 2px #fff; } .timetable-review-panel .timetable-grid small { display:block; font-size:10px; font-weight:400; } -.timetable-review-panel td[data-status=busy] { background:rgba(255,241,242,.35); } -.timetable-review-panel td[data-status=free] { background:rgba(234,243,237,.3); } -.timetable-review-panel td[data-status=unknown] { background:rgba(255,247,231,.4); } -.timetable-status-button { display:block; width:100%; min-height:42px; padding:6px 3px; border:1px solid rgba(40,102,79,.35); border-radius:8px; background:rgba(234,243,237,.76); color:var(--primary); font-size:13px; font-weight:600; } -.timetable-grid td[data-status=busy] .timetable-status-button { border-color:rgba(185,28,28,.5); background:rgba(254,226,226,.8); color:#991b1b; } -.timetable-grid td[data-status=unknown] .timetable-status-button { border-color:rgba(180,83,9,.45); background:rgba(255,247,231,.8); color:#92400e; } +.timetable-review-panel .timetable-grid td[data-status] { background:transparent; } +.timetable-status-button { display:block; width:100%; min-height:42px; padding:6px 3px; border:1px solid rgba(40,102,79,.65); border-radius:8px; background:rgba(255,255,255,.12); color:var(--primary); font-size:13px; font-weight:700; text-shadow:0 0 3px #fff,0 1px 2px #fff; } +.timetable-grid td[data-status=busy] .timetable-status-button { border-color:rgba(185,28,28,.75); background:rgba(254,226,226,.14); color:#991b1b; } +.timetable-grid td[data-status=unknown] .timetable-status-button { border-color:rgba(180,83,9,.65); background:rgba(255,247,231,.14); color:#92400e; } .timetable-status-button:hover { outline:2px solid currentColor; outline-offset:1px; } .timetable-status-button:focus-visible { outline:3px solid var(--primary); outline-offset:2px; } .timetable-status-button:disabled { opacity:1; cursor:default; } -.timetable-review-panel #timetable-confirmation-state { padding:4px 6px; border-radius:4px; color:var(--ink); background:rgba(255,255,255,.7); } -.timetable-review-panel .form-actions { margin-top:10px; } +#timetable-review-actions { margin-top:12px; } +#timetable-review-actions .form-actions { margin-top:10px; } .timetable-recognition-notes { margin-top:12px; font-size:13px; } .timetable-recognition-notes summary { cursor:pointer; color:var(--muted); } .timetable-grid-wrap { overflow-x:auto; margin:16px 0; } diff --git a/dist/index.html b/dist/index.html index 7e57585..4d60c12 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ WorkLog · 活动记录 - +
@@ -322,7 +322,7 @@ - +
diff --git a/dist/js/app.js b/dist/js/app.js index 2091711..9e6821e 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -1254,7 +1254,7 @@ const slots = timetableData.slots, days = timetableData.days; const statusLabels = { unknown: '待确认', busy: '有课', free: '无课' }; modal(`

${weekLabel(item.week_type)}课表 · ${editable ? '核对与修改' : '查看'}

-
+
课表原图

正在加载原图…

+
识别说明

${item.structure.warnings.map(esc).join('
')}

`); $('#modal-root .modal').classList.add('timetable-editor'); @@ -1286,12 +1288,20 @@ imageUrl = URL.createObjectURL(blob); img.src = imageUrl; imageStatus.textContent = ''; imageStatus.classList.add('hidden'); }).catch(error => { imageStatus.textContent = error.message; }); const stage = $('#timetable-review-stage'), reviewButton = $('#timetable-review-toggle'); + const reviewActions = $('#timetable-review-actions'), peekButton = $('#timetable-peek-image'); reviewButton.addEventListener('click', () => { const open = form.hidden; - form.hidden = !open; stage.classList.toggle('is-reviewing', open); + form.hidden = !open; reviewActions.hidden = !open; peekButton.hidden = !open; + stage.classList.toggle('is-reviewing', open); stage.classList.remove('is-peeking'); + peekButton.setAttribute('aria-pressed', 'false'); peekButton.textContent = '看清原图'; reviewButton.setAttribute('aria-expanded', String(open)); reviewButton.textContent = open ? (editable ? '收起校对' : '收起时段') : (editable ? '校对课表' : '查看时段'); }); + peekButton.addEventListener('click', () => { + const peeking = stage.classList.toggle('is-peeking'); + peekButton.setAttribute('aria-pressed', String(peeking)); + peekButton.textContent = peeking ? '恢复校对标注' : '看清原图'; + }); $('#timetable-image-zoom').addEventListener('click', event => { const expanded = stage.classList.toggle('is-expanded'); event.currentTarget.setAttribute('aria-pressed', String(expanded)); @@ -1308,11 +1318,11 @@ const setCellStatus = (button, status) => { button.dataset.value = status; button.textContent = statusLabels[status]; button.closest('td').dataset.status = status; - form.querySelector('.form-error').textContent = ''; + $('#timetable-review-error').textContent = ''; const cell = cells[Number(button.dataset.cell)], slot = slots.find(slot => slot.id === cell.slot); button.setAttribute('aria-label', `${days[cell.day-1]}${slot.label}:${statusLabels[status]}`); button.setAttribute('aria-pressed', String(status === 'busy')); - form.querySelector('#timetable-confirmation-state').textContent = '有未保存修改,请重新保存并确认。'; + $('#timetable-confirmation-state').textContent = '有未保存修改,请重新保存并确认。'; updateSummary(); }; form.querySelectorAll('[data-cell]').forEach(button => button.addEventListener('click', () => { @@ -1326,13 +1336,13 @@ event.preventDefault(); if (saving) return; const confirm = event.submitter?.dataset.confirm === 'true'; const edited = cells.map((cell,index) => ({ day: cell.day, slot: cell.slot, status: form.querySelector(`[data-cell="${index}"]`).dataset.value, courses: '' })); - const errorBox = form.querySelector('.form-error'); errorBox.textContent = ''; + const errorBox = $('#timetable-review-error'); errorBox.textContent = ''; if (confirm && edited.some(cell => cell.status === 'unknown')) { errorBox.textContent = '仍有待确认时段,请核对后再确认'; return; } - saving = true; form.querySelectorAll('button').forEach(button => button.disabled = true); + saving = true; document.querySelectorAll('#timetable-correction-form button, #timetable-review-actions button').forEach(button => button.disabled = true); try { await api('/timetables/me/' + item.week_type, { method: 'PATCH', body: { revision: item.revision, cells: edited, confirm } }); closeModal(); toast(confirm ? '课表已核对确认' : '草稿已保存'); loadTimetables(); - } catch (error) { errorBox.textContent = error.message; saving = false; form.querySelectorAll('button').forEach(button => button.disabled = false); } + } catch (error) { errorBox.textContent = error.message; saving = false; document.querySelectorAll('#timetable-correction-form button, #timetable-review-actions button').forEach(button => button.disabled = false); } }); }