选课
This commit is contained in:
1 parent
54e1986ad0
commit
ccdfe977ba
9 files changed
+175
-17
No files matched your search
@@ -417,7 +417,7 @@ watch(
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<div class="table-toolbar">
|
||||
<div class="table-toolbar base-data-toolbar">
|
||||
<el-input v-model="keyword" :prefix-icon="Search" clearable placeholder="搜索编码、名称或所属单位" />
|
||||
<template v-if="active === 'classes'">
|
||||
<el-select v-model="listFilters.collegeId" clearable placeholder="全部学院" @change="() => { listFilters.majorId = undefined; load() }">
|
||||
|
||||
@@ -33,11 +33,17 @@ const canManage = computed(() =>
|
||||
) ?? false,
|
||||
)
|
||||
const isCollegeAdmin = computed(() => auth.user?.roles.includes('CollegeAdmin') ?? false)
|
||||
const formColleges = computed(() =>
|
||||
auth.user?.roles.includes('CollegeAdmin') && auth.user.collegeId
|
||||
? colleges.value.filter((item) => item.id === auth.user!.collegeId)
|
||||
const scopedCollegeId = computed(() =>
|
||||
isCollegeAdmin.value ? auth.user?.collegeId : undefined,
|
||||
)
|
||||
const availableColleges = computed(() =>
|
||||
scopedCollegeId.value
|
||||
? colleges.value.filter((item) => item.id === scopedCollegeId.value)
|
||||
: colleges.value,
|
||||
)
|
||||
const formColleges = computed(() =>
|
||||
availableColleges.value,
|
||||
)
|
||||
const natureLabels: Record<string, string> = {
|
||||
GeneralRequired: '通识必修',
|
||||
MajorRequired: '专业必修',
|
||||
@@ -118,7 +124,7 @@ async function resetFilters() {
|
||||
Object.assign(query, {
|
||||
page: 1,
|
||||
keyword: '',
|
||||
collegeId: undefined,
|
||||
collegeId: scopedCollegeId.value,
|
||||
categoryId: undefined,
|
||||
nature: undefined,
|
||||
isEnabled: undefined,
|
||||
@@ -239,6 +245,7 @@ onMounted(async () => {
|
||||
colleges.value = collegeRes.data
|
||||
categories.value = categoryRes.data
|
||||
courseOptions.value = courseRes.data
|
||||
if (scopedCollegeId.value) query.collegeId = scopedCollegeId.value
|
||||
await load()
|
||||
})
|
||||
</script>
|
||||
@@ -279,8 +286,13 @@ onMounted(async () => {
|
||||
placeholder="搜索课程编码、中英文名称"
|
||||
@keyup.enter="query.page = 1; load()"
|
||||
/>
|
||||
<el-select v-model="query.collegeId" clearable placeholder="全部开课学院">
|
||||
<el-option v-for="item in colleges" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select
|
||||
v-model="query.collegeId"
|
||||
:clearable="!scopedCollegeId"
|
||||
:disabled="Boolean(scopedCollegeId)"
|
||||
:placeholder="scopedCollegeId ? '所属开课学院' : '全部开课学院'"
|
||||
>
|
||||
<el-option v-for="item in availableColleges" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select v-model="query.categoryId" clearable placeholder="全部课程分类">
|
||||
<el-option v-for="item in categories" :key="item.id" :label="item.name" :value="item.id" />
|
||||
|
||||
@@ -462,7 +462,7 @@ async function deleteCourse(moduleId: string, item: any) {
|
||||
onMounted(async () => {
|
||||
const [optionRes, courseRes] = await Promise.all([
|
||||
http.get('/curriculum-plans/filter-options'),
|
||||
http.get('/courses/options'),
|
||||
http.get('/curriculum-plans/course-options'),
|
||||
loadCourseGroups(),
|
||||
])
|
||||
colleges.value = optionRes.data.colleges
|
||||
|
||||
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user