课程库 Excel 导入导出已完成:

支持下载标准导入模板。
导出严格沿用当前关键词、学院、分类、课程性质和状态筛选。
以课程编码为唯一键:存在则更新,不存在则新增。
校验学院编码、课程分类、课程性质、学分学时及考核方式。
整批原子导入,任一行错误则全部不写入,并提示具体行号。
学院管理员仍只能维护本学院的专业课和实践课,无法借 Excel 越权。
界面入口沿用现有课程库工具栏样式。
This commit is contained in:
biss committed 2026-07-24 18:56:25 +08:00
1 parent 5a7a8d530b
commit d7cf3f9e76
24 files changed
+3710 -32

No files matched your search

+8 -1
View File
@@ -6,7 +6,7 @@ import http, { apiErrorMessage } from '../api/http'
import { downloadApiFile, importExcel } from '../api/excel'
import { useAuthStore } from '../stores/auth'
type Kind = 'campuses' | 'colleges' | 'majors' | 'classes' | 'terms' | 'buildings' | 'classrooms'
type Kind = 'campuses' | 'colleges' | 'majors' | 'classes' | 'terms' | 'buildings' | 'classrooms' | 'course-categories'
interface Row { id: string; code: string; name: string; isEnabled: boolean; [key: string]: unknown }
const allTabs: { key: Kind; label: string; hint: string }[] = [
@@ -17,6 +17,7 @@ const allTabs: { key: Kind; label: string; hint: string }[] = [
{ key: 'terms', label: '学期', hint: '教学运行时间轴' },
{ key: 'buildings', label: '教学楼', hint: '校区内教学建筑' },
{ key: 'classrooms', label: '教室', hint: '可排课教学空间' },
{ key: 'course-categories', label: '课程分类', hint: '课程所属教学领域' },
]
const auth = useAuthStore()
@@ -40,6 +41,12 @@ const groups = {
description: '按校区和教学楼维护可用于排课的教室资源。',
kinds: ['buildings', 'classrooms'] as Kind[],
},
'course-categories': {
title: '课程分类',
kicker: 'COURSE TAXONOMY',
description: '统一维护基础课、美育、德育、创新创业等课程教学领域。课程性质与课程分类相互独立。',
kinds: ['course-categories'] as Kind[],
},
}
const group = computed(() => {
const key = String(route.meta.baseGroup ?? 'organization') as keyof typeof groups