فهرست منبع

feat(pptEasy): add course preview iframe and related logic

1. 新增课程预览iframe组件,配置了完整的权限参数
2. 添加courseUrl状态变量和get方法动态生成预览地址
3. 新增ctype=4时触发预览的逻辑,绑定全局preview方法
4. 新增重置课程url的全局方法setCourseUrl
5. 添加预览iframe的样式配置
lsc 1 ساعت پیش
والد
کامیت
c30e7a45ff
1فایلهای تغییر یافته به همراه39 افزوده شده و 0 حذف شده
  1. 39 0
      src/components/pages/pptEasy/addCourse3.vue

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

@@ -948,6 +948,8 @@
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
+
+    <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;clipboard-write;clipboard-read" :webkitallowfullscreen="true" :mozallowfullscreen="true" :allowfullscreen="true" :src="courseUrl" class="courseIframe" v-if="courseUrl"></iframe>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -1205,6 +1207,7 @@ export default {
       gradeOptions2: [],
       gradeOptions2: [],
       avatar_loading: false,
       avatar_loading: false,
       isAddOrUpdateLineLoading: false,
       isAddOrUpdateLineLoading: false,
+      courseUrl: "",
     };
     };
   },
   },
   directives: {
   directives: {
@@ -2070,6 +2073,9 @@ export default {
           if (ctype == 2) {
           if (ctype == 2) {
             this.copyCourse(this.cid);
             this.copyCourse(this.cid);
           }
           }
+          if (ctype == 4) {
+            this.get();
+          }
           this.loadgetCourseDetail();
           this.loadgetCourseDetail();
           this.uploadFile2(pptJsonFile2, this.courseId);
           this.uploadFile2(pptJsonFile2, this.courseId);
           this.addOp3(
           this.addOp3(
@@ -2195,6 +2201,9 @@ export default {
           if (ctype == 2) {
           if (ctype == 2) {
             this.copyCourse(this.cid);
             this.copyCourse(this.cid);
           }
           }
+          if (ctype == 4) {
+            this.get();
+          }
           this.loadgetCourseDetail();
           this.loadgetCourseDetail();
           this.addOp3(
           this.addOp3(
             "1",
             "1",
@@ -3751,6 +3760,22 @@ export default {
       }
       }
       this.pptIframeUrl = `${ppturl}/?mode=editor3&userid=${this.userid}&courseid=${this.cid}`;
       this.pptIframeUrl = `${ppturl}/?mode=editor3&userid=${this.userid}&courseid=${this.cid}`;
     },
     },
+    get() {
+      let url = 'https://beta.pbl.cocorobo.cn'
+      if (window.location.href.includes('beta')) {
+        url = url
+      }
+      else if (this.lang.lang === 'cn') {
+        url = 'https://pbl.cocorobo.cn'
+      }
+      else if (this.lang.lang === 'hk') {
+        url = 'https://pbl.cocorobo.hk'
+      }
+      else if (this.lang.lang === 'com') {
+        url = 'https://pbl.cocorobo.com'
+      }
+      this.courseUrl = url + "/pbl-student-table/dist/#/courseDetail?userid=" + this.userid + "&oid=" + this.oid + "&org=" + this.org + "&courseId=" + this.courseId + "&tType=1&cid=&screenType=2"
+    },
   },
   },
   beforeDestroy() {
   beforeDestroy() {
 
 
@@ -3791,6 +3816,7 @@ export default {
       this.courseName = title;
       this.courseName = title;
     }
     }
     window.save = (type = 1) => this.save(type); // 保存
     window.save = (type = 1) => this.save(type); // 保存
+    window.preview = () => this.save(4); // 预览
     window.copyCourse = () => this.save(2)
     window.copyCourse = () => this.save(2)
     window.deleteCourse = () => this.deleteCourse(this.cid);
     window.deleteCourse = () => this.deleteCourse(this.cid);
     window.publishCourse = () => {
     window.publishCourse = () => {
@@ -3803,6 +3829,9 @@ export default {
       this.dialogVisiblePublish = true;
       this.dialogVisiblePublish = true;
     }
     }
     window.openCourseSettings = () => this.openCourseSettings();
     window.openCourseSettings = () => this.openCourseSettings();
+    window.setCourseUrl = function(){
+      this.courseUrl = ''
+    }
   }
   }
 };
 };
 </script>
 </script>
@@ -5764,4 +5793,14 @@ export default {
 }
 }
 
 
 .ai-switch-wrapper{}
 .ai-switch-wrapper{}
+
+.courseIframe{
+  width: 100vw;
+  height: 100vh;
+  position: fixed;
+  z-index: 99999;
+  top: 0;
+  left: 0;
+  border: none;
+}
 </style>
 </style>