|
@@ -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>
|