dsy 3 тижнів тому
батько
коміт
785b410ba7

+ 47 - 43
src/components/course/CompletionView.vue

@@ -82,6 +82,7 @@
         :book-background="context.background"
         :component-user-answer="bookAnswerContent"
         :row-checked="previewGroupId"
+        :change-chapter="getCoursewareContentView"
         :permiss-control="{
           can_answer: false,
           can_judge_correct: false,
@@ -149,53 +150,56 @@ export default {
         return;
       }
       this.getTaskMaterialStudentExamAnswer().then(() => {
-        GetCoursewareContent_View({ id: this.curCoursewareId }).then((res) => {
-          const { content, category, book_theme_color, book_font_size } = res;
-          if (!content) {
-            this.context = null;
-            return;
-          }
-          this.category = category;
-          if (category === 'OC' || category.length === 0 || category === 'AILP') {
-            return this.$message.warning('该课件类型已被废弃');
-          }
-          if (category === 'NPC') {
-            this.themeColor = book_theme_color;
-            this.dialogWidth = '900px';
-            this.context = JSON.parse(content);
-            return;
-          }
-          if (category === 'NNPE') {
-            this.dialogWidth = '900px';
-            this.themeColor = book_theme_color;
-            this.context = JSON.parse(content);
-            return;
-          }
-
-          if (category === 'RLC') {
-            this.dialogWidth = '900px';
-            this.themeColor = book_theme_color;
-            this.bookFontSize = book_font_size;
-            this.context = JSON.parse(content);
-            return;
-          }
-
-          if (category === 'NEW') {
-            this.dialogWidth = '1190px';
-            this.context = JSON.parse(content);
-            return;
-          }
-
-          if (category === 'EEP') {
-            this.dialogWidth = '1300px';
-            this.context = res;
-            return;
-          }
-        });
+        this.getCoursewareContentView();
       });
     }
   },
   methods: {
+    getCoursewareContentView(id) {
+      GetCoursewareContent_View({ id: id || this.curCoursewareId }).then((res) => {
+        const { content, category, book_theme_color, book_font_size } = res;
+        if (!content) {
+          this.context = null;
+          return;
+        }
+        this.category = category;
+        if (category === 'OC' || category.length === 0 || category === 'AILP') {
+          return this.$message.warning('该课件类型已被废弃');
+        }
+        if (category === 'NPC') {
+          this.themeColor = book_theme_color;
+          this.dialogWidth = '900px';
+          this.context = JSON.parse(content);
+          return;
+        }
+        if (category === 'NNPE') {
+          this.dialogWidth = '900px';
+          this.themeColor = book_theme_color;
+          this.context = JSON.parse(content);
+          return;
+        }
+
+        if (category === 'RLC') {
+          this.dialogWidth = '900px';
+          this.themeColor = book_theme_color;
+          this.bookFontSize = book_font_size;
+          this.context = JSON.parse(content);
+          return;
+        }
+
+        if (category === 'NEW') {
+          this.dialogWidth = '1190px';
+          this.context = JSON.parse(content);
+          return;
+        }
+
+        if (category === 'EEP') {
+          this.dialogWidth = '1300px';
+          this.context = res;
+          return;
+        }
+      });
+    },
     getTaskMaterialStudentExamAnswer() {
       return GetTaskMaterialStudentExamAnswer({
         material_id: this.curCoursewareId,

+ 8 - 4
src/components/course/FinishCourseware.vue

@@ -77,6 +77,7 @@
         :content-group-row-list="context.content_group_row_list"
         :component-list="context.component_list"
         :book-background="context.background"
+        :change-chapter="getCoursewareContentView"
       />
     </template>
 
@@ -130,7 +131,12 @@ export default {
         return;
       }
 
-      GetCoursewareContent_View({ id: this.coursewareId }).then((res) => {
+      this.getCoursewareContentView();
+    }
+  },
+  methods: {
+    getCoursewareContentView(id) {
+      GetCoursewareContent_View({ id: id || this.coursewareId }).then((res) => {
         const { content, category, book_theme_color, book_font_size } = res;
         if (!content) {
           this.context = null;
@@ -176,9 +182,7 @@ export default {
           return;
         }
       });
-    }
-  },
-  methods: {
+    },
     finishMyTaskMaterial_Student(content, duration = 0) {
       const loading = this.$loading();
       FinishMyTaskMaterial_Student({

+ 2 - 2
src/components/course/courseware.js

@@ -18,8 +18,8 @@ export function useShowCourseware(courseId, groupId = '[]', previewType = 'previ
   let previewGroupId = ref(groupId);
   let exam_answer = ref('');
 
-  function getCoursewareContent_View() {
-    GetCoursewareContent_View({ id: unref(courseId) }).then((res) => {
+  function getCoursewareContent_View(id) {
+    GetCoursewareContent_View({ id: id || unref(courseId) }).then((res) => {
       const { content, category: ca, book_theme_color, book_font_size } = res;
       if (!content) {
         context.value = null;

+ 3 - 2
src/components/live/CurMaterial.vue

@@ -108,6 +108,7 @@
           :content-group-row-list="context.content_group_row_list"
           :component-list="context.component_list"
           :book-background="context.background"
+          :change-chapter="getCoursewareContent_View"
         />
       </template>
     </template>
@@ -293,8 +294,8 @@ export default {
       );
     },
 
-    getCoursewareContent_View() {
-      GetCoursewareContent_View({ id: this.material_id })
+    getCoursewareContent_View(id) {
+      GetCoursewareContent_View({ id: id || this.material_id })
         .then((res) => {
           const { content, category, book_theme_color, book_font_size } = res;
           if (!content) {

+ 3 - 2
src/components/preview/PreviewCourse.vue

@@ -56,6 +56,7 @@
           :content-group-row-list="context.content_group_row_list"
           :component-list="context.component_list"
           :book-background="context.background"
+          :change-chapter="getCoursewareContent_View"
         />
       </template>
     </template>
@@ -143,8 +144,8 @@ let category = ref('');
 let context = ref(null);
 let themeColor = ref('');
 let bookFontSize = ref('');
-function getCoursewareContent_View() {
-  GetCoursewareContent_View({ id: props.fileId }).then((res) => {
+function getCoursewareContent_View(id) {
+  GetCoursewareContent_View({ id: id || props.fileId }).then((res) => {
     const { content, category: cate, book_theme_color, book_font_size } = res;
 
     if (!content) {

+ 1 - 0
src/components/select/SelectCourse.vue

@@ -81,6 +81,7 @@
             :component-list="context.component_list"
             :book-background="context.background"
             :is-show-group="true"
+            :change-chapter="getCoursewareContent_View"
           />
         </template>
       </div>

+ 3 - 2
src/views/live/teacher/CompleteList.vue

@@ -124,6 +124,7 @@
               can_correct: false,
               can_check_correct: false
             }"
+            :change-chapter="getCoursewareContent_View"
           />
         </template>
       </template>
@@ -287,8 +288,8 @@ export default {
         });
     },
 
-    getCoursewareContent_View() {
-      GetCoursewareContent_View({ id: this.material_id }).then((res) => {
+    getCoursewareContent_View(id) {
+      GetCoursewareContent_View({ id: id || this.material_id }).then((res) => {
         const { content, category, book_theme_color, book_font_size } = res;
         if (!content) {
           this.context = null;

+ 3 - 2
src/views/new_live/teacher/components/CompleteList.vue

@@ -124,6 +124,7 @@
               can_correct: false,
               can_check_correct: false
             }"
+            :change-chapter="getCoursewareContent_View"
           />
         </template>
       </template>
@@ -287,8 +288,8 @@ export default {
         });
     },
 
-    getCoursewareContent_View() {
-      GetCoursewareContent_View({ id: this.material_id }).then((res) => {
+    getCoursewareContent_View(id) {
+      GetCoursewareContent_View({ id: id || this.material_id }).then((res) => {
         const { content, category, book_theme_color, book_font_size } = res;
         if (!content) {
           this.context = null;

+ 12 - 1
src/views/new_task_view/components/common/CoursewareView.vue

@@ -72,6 +72,7 @@
         :content-group-row-list="context.content_group_row_list"
         :component-list="context.component_list"
         :book-background="context.background"
+        :change-chapter="getCoursewareContent_View"
       />
     </template>
   </div>
@@ -101,7 +102,17 @@ const props = defineProps({
 const isTeacher = inject('isTeacher');
 let isFinished = props.coursewareData.is_finished === 'true';
 
-const { context, category, themeColor, bookFontSize, previewType, previewGroupId, exam_answer, saveNPCAnswer } =
+const {
+  context,
+  category,
+  themeColor,
+  bookFontSize,
+  previewType,
+  previewGroupId,
+  exam_answer,
+  saveNPCAnswer,
+  getCoursewareContent_View
+} =
   useShowCourseware(
     props.coursewareData.courseware_id,
     props.coursewareData.group_id_selected_info,

+ 41 - 37
src/views/task_details/ShowCourseware.vue

@@ -64,6 +64,7 @@
           :content-group-row-list="context.content_group_row_list"
           :component-list="context.component_list"
           :book-background="context.background"
+          :change-chapter="getCoursewareContentView"
         />
       </template>
     </div>
@@ -89,46 +90,49 @@ export default {
     };
   },
   created() {
-    GetCoursewareContent_View({ id: this.coursewareId }).then((res) => {
-      const { content, category, book_theme_color, book_font_size } = res;
-      if (!content) {
-        this.context = null;
-        return;
-      }
-      this.category = category;
-      if (category === 'OC' || category.length === 0 || category === 'AILP') {
-        return this.$message.warning('该课件类型已被废弃');
-      }
-      if (category === 'NPC') {
-        this.context = JSON.parse(content);
-        this.themeColor = book_theme_color;
-        return;
-      }
-      if (category === 'NNPE') {
-        this.themeColor = book_theme_color;
-        this.context = JSON.parse(content);
-        return;
-      }
+    this.getCoursewareContentView();
+  },
+  methods: {
+    getCoursewareContentView(id) {
+      GetCoursewareContent_View({ id: id || this.coursewareId }).then((res) => {
+        const { content, category, book_theme_color, book_font_size } = res;
+        if (!content) {
+          this.context = null;
+          return;
+        }
+        this.category = category;
+        if (category === 'OC' || category.length === 0 || category === 'AILP') {
+          return this.$message.warning('该课件类型已被废弃');
+        }
+        if (category === 'NPC') {
+          this.context = JSON.parse(content);
+          this.themeColor = book_theme_color;
+          return;
+        }
+        if (category === 'NNPE') {
+          this.themeColor = book_theme_color;
+          this.context = JSON.parse(content);
+          return;
+        }
 
-      if (category === 'RLC') {
-        this.themeColor = book_theme_color;
-        this.bookFontSize = book_font_size;
-        this.context = JSON.parse(content);
-        return;
-      }
+        if (category === 'RLC') {
+          this.themeColor = book_theme_color;
+          this.bookFontSize = book_font_size;
+          this.context = JSON.parse(content);
+          return;
+        }
 
-      if (category === 'NEW') {
-        this.context = JSON.parse(content);
-        return;
-      }
+        if (category === 'NEW') {
+          this.context = JSON.parse(content);
+          return;
+        }
 
-      if (category === 'EEP') {
-        this.context = res;
-        return;
-      }
-    });
-  },
-  methods: {
+        if (category === 'EEP') {
+          this.context = res;
+          return;
+        }
+      });
+    },
     fullScreen() {
       this.isFullScreen() ? this.exitFullScreen() : this.requestFullScreen();
     },

+ 10 - 1
src/views/teacher/create_course/step_three/components/preview/task_preview/components/CoursewareView.vue

@@ -63,6 +63,7 @@
           :content-group-row-list="context.content_group_row_list"
           :component-list="context.component_list"
           :book-background="context.background"
+          :change-chapter="getCoursewareContent_View"
         />
       </template>
     </template>
@@ -89,7 +90,15 @@ const props = defineProps({
   }
 });
 
-const { context, category, themeColor, bookFontSize, previewType, previewGroupId } = useShowCourseware(
+const {
+  context,
+  category,
+  themeColor,
+  bookFontSize,
+  previewType,
+  previewGroupId,
+  getCoursewareContent_View
+} = useShowCourseware(
   props.coursewareId,
   props.groupIdSelectedInfo,
   'previewCheckShow'