From 7c5110b6d26884f04eeb23afa52b2ed83164dc65 Mon Sep 17 00:00:00 2001 From: zhonghua Date: Thu, 19 Mar 2026 17:41:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=BB=BA=E6=8E=92=E8=AF=BE?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=B1=BB=E5=9E=8B=E5=9B=BE=E6=A0=87=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20@ant-design/icons-vue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- .../components/CreateScheduleModal.vue | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue index 8afa549..1c2642e 100644 --- a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue +++ b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue @@ -106,7 +106,9 @@ :style="getLessonTagStyle(type.lessonType)" @click="selectLessonType(type.lessonType)" > -
{{ getLessonTypeIcon(type.lessonType) }}
+
+ +
{{ getLessonTypeName(type.lessonType) }}
{{ type.count }} 节课
@@ -236,7 +238,16 @@ import { ref, reactive, computed, watch } from 'vue'; import { message } from 'ant-design-vue'; import dayjs, { Dayjs } from 'dayjs'; -import { CalendarOutlined } from '@ant-design/icons-vue'; +import { + CalendarOutlined, + BookOutlined, + TeamOutlined, + HeartOutlined, + SoundOutlined, + UsergroupAddOutlined, + ExperimentOutlined, + BgColorsOutlined, +} from '@ant-design/icons-vue'; import { getCourseCollections, getCourseCollectionPackages, @@ -537,19 +548,27 @@ const filterTeacher = (input: string, option: any) => { return teacher?.name?.toLowerCase().includes(input.toLowerCase()) || false; }; -// 获取课程类型图标(与课程列表 tag 类型对齐) -const getLessonTypeIcon = (type: string): string => { - const icons: Record = { - INTRODUCTION: '📖', INTRO: '📖', - COLLECTIVE: '👥', - LANGUAGE: '💬', DOMAIN_LANGUAGE: '💬', - SOCIETY: '🤝', SOCIAL: '🤝', DOMAIN_SOCIAL: '🤝', - SCIENCE: '🔬', DOMAIN_SCIENCE: '🔬', - ART: '🎨', DOMAIN_ART: '🎨', - HEALTH: '❤️', DOMAIN_HEALTH: '❤️', - }; - return icons[type] || '📚'; +// 课程类型与 @ant-design/icons-vue 图标映射 +const lessonTypeIconMap: Record = { + INTRODUCTION: BookOutlined, + INTRO: BookOutlined, + COLLECTIVE: TeamOutlined, + LANGUAGE: SoundOutlined, + DOMAIN_LANGUAGE: SoundOutlined, + SOCIETY: UsergroupAddOutlined, + SOCIAL: UsergroupAddOutlined, + DOMAIN_SOCIAL: UsergroupAddOutlined, + SCIENCE: ExperimentOutlined, + DOMAIN_SCIENCE: ExperimentOutlined, + ART: BgColorsOutlined, + DOMAIN_ART: BgColorsOutlined, + HEALTH: HeartOutlined, + DOMAIN_HEALTH: HeartOutlined, + MUSIC: SoundOutlined, + SPORT: HeartOutlined, + OUTDOOR: TeamOutlined, }; +const getLessonTypeIconComponent = (type: string) => lessonTypeIconMap[type] || BookOutlined; // 获取选中的课程类型名称(与课程列表 tag 一致) const getSelectedLessonTypeName = (): string => {