实验视图

This commit is contained in:
2026-08-10 19:04:29 +08:00 Unverified
parent a942fe34ca
commit 04c693a981
3 changed files with 120 additions and 2 deletions
+14 -1
View File
@@ -90,6 +90,18 @@ const modeLabels: Record<string, string> = {
Centralized: '集中安排',
SelfScheduled: '自主预约',
}
const weekdayLabels = ['', '周一', '周二', '周三', '周四', '周五', '周六', '周日']
function projectScheduleLabel(project: any) {
const entry = project.scheduleEntry
if (!entry) return modeLabels[project.arrangementMode] ?? '待安排'
const week = project.scheduleWeek ?? '—'
const endPeriod = entry.startPeriod + entry.periodCount - 1
const periods = entry.periodCount === 1
? `${entry.startPeriod}`
: `${entry.startPeriod}${endPeriod}`
return `${week} 周 · ${weekdayLabels[entry.dayOfWeek] ?? `${entry.dayOfWeek}`} · ${periods}`
}
const schemeWeightTotal = computed(() =>
schemeForm.items.reduce((sum, item) => sum + Number(item.weight || 0), 0),
@@ -583,7 +595,7 @@ onMounted(async () => {
<template #default="{ row }">
<div class="course-project-name">
<b>{{ row.code }} · {{ row.name }}</b>
<small>{{ modeLabels[row.arrangementMode] }}</small>
<small>{{ projectScheduleLabel(row) }}</small>
</div>
</template>
</el-table-column>
@@ -680,6 +692,7 @@ onMounted(async () => {
<span>{{ detail.projectCode }} · {{ modeLabels[detail.arrangementMode] }}</span>
<h3>{{ detail.projectName }}</h3>
<p>{{ detail.courseCode }} · {{ detail.courseName }} · {{ detail.termName }}</p>
<p class="project-schedule">{{ projectScheduleLabel(detail) }}</p>
</div>
<div class="workbench-status">
<el-tag :type="statusTypes[detail.status] as any" effect="dark">{{ statusLabels[detail.status] }}</el-tag>