学年学期页面新增“设为当前”“归档”“撤销归档”,当前学期不能归档、删除或直接取消;已归档学期需先撤销才能重新设为当前。[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:
@@ -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="方案名称">
|
||||
|
||||
Reference in New Issue
Block a user