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;