Browse Source

问题修改

dsy 1 week ago
parent
commit
fd4b2a1938

+ 12 - 0
src/views/book/courseware/create/components/CreateCanvas.vue

@@ -334,6 +334,18 @@ export default {
      * @param {string} type 类型
      * @param {string} type 类型
      */
      */
     saveCoursewareContent(type) {
     saveCoursewareContent(type) {
+      let isAllLoader = false;
+      if (this.isEdit) {
+        isAllLoader = this.$refs?.component.every((item) => item.property.isGetContent);
+      } else {
+        isAllLoader = this.$refs?.previewEdit?.$refs?.preview?.every((item) => item.loader);
+      }
+
+      if (!isAllLoader) {
+        this.$message.warning('有组件内容未加载完成,请稍后再试');
+        return false;
+      }
+
       let component_id_list = this.data.row_list.flatMap((row) =>
       let component_id_list = this.data.row_list.flatMap((row) =>
         row.col_list.flatMap((col) => col.grid_list.map((grid) => grid.id)),
         row.col_list.flatMap((col) => col.grid_list.map((grid) => grid.id)),
       );
       );

+ 3 - 6
src/views/book/courseware/create/index.vue

@@ -125,16 +125,13 @@ export default {
      * @param {string} type 是否退出
      * @param {string} type 是否退出
      */
      */
     saveCoursewareContent(type = '') {
     saveCoursewareContent(type = '') {
+      let isAllLoader = this.$refs.createCanvas.saveCoursewareContent(type);
+      if (isAllLoader === false) return;
+
       if (type === 'edit') {
       if (type === 'edit') {
         this.curSettingType = '';
         this.curSettingType = '';
         this.curSettingId = '';
         this.curSettingId = '';
       }
       }
-      if (type === 'edit' && !this.isChange) {
-        this.changeEditStatus();
-        return;
-      }
-
-      this.$refs.createCanvas.saveCoursewareContent(type);
       this.isChange = false;
       this.isChange = false;
     },
     },
     showSetBackground() {
     showSetBackground() {

+ 1 - 0
src/views/book/courseware/preview/components/common/PreviewMixin.js

@@ -13,6 +13,7 @@ const mixin = {
       isJudgingRightWrong: false, // 是否判断对错
       isJudgingRightWrong: false, // 是否判断对错
       isShowRightAnswer: false, // 是否显示正确答案
       isShowRightAnswer: false, // 是否显示正确答案
       disabled: false, // 是否禁用
       disabled: false, // 是否禁用
+      isShowParse: false, // 是否显示解析
       isEnable,
       isEnable,
       loader: false,
       loader: false,
     };
     };

+ 1 - 1
src/views/personal_workbench/edit_task/preview/index.vue

@@ -40,7 +40,7 @@ export default {
     },
     },
     editTask() {
     editTask() {
       this.$router.push({
       this.$router.push({
-        path: `/personal_workbench/edit_task/edit/${this.id}`,
+        path: `/personal_workbench/edit_task/edit/${this.$refs.preview.select_node}`,
         query: { project_id: this.project_id },
         query: { project_id: this.project_id },
       });
       });
     },
     },