Browse Source

feat: 添加课程设置方法及全局调用入口

lsc 6 days ago
parent
commit
35517ca712
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/components/pages/pptEasy/addCourse3.vue

+ 6 - 0
src/components/pages/pptEasy/addCourse3.vue

@@ -1328,6 +1328,11 @@ export default {
       this.initCourseSettingsOptions();
       this.dialogVisibleCourseSettings = true;
     },
+    courseSettings(subject, className){
+      this.selectedSubject = this.subjectOptions.some(item => item.name === subject);
+      this.selectedGrade = this.gradeOptions.some(item => item.name === className);
+      this.applyCourseSettings();
+    },
     // 初始化课程设置选项
     initCourseSettingsOptions() {
       // 从 CourseTypeJson 中获取学科和年级选项
@@ -3870,6 +3875,7 @@ export default {
       this.dialogVisiblePublish = true;
     }
     window.openCourseSettings = () => this.openCourseSettings();
+    window.courseSettings = (subject, className) => this.courseSettings(subject, className);
     let _this = this;
     window.setCourseUrl = () => {
       console.log(_this.courseUrl)