Parcourir la source

将 ailp-book-question-ui-0.1.1.tgz 和 ailp-book-question-ui-0.1.1.tgz 从 package.json 中移除
以及移除对应的组件

dusenyao il y a 2 ans
Parent
commit
806831126e

+ 1 - 1
.vscode/settings.json

@@ -1,5 +1,5 @@
 {
-  "cSpell.words": ["AILP", "bookailp", "booknnpe", "booknpc", "csitem", "GCLS", "KHPJ", "NNPE", "XYZP", "zhibo"],
+  "cSpell.words": ["AILP", "booknnpe", "booknpc", "csitem", "GCLS", "KHPJ", "NNPE", "XYZP", "zhibo"],
   "workbench.colorCustomizations": {
     "titleBar.activeBackground": "#42b883",
     "titleBar.activeForeground": "#15202b",

+ 3 - 30
src/components/course/CompletionView.vue

@@ -15,18 +15,7 @@
       </div>
     </div>
 
-    <template v-if="category === 'OC' || category.length === 0">
-      <bookreport
-        v-if="dialogVisible"
-        :context="context"
-        :book-client-width="800"
-        :book-answer-content="bookAnswerContent"
-      />
-    </template>
-    <template v-else-if="category === 'AILP'">
-      <bookailp v-if="dialogVisible" :context="context" :ui-type="ui_type" :preview-width="800" :preview-height="450" />
-    </template>
-    <template v-else-if="category === 'NPC'">
+    <template v-if="category === 'NPC'">
       <booknpc
         v-if="context"
         :context="context"
@@ -96,7 +85,6 @@ export default {
       count_right: 0,
       count_error: 0,
       context: null,
-      ui_type: '',
       bookAnswerContent: '',
       category: '',
       dialogWidth: '820px',
@@ -120,23 +108,8 @@ export default {
               return;
             }
             this.category = category;
-            if (category === 'OC' || category.length === 0) {
-              this.dialogWidth = '820px';
-              this.context = {
-                id: this.curCoursewareId,
-                ui_type: JSON.parse(content).question.ui_type,
-                content: JSON.parse(content)
-              };
-              return;
-            }
-            if (category === 'AILP') {
-              this.dialogWidth = '820px';
-              const contents = JSON.parse(content);
-              if (contents.question && contents.question.length > 0) {
-                this.context = JSON.parse(contents.question);
-                this.ui_type = contents.ui_type ? contents.ui_type : '';
-              }
-              return;
+            if (category === 'OC' || category.length === 0 || category === 'AILP') {
+              return this.$message.warning('该课件类型已被废弃');
             }
             if (category === 'NPC') {
               this.themeColor = book_theme_color;

+ 3 - 40
src/components/course/FinishCourseware.vue

@@ -7,23 +7,7 @@
     :close-on-click-modal="false"
     @close="dialogClose"
   >
-    <bookquestion
-      v-if="category === 'OC' || category.length === 0"
-      ref="courseware"
-      :context="context"
-      @handleBookUserAnswer="handleBookUserAnswer"
-    />
-
-    <bookailp
-      v-else-if="category === 'AILP'"
-      :context="context"
-      :ui-type="ui_type"
-      :preview-width="820"
-      :preview-height="461"
-      @handleBookUserAnswer="handleBookUserAnswer"
-    />
-
-    <template v-else-if="category === 'NPC'">
+    <template v-if="category === 'NPC'">
       <booknpc
         v-if="context"
         ref="booknpc"
@@ -90,7 +74,6 @@ export default {
   data() {
     return {
       context: null,
-      ui_type: '',
       exam_answer: '',
       category: '',
       dialogWidth: '860px',
@@ -114,24 +97,8 @@ export default {
             return;
           }
           this.category = category;
-          if (category === 'OC' || category.length === 0) {
-            this.dialogWidth = '860px';
-            this.context = {
-              id: this.coursewareId,
-              ui_type: JSON.parse(content).question.ui_type,
-              content: JSON.parse(content)
-            };
-            this.$nextTick(() => {
-              this.$refs.courseware.handleAnswerTimeStart();
-            });
-          }
-          if (category === 'AILP') {
-            this.dialogWidth = '860px';
-            const contents = JSON.parse(content);
-            if (contents.question && contents.question.length > 0) {
-              this.context = JSON.parse(contents.question);
-              this.ui_type = contents.ui_type ? contents.ui_type : '';
-            }
+          if (category === 'OC' || category.length === 0 || category === 'AILP') {
+            return this.$message.warning('该课件类型已被废弃');
           }
           if (category === 'NPC') {
             this.themeColor = book_theme_color;
@@ -206,10 +173,6 @@ export default {
         });
     },
 
-    handleBookUserAnswer(data) {
-      this.exam_answer = data;
-    },
-
     dialogClose() {
       this.$emit('dialogClose');
     }

+ 4 - 22
src/components/course/courseware.js

@@ -1,5 +1,6 @@
 import { ref, unref } from 'vue';
 import { GetCoursewareContent_View } from '@/api/course';
+import { Message } from 'element-ui';
 
 const categoryList = ['OC', 'AILP', 'NPC', 'NNPE', 'RLC'];
 
@@ -7,10 +8,10 @@ const categoryList = ['OC', 'AILP', 'NPC', 'NNPE', 'RLC'];
  * 显示课件
  * @param {String} courseId 互动课件 id
  * @param {String} groupId 分组id
+ * @param {String} previewType 预览类型
  */
 export function useShowCourseware(courseId, groupId = '[]', previewType = 'previewCheck') {
   let context = ref(null);
-  let ui_type = ref('');
   let category = ref('');
   let themeColor = ref('');
   let bookFontSize = ref('');
@@ -25,21 +26,8 @@ export function useShowCourseware(courseId, groupId = '[]', previewType = 'previ
           return;
         }
         category.value = ca;
-        if (category.value === categoryList[0] || category.value.length === 0) {
-          context.value = {
-            id: unref(courseId),
-            ui_type: JSON.parse(content).question.ui_type,
-            content: JSON.parse(content)
-          };
-          return;
-        }
-        if (category.value === categoryList[1]) {
-          const contents = JSON.parse(content);
-          if (contents.question && contents.question.length > 0) {
-            context.value = JSON.parse(contents.question);
-            ui_type.value = contents.ui_type ? contents.ui_type : '';
-          }
-          return;
+        if (category.value === categoryList[0] || category.value.length === 0 || category.value === categoryList[1]) {
+          return Message.warning('该课件类型已被废弃');
         }
         if (category.value === categoryList[2]) {
           themeColor.value = book_theme_color;
@@ -72,13 +60,8 @@ export function useShowCourseware(courseId, groupId = '[]', previewType = 'previ
     };
   }
 
-  function handleBookUserAnswer(data) {
-    exam_answer.value = data;
-  }
-
   return {
     context,
-    ui_type,
     category,
     themeColor,
     bookFontSize,
@@ -86,7 +69,6 @@ export function useShowCourseware(courseId, groupId = '[]', previewType = 'previ
     previewGroupId,
     exam_answer,
     saveNPCAnswer,
-    handleBookUserAnswer,
     getCoursewareContent_View
   };
 }

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

@@ -33,25 +33,7 @@
     </div>
 
     <template v-if="material_type === 'COURSEWARE' && visible">
-      <template v-if="category === 'OC' || category.length === 0">
-        <bookreport
-          v-if="isStudent"
-          :context="context"
-          :book-client-width="800"
-          :book-answer-content="bookAnswerContent"
-        />
-        <bookquestion v-else ref="courseware" :context="context" @handleBookUserAnswer="handleBookUserAnswer" />
-      </template>
-      <template v-else-if="category === 'AILP'">
-        <bookailp
-          :context="context"
-          :ui-type="ui_type"
-          :preview-width="800"
-          :preview-height="450"
-          @handleBookUserAnswer="handleBookUserAnswer"
-        />
-      </template>
-      <template v-else-if="category === 'NPC'">
+      <template v-if="category === 'NPC'">
         <booknpc
           v-if="context && refresh"
           ref="booknpc"
@@ -152,7 +134,6 @@ export default {
       courseware_group_id_selected_info: '[]',
       context: null,
       exam_answer: '',
-      ui_type: '',
       category: '',
       fileUrl: '',
       file_url_https: '',
@@ -272,24 +253,8 @@ export default {
             return;
           }
           this.category = category;
-          if (category === 'OC' || category.length === 0) {
-            this.context = {
-              id: this.material_id,
-              ui_type: JSON.parse(content).question.ui_type,
-              content: JSON.parse(content)
-            };
-            this.$nextTick(() => {
-              this.$refs.courseware.handleAnswerTimeStart();
-            });
-            return;
-          }
-          if (category === 'AILP') {
-            const contents = JSON.parse(content);
-            if (contents.question && contents.question.length > 0) {
-              this.context = JSON.parse(contents.question);
-              this.ui_type = contents.ui_type ? contents.ui_type : '';
-            }
-            return;
+          if (category === 'OC' || category.length === 0 || category === 'AILP') {
+            return this.$message.warning('该课件类型已被废弃');
           }
           if (category === 'NPC') {
             this.themeColor = book_theme_color;
@@ -353,10 +318,6 @@ export default {
       });
     },
 
-    handleBookUserAnswer(data) {
-      this.exam_answer = data;
-    },
-
     saveNPCAnswer(content, duration, count_right, count_error) {
       const loading = this.$loading();
       FinishMyMaterial({

+ 4 - 24
src/components/preview/PreviewCourse.vue

@@ -1,13 +1,7 @@
 <template>
   <el-dialog class="preview-course" :visible="visible" :title="$t('Key144')" width="1100px" @close="dialogClose">
     <template v-if="fileType === 'courseware'">
-      <template v-if="category === 'OC' || category.length === 0">
-        <bookquestion ref="courseware" :context="context" />
-      </template>
-      <template v-else-if="category === 'AILP'">
-        <bookailp :context="context" :ui-type="ui_type" :preview-width="800" :preview-height="450" />
-      </template>
-      <template v-else-if="category === 'NPC'">
+      <template v-if="category === 'NPC'">
         <booknpc
           v-if="context"
           ref="booknpc"
@@ -67,6 +61,7 @@ import { ref, watch, nextTick } from 'vue';
 import { GetFileStoreInfo } from '@/api/app';
 import { GetCoursewareContent_View } from '@/api/course';
 import { encode } from 'js-base64';
+import { Message } from 'element-ui';
 
 const props = defineProps({
   visible: {
@@ -114,7 +109,6 @@ watch(
 );
 
 const previewType = 'previewCheckShow';
-let ui_type = ref('');
 let category = ref('');
 let context = ref(null);
 let themeColor = ref('');
@@ -127,22 +121,8 @@ function getCoursewareContent_View() {
         return;
       }
       category.value = cate;
-      if (category.value === 'OC' || category.value.length === 0) {
-        context.value = {
-          id: props.material_id,
-          ui_type: JSON.parse(content).question.ui_type,
-          content: JSON.parse(content)
-        };
-        return;
-      }
-
-      if (category.value === 'AILP') {
-        const contents = JSON.parse(content);
-        if (contents.question && contents.question.length > 0) {
-          context.value = JSON.parse(contents.question);
-          ui_type.value = contents.ui_type ? contents.ui_type : '';
-        }
-        return;
+      if (category.value === 'OC' || category.value.length === 0 || category.value === 'AILP') {
+        return Message.warning('该课件类型已被废弃');
       }
 
       if (category.value === 'NPC') {

+ 3 - 11
src/components/select/SelectCourse.vue

@@ -13,21 +13,13 @@
     <!--课件内容及章节结构-->
     <div class="content-structure">
       <div class="content-structure-tree">
-        <tree-menus ref="tree" :current-course="currentCourse" :list="nodes" @curCourse="curCourse" />
+        <TreeMenus ref="tree" :current-course="currentCourse" :list="nodes" @curCourse="curCourse" />
       </div>
       <div
         class="content-structure-container"
         :style="{ 'min-width': `${category === 'NPC' || category === 'NNPE' ? '885px' : ''}` }"
       >
-        <template v-if="category === 'OC' || category.length === 0">
-          <bookquestion :context="context" />
-        </template>
-
-        <template v-else-if="category === 'AILP'">
-          <bookailp :context="context" :ui-type="ui_type" :preview-width="720" :preview-height="405" />
-        </template>
-
-        <template v-else-if="category === 'NPC'">
+        <template v-if="category === 'NPC'">
           <booknpc
             v-if="context"
             ref="book"
@@ -122,7 +114,7 @@ watch(
   }
 );
 
-let { context, ui_type, category, themeColor, bookFontSize, previewType, previewGroupId, getCoursewareContent_View } =
+let { context, category, themeColor, bookFontSize, previewType, previewGroupId, getCoursewareContent_View } =
   useShowCourseware(courseID);
 
 function dialogClose() {

+ 4 - 31
src/views/live/teacher/CompleteList.vue

@@ -53,19 +53,7 @@
 
     <div class="complete-list-container">
       <template v-if="material_type === 'COURSEWARE'">
-        <template v-if="category === 'OC' || category.length === 0">
-          <bookreport
-            v-if="isStudent"
-            :context="context"
-            :book-client-width="800"
-            :book-answer-content="bookAnswerContent"
-          />
-          <bookquestion v-else :context="context" />
-        </template>
-        <template v-else-if="category === 'AILP'">
-          <bookailp :context="context" :ui-type="ui_type" :preview-width="800" :preview-height="450" />
-        </template>
-        <template v-else-if="category === 'NPC'">
+        <template v-if="category === 'NPC'">
           <booknpc
             v-if="context && refresh"
             task-model="ANSWER"
@@ -145,7 +133,6 @@ export default {
       previewType: 'previewCheckShow',
       courseware_group_id_selected_info: '[]',
       context: null,
-      ui_type: '',
       category: '',
       themeColor: '',
       bookFontSize: '',
@@ -262,23 +249,9 @@ export default {
             return;
           }
           this.category = category;
-          if (category === 'OC' || category.length === 0) {
-            this.dialogWidth = '900';
-            this.context = {
-              id: this.material_id,
-              ui_type: JSON.parse(content).question.ui_type,
-              content: JSON.parse(content)
-            };
-            return;
-          }
-          if (category === 'AILP') {
-            this.dialogWidth = '900';
-            const contents = JSON.parse(content);
-            if (contents.question && contents.question.length > 0) {
-              this.context = JSON.parse(contents.question);
-              this.ui_type = contents.ui_type ? contents.ui_type : '';
-            }
-            return;
+
+          if (category.value === 'OC' || category.value.length === 0 || category.value === 'AILP') {
+            return this.$message.warning('该课件类型已被废弃');
           }
           if (category === 'NPC') {
             this.themeColor = book_theme_color;

+ 4 - 31
src/views/new_live/teacher/components/CompleteList.vue

@@ -53,19 +53,7 @@
 
     <div class="complete-list-container">
       <template v-if="material_type === 'COURSEWARE'">
-        <template v-if="category === 'OC' || category.length === 0">
-          <bookreport
-            v-if="isStudent"
-            :context="context"
-            :book-client-width="800"
-            :book-answer-content="bookAnswerContent"
-          />
-          <bookquestion v-else :context="context" />
-        </template>
-        <template v-else-if="category === 'AILP'">
-          <bookailp :context="context" :ui-type="ui_type" :preview-width="800" :preview-height="450" />
-        </template>
-        <template v-else-if="category === 'NPC'">
+        <template v-if="category === 'NPC'">
           <booknpc
             v-if="context && refresh"
             task-model="ANSWER"
@@ -145,7 +133,6 @@ export default {
       previewType: 'previewCheckShow',
       courseware_group_id_selected_info: '[]',
       context: null,
-      ui_type: '',
       category: '',
       themeColor: '',
       bookFontSize: '',
@@ -262,23 +249,9 @@ export default {
             return;
           }
           this.category = category;
-          if (category === 'OC' || category.length === 0) {
-            this.dialogWidth = '900';
-            this.context = {
-              id: this.material_id,
-              ui_type: JSON.parse(content).question.ui_type,
-              content: JSON.parse(content)
-            };
-            return;
-          }
-          if (category === 'AILP') {
-            this.dialogWidth = '900';
-            const contents = JSON.parse(content);
-            if (contents.question && contents.question.length > 0) {
-              this.context = JSON.parse(contents.question);
-              this.ui_type = contents.ui_type ? contents.ui_type : '';
-            }
-            return;
+
+          if (category.value === 'OC' || category.value.length === 0 || category.value === 'AILP') {
+            return this.$message.warning('该课件类型已被废弃');
           }
           if (category === 'NPC') {
             this.themeColor = book_theme_color;

+ 7 - 37
src/views/new_task_view/components/common/CoursewareView.vue

@@ -1,26 +1,6 @@
 <template>
   <div class="courseware-container">
-    <template v-if="category === 'OC' || category.length === 0">
-      <bookreport
-        v-if="isFinished"
-        :context="context"
-        :book-client-width="800"
-        :book-answer-content="coursewareData.exam_answer.content"
-      />
-      <bookquestion v-else :context="context" @handleBookUserAnswer="handleBookUserAnswer" />
-    </template>
-
-    <template v-else-if="category === 'AILP'">
-      <bookailp
-        :context="context"
-        :ui-type="ui_type"
-        :preview-width="720"
-        :preview-height="405"
-        @handleBookUserAnswer="handleBookUserAnswer"
-      />
-    </template>
-
-    <template v-else-if="category === 'NPC'">
+    <template v-if="category === 'NPC'">
       <booknpc
         v-if="context"
         ref="book"
@@ -83,22 +63,12 @@ const props = defineProps({
 const isTeacher = inject('isTeacher');
 let isFinished = props.coursewareData.is_finished === 'true';
 
-const {
-  context,
-  ui_type,
-  category,
-  themeColor,
-  bookFontSize,
-  previewType,
-  previewGroupId,
-  exam_answer,
-  saveNPCAnswer,
-  handleBookUserAnswer
-} = useShowCourseware(
-  props.coursewareData.courseware_id,
-  props.coursewareData.group_id_selected_info,
-  'previewCheckShow'
-);
+const { context, category, themeColor, bookFontSize, previewType, previewGroupId, exam_answer, saveNPCAnswer } =
+  useShowCourseware(
+    props.coursewareData.courseware_id,
+    props.coursewareData.group_id_selected_info,
+    'previewCheckShow'
+  );
 
 watch(
   () => exam_answer.value,

+ 4 - 39
src/views/task_details/ShowCourseware.vue

@@ -4,19 +4,8 @@
       <div class="full">
         <el-image class="full-screen" :src="require('../../assets/common/fullScreen.png')" @click="fullScreen" />
       </div>
-      <template v-if="category === 'OC' || category.length === 0">
-        <bookquestion :context="context" :book-client-width="1200" />
-      </template>
-      <template v-else-if="category === 'AILP'">
-        <bookailp
-          v-if="context"
-          :context="context"
-          :ui-type="ui_type"
-          :preview-width="previewWidth"
-          :preview-height="previewHeight"
-        />
-      </template>
-      <template v-else-if="category === 'NPC'">
+
+      <template v-if="category === 'NPC'">
         <booknpc
           v-if="context"
           task-model=""
@@ -56,7 +45,6 @@ export default {
       previewType: 'previewCheckShow',
       group_id_selected_info: this.$route.query.group_id_selected_info ?? '[]',
       context: null,
-      ui_type: '',
       previewWidth: window.screen.width,
       previewHeight: window.screen.height,
       category: '',
@@ -72,31 +60,8 @@ export default {
           return;
         }
         this.category = category;
-        if (category === 'OC' || category.length === 0) {
-          this.context = {
-            id: this.coursewareId,
-            ui_type: JSON.parse(content).question.ui_type,
-            content: JSON.parse(content)
-          };
-          this.$nextTick(() => {
-            this.$refs.courseware.handleAnswerTimeStart();
-          });
-          return;
-        }
-        if (category === 'AILP') {
-          const contents = JSON.parse(content);
-          if (contents.question && contents.question.length > 0) {
-            this.context = JSON.parse(contents.question);
-            this.ui_type = contents.ui_type ? contents.ui_type : '';
-          }
-          this.$nextTick(() => {
-            const offsetWidth = document.querySelector('div.Big-Book-preview').offsetWidth;
-            const transform = document.querySelector('div.Big-Book-preview').style.transform;
-            document.querySelector('button.full-screen').style.left = `${
-              offsetWidth * Number(transform.slice(6, -1)) - 130
-            }px`;
-          });
-          return;
+        if (category.value === 'OC' || category.value.length === 0 || category.value === 'AILP') {
+          return this.$message.warning('该课件类型已被废弃');
         }
         if (category === 'NPC') {
           this.context = JSON.parse(content);

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

@@ -1,14 +1,6 @@
 <template>
   <div class="courseware-container">
-    <template v-if="category === 'OC' || category.length === 0">
-      <bookquestion :context="context" />
-    </template>
-
-    <template v-else-if="category === 'AILP'">
-      <bookailp :context="context" :ui-type="ui_type" :preview-width="720" :preview-height="405" />
-    </template>
-
-    <template v-else-if="category === 'NPC'">
+    <template v-if="category === 'NPC'">
       <booknpc
         v-if="context"
         ref="book"
@@ -62,7 +54,7 @@ const props = defineProps({
   }
 });
 
-const { context, ui_type, category, themeColor, bookFontSize, previewType, previewGroupId } = useShowCourseware(
+const { context, category, themeColor, bookFontSize, previewType, previewGroupId } = useShowCourseware(
   props.coursewareId,
   props.groupIdSelectedInfo,
   'previewCheckShow'