From b2e1ed02d17ca7e7e33b3f863c1a07a6f16c4400 Mon Sep 17 00:00:00 2001 From: yuliang_guo Date: Fri, 30 Jan 2026 16:27:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/manager/growth-path-management.vue | 83 +++++++++++++++---- 1 file changed, 66 insertions(+), 17 deletions(-) diff --git a/frontend/src/views/manager/growth-path-management.vue b/frontend/src/views/manager/growth-path-management.vue index 46fbe46..a6f7ca2 100644 --- a/frontend/src/views/manager/growth-path-management.vue +++ b/frontend/src/views/manager/growth-path-management.vue @@ -252,17 +252,6 @@

课程配置

- - -
@@ -271,6 +260,33 @@ 可选课程 {{ filteredCourses.length }} 门
+ +
+ + + + + + +
(null) const courseSearch = ref('') +const courseCategory = ref('') const isDragging = ref(false) const isDraggingOver = ref(false) @@ -471,13 +488,33 @@ const positions = ref([]) const courses = ref([]) // ========== 计算属性 ========== +// 获取所有课程分类 +const courseCategories = computed(() => { + const categories = new Set() + courses.value.forEach(c => { + if (c.category) categories.add(c.category) + }) + return Array.from(categories).sort() +}) + const filteredCourses = computed(() => { - if (!courseSearch.value) return courses.value - const keyword = courseSearch.value.toLowerCase() - return courses.value.filter(c => - (c.name || c.title || '').toLowerCase().includes(keyword) || - (c.category || '').toLowerCase().includes(keyword) - ) + let result = courses.value + + // 按分类筛选 + if (courseCategory.value) { + result = result.filter(c => c.category === courseCategory.value) + } + + // 按关键词搜索 + if (courseSearch.value) { + const keyword = courseSearch.value.toLowerCase() + result = result.filter(c => + (c.name || c.title || '').toLowerCase().includes(keyword) || + (c.category || '').toLowerCase().includes(keyword) + ) + } + + return result }) const requiredCount = computed(() => { @@ -1083,6 +1120,18 @@ onMounted(() => { font-weight: 500; } + .course-filter { + display: flex; + gap: 8px; + padding: 12px 16px; + background: #f5f7fa; + border-bottom: 1px solid #ebeef5; + + .el-input { + flex: 1; + } + } + .library-content, .selected-content { flex: 1;