lsc 1 year ago
parent
commit
529ca3164d

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.c670213452ee2dd7859bb9dfc7700dfa.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.b01159b52abeac4e6216.js></script><script type=text/javascript src=./static/js/app.626c7613fc81fb28bf54.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.932c2630b910db78a0e8589b4c8f5327.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.b01159b52abeac4e6216.js></script><script type=text/javascript src=./static/js/app.e77599d1d2ede7bb934d.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.932c2630b910db78a0e8589b4c8f5327.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.932c2630b910db78a0e8589b4c8f5327.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.e77599d1d2ede7bb934d.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.e77599d1d2ede7bb934d.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 38 - 17
src/components/pages/addCourse.vue

@@ -4458,7 +4458,7 @@ export default {
       }
     },
     openAI() {
-      window.parent.postMessage({ tools: "64" }, "*");
+      top.postMessage({ tools: "64" }, "*");
     },
     setMan() {
       // let teacherJuri = this.teacherJuri2;
@@ -5168,7 +5168,7 @@ export default {
       }
     },
     openT() {
-      window.parent.postMessage({ tools: "25" }, "*");
+      top.postMessage({ tools: "25" }, "*");
     },
     deleteTask(i) {
       var _this = this;
@@ -6585,7 +6585,7 @@ export default {
         });
     },
     goCourse() {
-      window.parent.postMessage({ cid: this.courseId, type: "1" }, "*");
+      top.postMessage({ cid: this.courseId, type: "1" }, "*");
     },
     updateWork2() {
       let _unitIndex = this.unitIndex;
@@ -7622,7 +7622,7 @@ export default {
         this.selectJson2 = JSON.parse(JSON.stringify(this.selectJson))
         this.dialogVisibleSelect = true;
       } else if (i == 3) {
-        window.parent.postMessage(
+        top.postMessage(
           {
             tools: "3y",
             cid: this.cid,
@@ -7633,7 +7633,7 @@ export default {
           "*"
         );
       } else if (i == 1) {
-        window.parent.postMessage(
+        top.postMessage(
           {
             tools: "1y",
             cid: this.cid,
@@ -7644,7 +7644,7 @@ export default {
           "*"
         );
       } else if (i == 57) {
-        window.parent.postMessage(
+        top.postMessage(
           {
             tools: "57y",
             cid: this.cid,
@@ -8380,18 +8380,24 @@ export default {
       this.unitJson[this.unitIndex].chapterInfo[0].taskJson = taskA;
       this.$forceUpdate();
     },
-    pasteStage() {
-      let iframe = top.document.querySelectorAll("#AIChat iframe")[0];
-      if (!iframe) {
-        this.$message.error("请使用AI共创生成");
-        return;
-      }
-      let copyData = iframe.contentWindow.copyData;
-      if (!copyData || !copyData.stageData || !copyData.stageData.length) {
-        this.$message.error("请使用AI共创生成");
-        return;
+    pasteStage(stageJson) {
+      let stageData = [];
+      if(stageJson){
+        stageData = stageJson
+      }else{
+        let iframe = top.document.querySelectorAll("#AIChat iframe")[0];
+        if (!iframe) {
+          this.$message.error("请使用AI共创生成");
+          return;
+        }
+        let copyData = iframe.contentWindow.copyData;
+        if (!copyData || !copyData.stageData || !copyData.stageData.length) {
+          this.$message.error("请使用AI共创生成");
+          return;
+        }
+        stageData = copyData.stageData;
       }
-      let stageData = copyData.stageData;
+   
       let stage = [];
       for (var i = 0; i < stageData.length; i++) {
         stage.push({
@@ -8438,6 +8444,15 @@ export default {
         });
       }
       let _this = this;
+      if(stageJson){
+        if(!_this.cid){
+          _this.unitJson = stage;
+        }else{
+          _this.unitIndex = 0;
+          _this.unitJson = stage;
+          _this.updateWork();
+        }
+      }else{
       _this
         .$confirm("确定选择智能粘贴模板吗?修改课程时无法重置课程模板。", "提示", {
           confirmButtonText: "确定",
@@ -8453,6 +8468,8 @@ export default {
         .catch(() => {
           return;
         });
+      }
+
     },
     openStageBox() {
       this.unitJson3 = JSON.parse(JSON.stringify(this.unitJson))
@@ -10289,6 +10306,10 @@ export default {
     setTimeout(() => {
       this.selectCourseDetail();
     }, 500);
+    let _this = this
+    window.pasteStage = function(json){
+      _this.pasteStage(json)
+    }
   },
 };
 </script>

+ 11 - 3
src/components/pages/course.vue

@@ -566,13 +566,13 @@ export default {
       //     "&userid=" +
       //     this.userid
       // );
-      window.parent.postMessage({ cid: cid, screenType: "2" }, "*");
+      top.postMessage({ cid: cid, screenType: "2" }, "*");
     },
     get(item) {
-      window.parent.postMessage({ cid: item.courseId, screenType: "3" }, "*");
+      top.postMessage({ cid: item.courseId, screenType: "3" }, "*");
     },
     getNT(cid) {
-      window.parent.postMessage({ cid: cid, screenType: "3NT" }, "*");
+      top.postMessage({ cid: cid, screenType: "3NT" }, "*");
     },
     handle_remove(file, fileList) {
       var _tmp = this.fileList;
@@ -1151,6 +1151,14 @@ export default {
     // this.selectType();
     this.selectAllType();
     this.getCourse();
+    let _this = this
+    window.goToCourse3 = function(){
+      _this.goToCourse3()
+    }
+
+    window.goToCourse = function(){
+      _this.getCourse()
+    }
   },
 };
 </script>

+ 49 - 32
src/components/pages/easy/addCourse.vue

@@ -5080,7 +5080,7 @@ export default {
   },
   methods: {
     openAI() {
-      window.parent.postMessage({ tools: "64" }, "*");
+      top.postMessage({ tools: "64" }, "*");
     },
     setMan() {
       // let teacherJuri = this.teacherJuri2;
@@ -5486,7 +5486,7 @@ export default {
       }
     },
     openT() {
-      window.parent.postMessage({ tools: "25" }, "*");
+      top.postMessage({ tools: "25" }, "*");
     },
     deleteTask(i) {
       var _this = this;
@@ -6881,7 +6881,7 @@ export default {
         });
     },
     goCourse() {
-      window.parent.postMessage({ cid: this.courseId, type: "1" }, "*");
+      top.postMessage({ cid: this.courseId, type: "1" }, "*");
     },
     updateWork2() {
       let _unitIndex = this.unitIndex;
@@ -7674,7 +7674,7 @@ export default {
           );
           return;
         }
-        window.parent.postMessage(
+        top.postMessage(
           {
             tools: "3y",
             cid: this.cid,
@@ -7691,7 +7691,7 @@ export default {
           );
           return;
         }
-        window.parent.postMessage(
+        top.postMessage(
           {
             tools: "1y",
             cid: this.cid,
@@ -7708,7 +7708,7 @@ export default {
           );
           return;
         }
-        window.parent.postMessage(
+        top.postMessage(
           {
             tools: "57y",
             cid: this.cid,
@@ -8447,18 +8447,24 @@ export default {
       this.unitJson[this.unitIndex].chapterInfo[0].taskJson = taskA;
       this.$forceUpdate();
     },
-    pasteStage() {
-      let iframe = top.document.querySelectorAll("#AIChat iframe")[0];
-      if (!iframe) {
-        this.$message.error("请使用AI共创生成");
-        return;
-      }
-      let copyData = iframe.contentWindow.copyData;
-      if (!copyData || !copyData.stageData || !copyData.stageData.length) {
-        this.$message.error("请使用AI共创生成");
-        return;
+    pasteStage(stageJson) {
+      let stageData = [];
+      if(stageJson){
+        stageData = stageJson
+      }else{
+        let iframe = top.document.querySelectorAll("#AIChat iframe")[0];
+        if (!iframe) {
+          this.$message.error("请使用AI共创生成");
+          return;
+        }
+        let copyData = iframe.contentWindow.copyData;
+        if (!copyData || !copyData.stageData || !copyData.stageData.length) {
+          this.$message.error("请使用AI共创生成");
+          return;
+        }
+        stageData = copyData.stageData
       }
-      let stageData = copyData.stageData;
+   
       let stage = [];
       for (var i = 0; i < stageData.length; i++) {
         stage.push({
@@ -8505,21 +8511,27 @@ export default {
         });
       }
       let _this = this;
-      _this
-        .$confirm("确定选择智能粘贴模式吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-        .then(() => {
-          _this.unitIndex = 0;
-          _this.unitJson = stage;
-          _this.steps++;
-          _this.updateWork();
-        })
-        .catch(() => {
-          return;
-        });
+      if(stageJson){
+        _this.unitIndex = 0;
+        _this.unitJson = stage;
+        _this.updateWork();
+      }else{
+        _this
+          .$confirm("确定选择智能粘贴模式吗?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            _this.unitIndex = 0;
+            _this.unitJson = stage;
+            _this.updateWork();
+          })
+          .catch(() => {
+            return;
+          });
+      }
+ 
     },
     addAnswer() {
       if (this.answerQ == "") {
@@ -10088,6 +10100,11 @@ export default {
       this.unitJson[this.unitIndex].chapterInfo[0].taskJson[0].toolOpen = true
       this.$forceUpdate();
     });
+
+    let _this = this
+    window.pasteStage = function(json){
+      _this.pasteStage(json)
+    }
   },
 };
 </script>

Some files were not shown because too many files changed in this diff