This commit is contained in:
biss committed 2026-08-14 19:28:58 +08:00
1 parent 54e1986ad0
commit ccdfe977ba
9 files changed
+175 -17

No files matched your search

+4
View File
@@ -180,6 +180,8 @@ button { cursor: pointer; }
.table-toolbar { min-height: 69px; padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.table-toolbar .el-input { width: min(340px, 60vw); }
.table-toolbar > span { margin-left: auto; color: var(--muted); font-size: 11px; }
.base-data-toolbar > .el-select { width: 170px; }
.base-data-toolbar > .el-input-number { width: 142px; }
.data-table { min-height: 360px; }
.el-select-dropdown__item.academic-term-option {
@@ -1632,6 +1634,8 @@ body {
.el-tag { font-weight: 600; }
@media (max-width: 760px) {
.base-data-toolbar > .el-select { flex: 1 1 140px; width: auto; }
.base-data-toolbar > .el-input-number { flex: 1 1 140px; }
.page-intro,
.page-heading { min-height: 0; padding: 12px 0 14px 14px; }
.page-intro::before,
+1 -1
View File
@@ -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() }">
+18 -6
View File
@@ -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" />
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff. Show more