排课前检查
This commit is contained in:
@@ -807,6 +807,16 @@ function changeEntryKind() {
|
||||
}
|
||||
}
|
||||
|
||||
async function preflightSchedule() {
|
||||
try {
|
||||
const { data } = await http.get(`/schedules/plans/${selected.value.id}/preflight`)
|
||||
const message = data.unscheduledTasks
|
||||
? `尚有 ${data.unscheduledTasks} 个教学班未安排:\n${data.messages.join('\n')}`
|
||||
: '当前草稿已覆盖全部需要排课的教学班。'
|
||||
await ElMessageBox.alert(message, `排课前检查 · 已覆盖 ${data.scheduledTasks}/${data.totalTasks}`, { confirmButtonText: '知道了' })
|
||||
} catch (error) { ElMessage.error(apiErrorMessage(error)) }
|
||||
}
|
||||
|
||||
async function saveEntry() {
|
||||
if (!entryForm.teachingTaskId ||
|
||||
((entryForm.kind === 'Experiment' ||
|
||||
@@ -937,6 +947,13 @@ onBeforeUnmount(() => {
|
||||
>
|
||||
复制调整
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="isDraft"
|
||||
:disabled="scheduleJobLoading"
|
||||
@click="preflightSchedule"
|
||||
>
|
||||
排课前检查
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="isDraft"
|
||||
type="warning"
|
||||
|
||||
Reference in New Issue
Block a user