学年学期页面新增“设为当前”“归档”“撤销归档”,当前学期不能归档、删除或直接取消;已归档学期需先撤销才能重新设为当前。[BaseDataController.cs (line 286)](/E:/jiaowu/src/Jiaowu.Api/Controllers/BaseDataController.cs:286)
切换后,其他学期自动变为历史态;已归档学期进一步弱化。所有主要学期选择器统一默认当前,并显示“当前 / 历史 / 已归档”。[academicTerms.ts (line 1)](/E:/jiaowu/web/src/utils/academicTerms.ts:1) 桌面使用分层表格,390px 手机端改为独立学期卡片,操作不会再挤压表格。[BaseDataView.vue (line 211)](/E:/jiaowu/web/src/views/BaseDataView.vue:211) 归档定义为“历史显示状态”,不是成绩冻结:补考成绩仍可录入并回写,已发布成绩仍可走成绩更正审批。 已加入 SQLite 开发迁移、MySQL 正式迁移和切换/归档/撤销测试。[20260726143000_AcademicTermArchiving.cs (line 1)](/E:/jiaowu/src/Jiaowu.Api/Infrastructure/Persistence/Migrations/MySql/20260726143000_AcademicTermArchiving.cs:1)
This commit is contained in:
@@ -182,6 +182,160 @@ button { cursor: pointer; }
|
||||
.table-toolbar .el-input { width: min(340px, 60vw); }
|
||||
.table-toolbar > span { margin-left: auto; color: var(--muted); font-size: 11px; }
|
||||
.data-table { min-height: 360px; }
|
||||
|
||||
.el-select-dropdown__item.academic-term-option {
|
||||
transition: color 160ms ease, opacity 160ms ease, background-color 160ms ease;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.academic-term-option--current {
|
||||
color: #17694b;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.academic-term-option--historical {
|
||||
color: #6f7d8c;
|
||||
opacity: .76;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.academic-term-option--archived {
|
||||
color: #98a2ad;
|
||||
opacity: .62;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.academic-term-option--historical.is-hovering,
|
||||
.el-select-dropdown__item.academic-term-option--archived.is-hovering {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.academic-term-row--historical > .el-table__cell {
|
||||
color: #73808e;
|
||||
opacity: .78;
|
||||
}
|
||||
|
||||
.academic-term-row--archived > .el-table__cell {
|
||||
color: #8e98a3;
|
||||
background: #f8fafc;
|
||||
opacity: .66;
|
||||
}
|
||||
|
||||
.academic-term-row--historical:hover > .el-table__cell,
|
||||
.academic-term-row--archived:hover > .el-table__cell {
|
||||
opacity: .94;
|
||||
}
|
||||
|
||||
.historical-record {
|
||||
opacity: .68;
|
||||
filter: saturate(.72);
|
||||
}
|
||||
|
||||
.historical-record:hover,
|
||||
.historical-record.active {
|
||||
opacity: 1;
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.archived-record {
|
||||
opacity: .54;
|
||||
filter: grayscale(.18) saturate(.58);
|
||||
}
|
||||
|
||||
.archived-record:hover,
|
||||
.archived-record.active {
|
||||
opacity: .92;
|
||||
}
|
||||
|
||||
.term-policy-note {
|
||||
margin: 0 0 14px;
|
||||
}
|
||||
|
||||
.field-help {
|
||||
margin-left: 10px;
|
||||
color: #8994a1;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.term-mobile-list {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.term-desktop-table {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.term-mobile-list {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.term-mobile-list article {
|
||||
border: 1px solid #e5e9ef;
|
||||
border-radius: 12px;
|
||||
background: #fff;
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.term-mobile-list article.academic-term-row--historical {
|
||||
color: #73808e;
|
||||
opacity: .78;
|
||||
}
|
||||
|
||||
.term-mobile-list article.academic-term-row--archived {
|
||||
color: #8e98a3;
|
||||
background: #f8fafc;
|
||||
opacity: .66;
|
||||
}
|
||||
|
||||
.term-mobile-list article:focus-within,
|
||||
.term-mobile-list article:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.term-mobile-list header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.term-mobile-list header span:first-child {
|
||||
color: #258779;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
letter-spacing: .06em;
|
||||
}
|
||||
|
||||
.term-mobile-list h3 {
|
||||
margin: 5px 0 3px;
|
||||
color: inherit;
|
||||
font-size: 15px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.term-mobile-list p {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.term-history-label {
|
||||
white-space: nowrap;
|
||||
color: #7c8895;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.term-mobile-list footer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #edf0f4;
|
||||
}
|
||||
|
||||
.term-mobile-list footer .el-button {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
.el-table th.el-table__cell { color: #596274; background: #fafbfc; font-size: 12px; font-weight: 650; }
|
||||
.el-table .cell { font-size: 12px; }
|
||||
.table-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--teal); }
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
export interface AcademicTermLike {
|
||||
id: string
|
||||
name: string
|
||||
isCurrent?: boolean
|
||||
isArchived?: boolean
|
||||
isEnabled?: boolean
|
||||
hasPublishedTimetable?: boolean
|
||||
}
|
||||
|
||||
export function academicTermLabel(term: AcademicTermLike): string {
|
||||
if (term.isCurrent) return `${term.name} · 当前`
|
||||
if (term.isArchived) return `${term.name} · 已归档`
|
||||
return `${term.name} · 历史`
|
||||
}
|
||||
|
||||
export function academicTermOptionClass(term: AcademicTermLike): string {
|
||||
if (term.isCurrent) return 'academic-term-option academic-term-option--current'
|
||||
if (term.isArchived) return 'academic-term-option academic-term-option--archived'
|
||||
return 'academic-term-option academic-term-option--historical'
|
||||
}
|
||||
|
||||
export function defaultAcademicTermId(
|
||||
terms: AcademicTermLike[],
|
||||
requirePublishedTimetable = false,
|
||||
): string | undefined {
|
||||
const usable = requirePublishedTimetable
|
||||
? terms.filter((term) => term.hasPublishedTimetable)
|
||||
: terms
|
||||
return usable.find((term) => term.isCurrent)?.id
|
||||
?? usable.find((term) => !term.isArchived)?.id
|
||||
?? usable[0]?.id
|
||||
}
|
||||
|
||||
export function academicTermRowClass(term: {
|
||||
isCurrent?: boolean
|
||||
isArchived?: boolean
|
||||
}): string {
|
||||
if (term.isCurrent) return 'academic-term-row academic-term-row--current'
|
||||
if (term.isArchived) return 'academic-term-row academic-term-row--archived'
|
||||
return 'academic-term-row academic-term-row--historical'
|
||||
}
|
||||
@@ -5,9 +5,19 @@ import { useRoute } from 'vue-router'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { downloadApiFile, importExcel } from '../api/excel'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermRowClass } from '../utils/academicTerms'
|
||||
|
||||
type Kind = 'campuses' | 'colleges' | 'majors' | 'classes' | 'terms' | 'buildings' | 'classrooms' | 'course-categories'
|
||||
interface Row { id: string; code: string; name: string; isEnabled: boolean; [key: string]: unknown }
|
||||
interface Row {
|
||||
id: string
|
||||
code: string
|
||||
name: string
|
||||
isEnabled: boolean
|
||||
academicYear?: string
|
||||
isCurrent?: boolean
|
||||
isArchived?: boolean
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
const allTabs: { key: Kind; label: string; hint: string }[] = [
|
||||
{ key: 'campuses', label: '校区', hint: '学校的物理校区' },
|
||||
@@ -210,6 +220,47 @@ async function remove(row: any) {
|
||||
}
|
||||
}
|
||||
|
||||
function termTableRowClass({ row }: { row: any }) {
|
||||
return active.value === 'terms' ? academicTermRowClass(row) : ''
|
||||
}
|
||||
|
||||
async function setCurrentTerm(row: any) {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`将“${row.name}”切换为当前学期?其他学期会自动转为历史显示,但不会自动归档,也不会冻结成绩和补考。`,
|
||||
'切换当前学期',
|
||||
{ type: 'warning', confirmButtonText: '切换为当前', cancelButtonText: '取消' },
|
||||
)
|
||||
await http.post(`/base-data/terms/${row.id}/set-current`)
|
||||
ElMessage.success(`当前学期已切换为“${row.name}”`)
|
||||
await load()
|
||||
} catch (error: any) {
|
||||
if (error !== 'cancel' && error !== 'close') ElMessage.error(apiErrorMessage(error))
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleTermArchive(row: any) {
|
||||
const restoring = row.isArchived
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
restoring
|
||||
? `撤销“${row.name}”的归档状态?撤销后仍作为历史学期显示,可再次设为当前。`
|
||||
: `归档“${row.name}”?归档只降低历史数据的显示优先级,不会冻结成绩更正或补考成绩录入。`,
|
||||
restoring ? '撤销学期归档' : '归档学期',
|
||||
{
|
||||
type: restoring ? 'info' : 'warning',
|
||||
confirmButtonText: restoring ? '撤销归档' : '确认归档',
|
||||
cancelButtonText: '取消',
|
||||
},
|
||||
)
|
||||
await http.post(`/base-data/terms/${row.id}/${restoring ? 'unarchive' : 'archive'}`)
|
||||
ElMessage.success(restoring ? '已撤销归档' : '学期已归档')
|
||||
await load()
|
||||
} catch (error: any) {
|
||||
if (error !== 'cancel' && error !== 'close') ElMessage.error(apiErrorMessage(error))
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await Promise.all([load(), loadReferences()])
|
||||
})
|
||||
@@ -276,7 +327,65 @@ watch(
|
||||
<span>共 {{ filteredRows.length }} 条</span>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" :data="filteredRows" class="data-table">
|
||||
<el-alert
|
||||
v-if="active === 'terms'"
|
||||
class="term-policy-note"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
title="切换当前学期只改变默认工作学期;归档需手动执行,归档后仍可处理补考与成绩更正。"
|
||||
/>
|
||||
|
||||
<div v-if="active === 'terms'" class="term-mobile-list">
|
||||
<article
|
||||
v-for="row in filteredRows"
|
||||
:key="row.id"
|
||||
:class="academicTermRowClass(row)"
|
||||
>
|
||||
<header>
|
||||
<div>
|
||||
<span>{{ row.code }}</span>
|
||||
<h3>{{ row.name }}</h3>
|
||||
<p>{{ row.academicYear }}</p>
|
||||
</div>
|
||||
<el-tag v-if="row.isCurrent" type="success">当前</el-tag>
|
||||
<el-tag v-else-if="row.isArchived" type="info">已归档</el-tag>
|
||||
<span v-else class="term-history-label">历史学期</span>
|
||||
</header>
|
||||
<footer v-if="canManage">
|
||||
<el-button
|
||||
v-if="!row.isCurrent && !row.isArchived"
|
||||
size="small"
|
||||
type="success"
|
||||
plain
|
||||
@click="setCurrentTerm(row)"
|
||||
>设为当前</el-button>
|
||||
<el-button
|
||||
v-if="!row.isCurrent"
|
||||
size="small"
|
||||
:type="row.isArchived ? 'primary' : 'warning'"
|
||||
plain
|
||||
@click="toggleTermArchive(row)"
|
||||
>{{ row.isArchived ? '撤销归档' : '归档' }}</el-button>
|
||||
<el-button size="small" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button
|
||||
v-if="!row.isCurrent"
|
||||
size="small"
|
||||
type="danger"
|
||||
plain
|
||||
@click="remove(row)"
|
||||
>删除</el-button>
|
||||
</footer>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="filteredRows"
|
||||
:row-class-name="termTableRowClass"
|
||||
class="data-table"
|
||||
:class="{ 'term-desktop-table': active === 'terms' }"
|
||||
>
|
||||
<el-table-column prop="code" label="编码" min-width="130" />
|
||||
<el-table-column prop="name" label="名称" min-width="180" />
|
||||
<el-table-column v-if="active === 'colleges'" prop="campusName" label="所属校区" min-width="140" />
|
||||
@@ -288,8 +397,12 @@ watch(
|
||||
<template #default="{ row }">{{ row.counselorName || '未分配' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="active === 'terms'" prop="academicYear" label="学年" width="120" />
|
||||
<el-table-column v-if="active === 'terms'" label="当前学期" width="100">
|
||||
<template #default="{ row }"><el-tag v-if="row.isCurrent" type="success">当前</el-tag><span v-else>—</span></template>
|
||||
<el-table-column v-if="active === 'terms'" label="运行状态" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.isCurrent" type="success">当前</el-tag>
|
||||
<el-tag v-else-if="row.isArchived" type="info">已归档</el-tag>
|
||||
<span v-else>历史学期</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="active === 'buildings'" prop="campusName" label="所属校区" min-width="140" />
|
||||
<el-table-column v-if="active === 'classrooms'" prop="buildingName" label="教学楼" min-width="130" />
|
||||
@@ -299,10 +412,34 @@ watch(
|
||||
<span class="table-status" :class="{ off: !row.isEnabled }">{{ row.isEnabled ? '启用' : '停用' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="canManage" label="操作" width="150" fixed="right">
|
||||
<el-table-column
|
||||
v-if="canManage"
|
||||
label="操作"
|
||||
:width="active === 'terms' ? 280 : 150"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<template v-if="active === 'terms'">
|
||||
<el-button
|
||||
v-if="!row.isCurrent && !row.isArchived"
|
||||
link
|
||||
type="success"
|
||||
@click="setCurrentTerm(row)"
|
||||
>设为当前</el-button>
|
||||
<el-button
|
||||
v-if="!row.isCurrent"
|
||||
link
|
||||
:type="row.isArchived ? 'primary' : 'warning'"
|
||||
@click="toggleTermArchive(row)"
|
||||
>{{ row.isArchived ? '撤销归档' : '归档' }}</el-button>
|
||||
</template>
|
||||
<el-button link type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button link type="danger" @click="remove(row)">删除</el-button>
|
||||
<el-button
|
||||
v-if="active !== 'terms' || !row.isCurrent"
|
||||
link
|
||||
type="danger"
|
||||
@click="remove(row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #empty><el-empty description="暂无数据,点击右上角开始新增" /></template>
|
||||
@@ -366,7 +503,12 @@ watch(
|
||||
<el-form-item label="开始日期"><el-date-picker v-model="form.startDate" value-format="YYYY-MM-DD" /></el-form-item>
|
||||
<el-form-item label="结束日期"><el-date-picker v-model="form.endDate" value-format="YYYY-MM-DD" /></el-form-item>
|
||||
</div>
|
||||
<el-form-item><el-checkbox v-model="form.isCurrent">设为当前学期</el-checkbox></el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.isCurrent" :disabled="form.isArchived">
|
||||
设为当前学期
|
||||
</el-checkbox>
|
||||
<span v-if="form.isArchived" class="field-help">已归档学期需先撤销归档。</span>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item v-if="active === 'classrooms'" label="所属教学楼" required>
|
||||
<el-select v-model="form.buildingId">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Bell, Check, Plus, Refresh } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const isManager = computed(() =>
|
||||
@@ -172,7 +173,7 @@ onMounted(async () => {
|
||||
])
|
||||
terms.value = termRes.data
|
||||
tasks.value = taskRes.data.items
|
||||
termId.value = terms.value.find(t => t.isCurrent)?.id
|
||||
termId.value = defaultAcademicTermId(terms.value)
|
||||
} catch (_) {}
|
||||
await load()
|
||||
})
|
||||
@@ -204,7 +205,7 @@ function showCancel(type: string) { return type === 'Cancel' }
|
||||
|
||||
<section class="adj-toolbar">
|
||||
<el-select v-model="termId" clearable placeholder="全部学期" @change="load">
|
||||
<el-option v-for="t in terms" :key="t.id" :label="t.name" :value="t.id" />
|
||||
<el-option v-for="t in terms" :key="t.id" :label="academicTermLabel(t)" :value="t.id" :class="academicTermOptionClass(t)" />
|
||||
</el-select>
|
||||
<el-segmented v-model="tab" :options="[
|
||||
...(isTeacher ? [{ label: '我的申请', value: 'mine' }] : []),
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
} from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const managerRoles = ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin']
|
||||
@@ -309,6 +310,8 @@ async function loadRounds(keepSelection = true) {
|
||||
rounds.value = (await http.get('/course-selections/rounds')).data
|
||||
const previousId = keepSelection ? selectedRound.value?.id : undefined
|
||||
const preferred = rounds.value.find((item) => item.id === previousId)
|
||||
?? rounds.value.find((item) => item.isAvailableNow && item.termIsCurrent)
|
||||
?? rounds.value.find((item) => item.termIsCurrent)
|
||||
?? rounds.value.find((item) => item.isAvailableNow)
|
||||
?? rounds.value[0]
|
||||
if (preferred) await selectRound(preferred)
|
||||
@@ -362,12 +365,11 @@ async function loadTasks(academicTermId: string) {
|
||||
|
||||
function openRound(round?: any) {
|
||||
editingRoundId.value = round?.id ?? ''
|
||||
const currentTerm = terms.value.find((item) => item.isCurrent)
|
||||
const now = new Date()
|
||||
const ends = new Date(now.getTime() + 7 * 86400000)
|
||||
const withdrawal = new Date(now.getTime() + 14 * 86400000)
|
||||
Object.assign(roundForm, {
|
||||
academicTermId: round?.academicTermId ?? currentTerm?.id,
|
||||
academicTermId: round?.academicTermId ?? defaultAcademicTermId(terms.value),
|
||||
name: round?.name ?? '',
|
||||
startsAt: round ? toPickerValue(round.startsAt) : toPickerValue(now.toISOString()),
|
||||
endsAt: round ? toPickerValue(round.endsAt) : toPickerValue(ends.toISOString()),
|
||||
@@ -719,7 +721,11 @@ onMounted(async () => {
|
||||
v-for="round in rounds"
|
||||
:key="round.id"
|
||||
type="button"
|
||||
:class="{ active: selectedRound?.id === round.id }"
|
||||
:class="{
|
||||
active: selectedRound?.id === round.id,
|
||||
'historical-record': !round.termIsCurrent && !round.termIsArchived,
|
||||
'archived-record': round.termIsArchived,
|
||||
}"
|
||||
@click="selectRound(round)"
|
||||
>
|
||||
<span>{{ round.termName }}</span>
|
||||
@@ -1056,7 +1062,7 @@ onMounted(async () => {
|
||||
<div class="form-grid">
|
||||
<el-form-item label="开课学期" required>
|
||||
<el-select v-model="roundForm.academicTermId">
|
||||
<el-option v-for="term in terms" :key="term.id" :label="term.name" :value="term.id" />
|
||||
<el-option v-for="term in terms" :key="term.id" :label="academicTermLabel(term)" :value="term.id" :class="academicTermOptionClass(term)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次名称" required>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Delete, Edit, Lock, Plus, Unlock } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, academicTermRowClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const roles = computed(() => auth.user?.roles ?? [])
|
||||
@@ -31,7 +32,7 @@ function addDim() { setupForm.dimensions.push({ name: '', maxScore: 10 }) }
|
||||
function removeDim(i: number) { setupForm.dimensions.splice(i, 1) }
|
||||
|
||||
function resetSetupForm() {
|
||||
setupForm.academicTermId = undefined
|
||||
setupForm.academicTermId = defaultAcademicTermId(terms.value)
|
||||
setupForm.name = ''
|
||||
setupForm.startsAt = ''
|
||||
setupForm.endsAt = ''
|
||||
@@ -43,6 +44,13 @@ function resetSetupForm() {
|
||||
]
|
||||
}
|
||||
|
||||
function setupRowClass({ row }: { row: any }) {
|
||||
return academicTermRowClass({
|
||||
isCurrent: row.termIsCurrent,
|
||||
isArchived: row.termIsArchived,
|
||||
})
|
||||
}
|
||||
|
||||
async function loadSetups() {
|
||||
setupLoading.value = true
|
||||
try { setups.value = (await http.get('/evaluations/setups')).data }
|
||||
@@ -207,7 +215,7 @@ onMounted(async () => {
|
||||
<div style="display:flex;justify-content:flex-end;margin-bottom:12px">
|
||||
<el-button v-if="isAdmin" type="primary" :icon="Plus" @click="openCreate">新建方案</el-button>
|
||||
</div>
|
||||
<el-table :data="setups" size="small" empty-text="暂无评教方案">
|
||||
<el-table :data="setups" :row-class-name="setupRowClass" size="small" empty-text="暂无评教方案">
|
||||
<el-table-column prop="name" label="方案名称" min-width="200" />
|
||||
<el-table-column prop="termName" label="学期" width="140" />
|
||||
<el-table-column label="状态" width="90">
|
||||
@@ -273,7 +281,7 @@ onMounted(async () => {
|
||||
<div class="form-grid">
|
||||
<el-form-item label="学期">
|
||||
<el-select v-model="setupForm.academicTermId" placeholder="选择学期" :disabled="!!editingSetup">
|
||||
<el-option v-for="t in terms" :key="t.id" :label="t.name" :value="t.id" />
|
||||
<el-option v-for="t in terms" :key="t.id" :label="academicTermLabel(t)" :value="t.id" :class="academicTermOptionClass(t)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Plus, Promotion, Refresh, UserFilled, Setting } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const isManager = computed(() =>
|
||||
@@ -53,7 +54,9 @@ async function load() {
|
||||
return
|
||||
}
|
||||
plans.value = (await http.get('/exams/plans')).data
|
||||
const plan = plans.value.find((x) => x.id === selected.value?.id) ?? plans.value[0]
|
||||
const plan = plans.value.find((x) => x.id === selected.value?.id)
|
||||
?? plans.value.find((x) => x.termIsCurrent)
|
||||
?? plans.value[0]
|
||||
if (plan) await selectPlan(plan.id)
|
||||
} catch (error) { ElMessage.error(apiErrorMessage(error)) }
|
||||
finally { loading.value = false }
|
||||
@@ -63,7 +66,7 @@ async function selectPlan(id: string) {
|
||||
}
|
||||
function openPlan() {
|
||||
Object.assign(planForm, {
|
||||
academicTermId: terms.value.find((x) => x.isCurrent)?.id,
|
||||
academicTermId: defaultAcademicTermId(terms.value),
|
||||
name: '', notes: '',
|
||||
})
|
||||
planDialog.value = true
|
||||
@@ -196,7 +199,7 @@ onMounted(async () => {
|
||||
|
||||
<template v-if="isManager">
|
||||
<section class="exam-plan-strip">
|
||||
<button v-for="plan in plans" :key="plan.id" :class="{ active: selected?.id === plan.id }" @click="selectPlan(plan.id)">
|
||||
<button v-for="plan in plans" :key="plan.id" :class="{ active: selected?.id === plan.id, 'historical-record': !plan.termIsCurrent && !plan.termIsArchived, 'archived-record': plan.termIsArchived }" @click="selectPlan(plan.id)">
|
||||
<span>{{ plan.termName }}</span><b>{{ plan.name }}</b>
|
||||
<small>{{ plan.sessionCount }} 个场次</small><i>{{ statusLabels[plan.status] }}</i>
|
||||
</button>
|
||||
@@ -271,7 +274,7 @@ onMounted(async () => {
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="学期">
|
||||
<el-select v-model="planForm.academicTermId">
|
||||
<el-option v-for="x in terms" :key="x.id" :label="x.name" :value="x.id" />
|
||||
<el-option v-for="x in terms" :key="x.id" :label="academicTermLabel(x)" :value="x.id" :class="academicTermOptionClass(x)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划名称"><el-input v-model="planForm.name" maxlength="120" /></el-form-item>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Location, Refresh, Search } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { academicTermLabel, academicTermOptionClass } from '../utils/academicTerms'
|
||||
|
||||
interface TermOption {
|
||||
id: string
|
||||
@@ -9,6 +10,7 @@ interface TermOption {
|
||||
startDate: string
|
||||
endDate: string
|
||||
isCurrent: boolean
|
||||
isArchived: boolean
|
||||
hasPublishedTimetable: boolean
|
||||
}
|
||||
|
||||
@@ -205,8 +207,9 @@ onMounted(async () => {
|
||||
<el-option
|
||||
v-for="term in terms"
|
||||
:key="term.id"
|
||||
:label="term.name"
|
||||
:label="academicTermLabel(term)"
|
||||
:value="term.id"
|
||||
:class="academicTermOptionClass(term)"
|
||||
:disabled="!term.hasPublishedTimetable"
|
||||
>
|
||||
<span>{{ term.name }}</span>
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { downloadApiFile, importExcel } from '../api/excel'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const isStudent = computed(() => auth.user?.roles.includes('Student') &&
|
||||
@@ -351,7 +352,7 @@ function calcPreviewTotal(record: any): number | null {
|
||||
onMounted(async () => {
|
||||
try {
|
||||
terms.value = (await http.get('/base-data/terms')).data
|
||||
termId.value = terms.value.find((item) => item.isCurrent)?.id
|
||||
termId.value = defaultAcademicTermId(terms.value)
|
||||
await load()
|
||||
} catch (error) {
|
||||
ElMessage.error(apiErrorMessage(error))
|
||||
@@ -381,7 +382,7 @@ onMounted(async () => {
|
||||
<label>
|
||||
<span>查看学期</span>
|
||||
<el-select v-model="termId" clearable placeholder="全部学期" @change="load">
|
||||
<el-option v-for="term in terms" :key="term.id" :label="term.name" :value="term.id" />
|
||||
<el-option v-for="term in terms" :key="term.id" :label="academicTermLabel(term)" :value="term.id" :class="academicTermOptionClass(term)" />
|
||||
</el-select>
|
||||
</label>
|
||||
</section>
|
||||
@@ -421,7 +422,7 @@ onMounted(async () => {
|
||||
<template v-else>
|
||||
<section class="grade-toolbar">
|
||||
<el-select v-model="termId" clearable placeholder="全部学期" @change="load">
|
||||
<el-option v-for="term in terms" :key="term.id" :label="term.name" :value="term.id" />
|
||||
<el-option v-for="term in terms" :key="term.id" :label="academicTermLabel(term)" :value="term.id" :class="academicTermOptionClass(term)" />
|
||||
</el-select>
|
||||
<el-select v-model="status" clearable placeholder="全部状态" @change="load">
|
||||
<el-option v-for="(label, value) in statusLabels" :key="value" :label="label" :value="value" />
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Plus, Promotion, Refresh, UserFilled, Setting, Search, MagicStick } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const isManager = computed(() =>
|
||||
@@ -66,7 +67,9 @@ async function load() {
|
||||
return
|
||||
}
|
||||
plans.value = (await http.get('/makeup-exams/plans')).data
|
||||
const plan = plans.value.find((x) => x.id === selected.value?.id) ?? plans.value[0]
|
||||
const plan = plans.value.find((x) => x.id === selected.value?.id)
|
||||
?? plans.value.find((x) => x.termIsCurrent)
|
||||
?? plans.value[0]
|
||||
if (plan) await selectPlan(plan.id)
|
||||
} catch (error) { ElMessage.error(apiErrorMessage(error)) }
|
||||
finally { loading.value = false }
|
||||
@@ -76,7 +79,7 @@ async function selectPlan(id: string) {
|
||||
}
|
||||
function openPlan() {
|
||||
Object.assign(planForm, {
|
||||
academicTermId: terms.value.find((x) => x.isCurrent)?.id,
|
||||
academicTermId: defaultAcademicTermId(terms.value),
|
||||
name: '', notes: '',
|
||||
})
|
||||
planDialog.value = true
|
||||
@@ -339,7 +342,7 @@ onMounted(async () => {
|
||||
|
||||
<template v-if="isManager">
|
||||
<section class="exam-plan-strip">
|
||||
<button v-for="plan in plans" :key="plan.id" :class="{ active: selected?.id === plan.id }" @click="selectPlan(plan.id)">
|
||||
<button v-for="plan in plans" :key="plan.id" :class="{ active: selected?.id === plan.id, 'historical-record': !plan.termIsCurrent && !plan.termIsArchived, 'archived-record': plan.termIsArchived }" @click="selectPlan(plan.id)">
|
||||
<span>{{ plan.termName }}</span><b>{{ plan.name }}</b>
|
||||
<small>{{ plan.sessionCount }} 个场次</small><i>{{ statusLabels[plan.status] }}</i>
|
||||
</button>
|
||||
@@ -478,7 +481,7 @@ onMounted(async () => {
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="学期">
|
||||
<el-select v-model="planForm.academicTermId">
|
||||
<el-option v-for="x in terms" :key="x.id" :label="x.name" :value="x.id" />
|
||||
<el-option v-for="x in terms" :key="x.id" :label="academicTermLabel(x)" :value="x.id" :class="academicTermOptionClass(x)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划名称"><el-input v-model="planForm.name" maxlength="120" /></el-form-item>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { CopyDocument, EditPen, Plus, Promotion, Refresh, Search, Setting } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const plans = ref<any[]>([])
|
||||
const selected = ref<any | null>(null)
|
||||
@@ -749,7 +750,7 @@ onMounted(async () => {
|
||||
classrooms.value = classroomRes.data.filter((item: any) => item.isEnabled)
|
||||
campuses.value = campusRes.data.filter((item: any) => item.isEnabled)
|
||||
buildings.value = buildingRes.data.filter((item: any) => item.isEnabled)
|
||||
termId.value = terms.value.find((item) => item.isCurrent)?.id
|
||||
termId.value = defaultAcademicTermId(terms.value)
|
||||
await Promise.all([loadPlans(false), loadSchedulingSettings()])
|
||||
})
|
||||
|
||||
@@ -775,7 +776,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<section class="schedule-toolbar">
|
||||
<el-select v-model="termId" placeholder="选择学期" @change="changeTerm">
|
||||
<el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" />
|
||||
</el-select>
|
||||
<div class="schedule-version-strip">
|
||||
<button
|
||||
@@ -946,7 +947,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<el-dialog v-model="planDialog" :title="editingPlanId ? '编辑排课版本' : '新建排课版本'" width="560px">
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="学期" required><el-select v-model="planForm.academicTermId"><el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" /></el-select></el-form-item>
|
||||
<el-form-item label="学期" required><el-select v-model="planForm.academicTermId"><el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" /></el-select></el-form-item>
|
||||
<el-form-item label="版本名称" required><el-input v-model="planForm.name" placeholder="如:第一轮正式课表" /></el-form-item>
|
||||
<el-form-item label="版本号" required><el-input v-model="planForm.version" placeholder="如 V1" /></el-form-item>
|
||||
<el-form-item label="备注"><el-input v-model="planForm.notes" type="textarea" :rows="2" /></el-form-item>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { GridComponent, LegendComponent, TitleComponent, TooltipComponent } from
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { downloadApiFile } from '../api/excel'
|
||||
import http from '../api/http'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
echarts.use([BarChart, LineChart, PieChart, TitleComponent, TooltipComponent, LegendComponent, GridComponent, CanvasRenderer])
|
||||
|
||||
@@ -367,10 +368,7 @@ onMounted(async () => {
|
||||
courseCategories.value = catRes.data
|
||||
classroomBuildings.value = bRes.data
|
||||
classroomCampuses.value = campRes.data
|
||||
if (terms.value.length > 0) {
|
||||
const cur = terms.value.find((t: any) => t.isCurrent) ?? terms.value[terms.value.length - 1]
|
||||
globalTermId.value = cur.id
|
||||
}
|
||||
globalTermId.value = defaultAcademicTermId(terms.value) ?? ''
|
||||
loadStudentStats()
|
||||
})
|
||||
</script>
|
||||
@@ -385,7 +383,7 @@ onMounted(async () => {
|
||||
</div>
|
||||
<div class="page-actions">
|
||||
<el-select v-model="globalTermId" placeholder="选择学期" style="width:220px" clearable @change="() => { loadStudentStats(); loadGradeStats(); loadPassRateStats(); loadWorkloadStats(); loadClassroomStats() }">
|
||||
<el-option v-for="t in terms" :key="t.id" :label="t.name" :value="t.id" />
|
||||
<el-option v-for="t in terms" :key="t.id" :label="academicTermLabel(t)" :value="t.id" :class="academicTermOptionClass(t)" />
|
||||
</el-select>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -19,6 +19,7 @@ import { GridComponent, LegendComponent, TooltipComponent } from 'echarts/compon
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { downloadApiFile, importExcel } from '../api/excel'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
echarts.use([
|
||||
LineChart,
|
||||
@@ -592,7 +593,7 @@ onMounted(async () => {
|
||||
window.addEventListener('resize', resizeCharts)
|
||||
clockTimer = window.setInterval(() => { now.value = Date.now() }, 1000)
|
||||
terms.value = (await http.get('/base-data/terms')).data
|
||||
termId.value = terms.value.find((item: any) => item.isCurrent)?.id
|
||||
termId.value = defaultAcademicTermId(terms.value)
|
||||
await loadTasks()
|
||||
})
|
||||
|
||||
@@ -616,7 +617,7 @@ onUnmounted(() => {
|
||||
|
||||
<section class="attendance-toolbar">
|
||||
<el-select v-model="termId" clearable placeholder="全部学期" @change="loadTasks">
|
||||
<el-option v-for="term in terms" :key="term.id" :label="term.name" :value="term.id" />
|
||||
<el-option v-for="term in terms" :key="term.id" :label="academicTermLabel(term)" :value="term.id" :class="academicTermOptionClass(term)" />
|
||||
</el-select>
|
||||
<span>共 {{ tasks.length }} 个教学班</span>
|
||||
<el-radio-group v-model="activeMode" class="mode-switch" size="small">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { onMounted, ref } from 'vue'
|
||||
import { Download, Refresh } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { downloadApiFile } from '../api/excel'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const loading = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
@@ -59,7 +60,7 @@ async function exportRoster() {
|
||||
|
||||
onMounted(async () => {
|
||||
terms.value = (await http.get('/base-data/terms')).data
|
||||
termId.value = terms.value.find((item: any) => item.isCurrent)?.id
|
||||
termId.value = defaultAcademicTermId(terms.value)
|
||||
await loadOfferings()
|
||||
})
|
||||
</script>
|
||||
@@ -77,7 +78,7 @@ onMounted(async () => {
|
||||
|
||||
<section class="roster-toolbar">
|
||||
<el-select v-model="termId" clearable placeholder="全部学期" @change="loadOfferings">
|
||||
<el-option v-for="term in terms" :key="term.id" :label="term.name" :value="term.id" />
|
||||
<el-option v-for="term in terms" :key="term.id" :label="academicTermLabel(term)" :value="term.id" :class="academicTermOptionClass(term)" />
|
||||
</el-select>
|
||||
<span>共 {{ offerings.length }} 个教学班</span>
|
||||
</section>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Plus, Refresh } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const isReviewer = computed(() =>
|
||||
@@ -56,7 +57,7 @@ async function load() {
|
||||
function openSubmit() {
|
||||
Object.assign(form, {
|
||||
academicTermId: filters.academicTermId ??
|
||||
terms.value.find((item) => item.isCurrent)?.id,
|
||||
defaultAcademicTermId(terms.value),
|
||||
courseId: undefined,
|
||||
statement: '',
|
||||
})
|
||||
@@ -118,7 +119,7 @@ async function review() {
|
||||
function openAssignment() {
|
||||
Object.assign(assignmentForm, {
|
||||
academicTermId: filters.academicTermId ??
|
||||
terms.value.find((item) => item.isCurrent)?.id,
|
||||
defaultAcademicTermId(terms.value),
|
||||
teacherId: undefined,
|
||||
courseId: undefined,
|
||||
comment: '',
|
||||
@@ -158,7 +159,7 @@ onMounted(async () => {
|
||||
courses.value = optionRes?.data?.courses ?? []
|
||||
teachers.value = optionRes?.data?.teachers ?? []
|
||||
}
|
||||
filters.academicTermId = terms.value.find((item) => item.isCurrent)?.id
|
||||
filters.academicTermId = defaultAcademicTermId(terms.value)
|
||||
await load()
|
||||
})
|
||||
</script>
|
||||
@@ -195,7 +196,7 @@ onMounted(async () => {
|
||||
<section class="data-card">
|
||||
<div class="filter-bar">
|
||||
<el-select v-model="filters.academicTermId" clearable placeholder="全部学期" @change="load">
|
||||
<el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" />
|
||||
</el-select>
|
||||
<el-select v-model="filters.status" clearable placeholder="全部状态" @change="load">
|
||||
<el-option v-for="(label, value) in statusLabels" :key="value" :label="label" :value="value" />
|
||||
@@ -241,7 +242,7 @@ onMounted(async () => {
|
||||
<div class="form-grid">
|
||||
<el-form-item label="学期" required>
|
||||
<el-select v-model="form.academicTermId">
|
||||
<el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="拟授课程" required>
|
||||
@@ -286,7 +287,7 @@ onMounted(async () => {
|
||||
<el-form label-position="top" style="margin-top: 18px">
|
||||
<el-form-item label="学期" required>
|
||||
<el-select v-model="assignmentForm.academicTermId" style="width: 100%">
|
||||
<el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="form-grid">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Plus, Refresh, Search } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const isSuperAdmin = computed(() => auth.user?.roles.includes('SuperAdmin') ?? false)
|
||||
@@ -283,11 +284,10 @@ function resetFilters() {
|
||||
|
||||
function resetForm(detail?: any) {
|
||||
Object.keys(form).forEach((key) => delete form[key])
|
||||
const currentTerm = terms.value.find((item) => item.isCurrent)
|
||||
Object.assign(form, {
|
||||
taskNumber: '',
|
||||
name: '',
|
||||
academicTermId: currentTerm?.id,
|
||||
academicTermId: defaultAcademicTermId(terms.value),
|
||||
courseId: undefined,
|
||||
capacity: 60,
|
||||
startWeek: 1,
|
||||
@@ -499,9 +499,8 @@ async function batchAction(
|
||||
}
|
||||
|
||||
function openGeneration() {
|
||||
const currentTerm = terms.value.find((item) => item.isCurrent)
|
||||
Object.assign(generationForm, {
|
||||
academicTermId: query.academicTermId ?? currentTerm?.id,
|
||||
academicTermId: query.academicTermId ?? defaultAcademicTermId(terms.value),
|
||||
courseId: undefined,
|
||||
classesPerTask: 3,
|
||||
startWeek: 1,
|
||||
@@ -576,7 +575,7 @@ onMounted(async () => {
|
||||
courses.value = courseRes.data
|
||||
classes.value = classRes.data
|
||||
majors.value = majorRes.data
|
||||
query.academicTermId = terms.value.find((item) => item.isCurrent)?.id
|
||||
query.academicTermId = defaultAcademicTermId(terms.value)
|
||||
await load()
|
||||
})
|
||||
</script>
|
||||
@@ -604,7 +603,7 @@ onMounted(async () => {
|
||||
<div class="filter-bar">
|
||||
<el-input v-model="query.keyword" :prefix-icon="Search" clearable placeholder="搜索任务编号、教学班或课程" @keyup.enter="query.page = 1; load()" />
|
||||
<el-select v-model="query.academicTermId" clearable placeholder="全部学期">
|
||||
<el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" />
|
||||
</el-select>
|
||||
<el-select v-model="query.status" clearable placeholder="全部状态">
|
||||
<el-option v-for="(label, value) in statusLabels" :key="value" :label="label" :value="value" />
|
||||
@@ -712,7 +711,7 @@ onMounted(async () => {
|
||||
<el-form-item label="教学班名称" required><el-input v-model="form.name" /></el-form-item>
|
||||
</div>
|
||||
<div class="form-grid">
|
||||
<el-form-item label="开课学期" required><el-select v-model="form.academicTermId" @change="loadManualEligibleTeachers"><el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" /></el-select></el-form-item>
|
||||
<el-form-item label="开课学期" required><el-select v-model="form.academicTermId" @change="loadManualEligibleTeachers"><el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" /></el-select></el-form-item>
|
||||
<el-form-item label="课程" required>
|
||||
<el-select v-model="form.courseId" filterable @change="form.teacherIds = []; form.primaryTeacherId = undefined; loadManualEligibleTeachers()">
|
||||
<el-option v-for="item in filteredManageableCourses" :key="item.id" :label="`${item.code} · ${item.name}(${item.totalHours} 学时)`" :value="item.id" />
|
||||
@@ -807,7 +806,7 @@ onMounted(async () => {
|
||||
<div class="form-grid">
|
||||
<el-form-item label="开课学期" required>
|
||||
<el-select v-model="generationForm.academicTermId" @change="loadEligibleTeachers">
|
||||
<el-option v-for="item in terms" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option v-for="item in terms" :key="item.id" :label="academicTermLabel(item)" :value="item.id" :class="academicTermOptionClass(item)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="公共课程" required>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useRoute } from 'vue-router'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { downloadApiFile } from '../api/excel'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const route = useRoute()
|
||||
const auth = useAuthStore()
|
||||
@@ -297,9 +298,8 @@ async function loadPublicOptions() {
|
||||
colleges.value = data.colleges
|
||||
majors.value = data.majors
|
||||
classes.value = data.classes
|
||||
termId.value = data.terms.find((item: any) => item.isCurrent)?.id
|
||||
termId.value = defaultAcademicTermId(data.terms)
|
||||
?? data.terms.find((item: any) => item.hasPublishedTimetable)?.id
|
||||
?? data.terms[0]?.id
|
||||
?? ''
|
||||
const initialClass = data.classes.find((item: any) => item.hasPublishedTimetable)
|
||||
?? data.classes[0]
|
||||
@@ -502,9 +502,7 @@ onMounted(async () => {
|
||||
if (isTeacherView.value) {
|
||||
const { data } = await http.get('/timetables/options')
|
||||
terms.value = data.terms
|
||||
termId.value = data.terms.find((item: any) => item.isCurrent)?.id
|
||||
?? data.terms[0]?.id
|
||||
?? ''
|
||||
termId.value = defaultAcademicTermId(data.terms) ?? ''
|
||||
await loadTimetable()
|
||||
return
|
||||
}
|
||||
@@ -539,8 +537,9 @@ onMounted(async () => {
|
||||
<el-option
|
||||
v-for="term in terms"
|
||||
:key="term.id"
|
||||
:label="`${term.name}${!isManager && !term.hasPublishedTimetable ? '(未发布)' : ''}`"
|
||||
:label="`${academicTermLabel(term)}${!isManager && !term.hasPublishedTimetable ? '(未发布)' : ''}`"
|
||||
:value="term.id"
|
||||
:class="academicTermOptionClass(term)"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-if="isManager" v-model="planId" placeholder="选择课表版本">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Check, Refresh, Search } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { academicTermLabel, academicTermOptionClass, defaultAcademicTermId } from '../utils/academicTerms'
|
||||
|
||||
const auth = useAuthStore()
|
||||
const isSuperAdmin = computed(() => auth.user?.roles.includes('SuperAdmin'))
|
||||
@@ -93,7 +94,7 @@ async function acknowledge(w: any) {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try { terms.value = (await http.get('/base-data/terms')).data; termId.value = terms.value.find(t => t.isCurrent)?.id; await load() }
|
||||
try { terms.value = (await http.get('/base-data/terms')).data; termId.value = defaultAcademicTermId(terms.value) ?? ''; await load() }
|
||||
catch (e) { ElMessage.error(apiErrorMessage(e)) }
|
||||
})
|
||||
</script>
|
||||
@@ -103,7 +104,7 @@ onMounted(async () => {
|
||||
<section class="page-intro">
|
||||
<div><span class="section-kicker">ACADEMIC WARNING</span><h2>{{ isStudent ? '我的预警' : '学业预警' }}</h2><p>{{ isSuperAdmin ? '配置预警规则,执行检测,查看预警记录。' : isCounselor ? '查看所管学生的学业预警情况。' : '查看并确认您的学业预警通知。' }}</p></div>
|
||||
<div style="display:flex;gap:8px;align-items:center">
|
||||
<el-select v-model="termId" clearable @change="load" style="width:240px"><el-option v-for="t in terms" :key="t.id" :label="t.name" :value="t.id" /></el-select>
|
||||
<el-select v-model="termId" clearable @change="load" style="width:240px"><el-option v-for="t in terms" :key="t.id" :label="academicTermLabel(t)" :value="t.id" :class="academicTermOptionClass(t)" /></el-select>
|
||||
<el-button :icon="Refresh" @click="load">刷新</el-button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user