|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="pb_content" style="background: #F0F2F5;">
|
|
|
+ <div class="pb_content" style="background: #F0F2F5;" v-loading="uploadWorkLoading">
|
|
|
<div class="pb_content_body" style="position: relative; margin: 0">
|
|
|
<div class="right">
|
|
|
<!-- <div style="display: flex; margin-top: 20px; position: relative"> -->
|
|
@@ -233,7 +233,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="pptIframeArea">
|
|
|
- <iframe :src="`https://ppt.cocorobo.cn/?mode=editor&courseid=${cid}`" frameborder="0" ref="pptIframeRef"></iframe>
|
|
|
+ <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;clipboard-write;clipboard-read" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="no" border="0" :src="`https://ppt.cocorobo.cn/?mode=editor&courseid=${cid}`" ref="pptIframeRef"></iframe>
|
|
|
</div>
|
|
|
|
|
|
<div class="pptToolsArea">
|
|
@@ -2379,6 +2379,7 @@ import { myMixin } from "@/mixins/mixin.js";
|
|
|
import { uploadFileMixin } from "../../tools/uploadFileMixin.js";
|
|
|
import CodeEditor from "../components/CodeEditor";
|
|
|
import InteractiveToolDialog from "./dialog/InteractiveToolDialog.vue";
|
|
|
+import axios from 'axios'
|
|
|
var OpenCC = require("opencc-js");
|
|
|
let converter = OpenCC.Converter({
|
|
|
from: "hk",
|
|
@@ -2670,6 +2671,8 @@ export default {
|
|
|
testJsonName:"",
|
|
|
testJsonBrief:"",
|
|
|
editId:"",
|
|
|
+ iframeIsLoad:false,
|
|
|
+ uploadWorkLoading:false,
|
|
|
};
|
|
|
},
|
|
|
directives: {
|
|
@@ -4563,7 +4566,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async addWork() {
|
|
|
-
|
|
|
+ if(!this.iframeIsLoad || this.uploadWorkLoading)return;
|
|
|
+ this.uploadWorkLoading = true;
|
|
|
let _pptData = await this.getPPtJson();
|
|
|
|
|
|
// 用_pptData生成json文件,并生成File对象
|
|
@@ -4614,6 +4618,7 @@ export default {
|
|
|
this.ajax
|
|
|
.post(this.$store.state.api + "insert_teacher_work_pptCourse", params)
|
|
|
.then(res => {
|
|
|
+ this.uploadWorkLoading = false;
|
|
|
console.log(this.steps);
|
|
|
// if (this.steps != 1 && this.steps != 2 && this.steps != 3) {
|
|
|
this.$message({
|
|
@@ -4635,6 +4640,7 @@ export default {
|
|
|
);
|
|
|
})
|
|
|
.catch(err => {
|
|
|
+ this.uploadWorkLoading = false;
|
|
|
this.addOp3(
|
|
|
"1",
|
|
|
"",
|
|
@@ -4709,7 +4715,8 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async updateWork() {
|
|
|
-
|
|
|
+ if(!this.iframeIsLoad || this.uploadWorkLoading)return;
|
|
|
+ this.uploadWorkLoading = true;
|
|
|
let _pptData = await this.getPPtJson();
|
|
|
|
|
|
// 用_pptData生成json文件,并生成File对象
|
|
@@ -4755,6 +4762,7 @@ export default {
|
|
|
.post(this.$store.state.api + "updateWorkNew2", params)
|
|
|
.then(res => {
|
|
|
// if (this.steps != 1 && this.steps != 2 && this.steps != 3) {
|
|
|
+ this.uploadWorkLoading = false;
|
|
|
if (this.cidType == 1) {
|
|
|
this.$message({
|
|
|
message: "修改成功",
|
|
@@ -4778,6 +4786,7 @@ export default {
|
|
|
);
|
|
|
})
|
|
|
.catch(err => {
|
|
|
+ this.uploadWorkLoading = false;
|
|
|
this.addOp3(
|
|
|
"1",
|
|
|
"",
|
|
@@ -5083,11 +5092,47 @@ export default {
|
|
|
this.updateAttText();
|
|
|
}
|
|
|
},
|
|
|
- isAddOrUpdateLine() {
|
|
|
+ async isAddOrUpdateLine() {
|
|
|
if (!this.lineTitle) {
|
|
|
this.$message.error("请填写链接标题");
|
|
|
return;
|
|
|
}
|
|
|
+ //https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E6%97%A0%E6%B3%95%E5%93%87%E5%8F%91%E5%99%B6%E5%99%B6%E5%93%87_b634700f-f084-451d-8141-745d516f28c0.html
|
|
|
+ // if(this.line.includes("ppt.cocorobo.cn")){
|
|
|
+ // this.$message.error("请使用ppt.cocorobo.cn的链接");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // 判断 this.line 链接是不是 html 文件
|
|
|
+ if (!/\.html(\?|#|$)/i.test(this.line)) {
|
|
|
+ this.$message.error("请输入以.html结尾的链接");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用this.ajax.get 请求 this.line 链接,如果返回 200 则认为链接有效
|
|
|
+ // 使用XHR请求判断页面是否可以请求到
|
|
|
+ let isValid = await new Promise((resolve) => {
|
|
|
+ let xhr = new XMLHttpRequest();
|
|
|
+ xhr.open('GET', this.line, true);
|
|
|
+ xhr.onreadystatechange = function() {
|
|
|
+ if (xhr.readyState === 4) {
|
|
|
+ // 只要状态码是200就认为可以请求到
|
|
|
+ if (xhr.status === 200) {
|
|
|
+ resolve(true);
|
|
|
+ } else {
|
|
|
+ resolve(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ xhr.onerror = function() {
|
|
|
+ resolve(false);
|
|
|
+ };
|
|
|
+ xhr.send();
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!isValid) {
|
|
|
+ this.$message.error("链接无效");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
let _data = {id:new Date().getTime(),tool:73,title:this.lineTitle,brief:"H5页面",json:{lineTitle:this.lineTitle,line:this.line},url:this.line}
|
|
|
if(this.editId){
|
|
@@ -5100,11 +5145,6 @@ export default {
|
|
|
}
|
|
|
this.setPPtToolList();
|
|
|
this.dialogVisible7 = false;
|
|
|
- // this.editId = null;
|
|
|
- // this.getWorkPageId(_data.id,15,{answerQ:this.answerQ}).then(res=>{
|
|
|
- // this.pptCourseJson.toolsList.find(i=>i.id===_data.id).url = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/workPage?id=${res}`
|
|
|
- // this.setPPtToolList();
|
|
|
- // });
|
|
|
|
|
|
},
|
|
|
addAttTextMessage() {
|
|
@@ -6292,191 +6332,7 @@ export default {
|
|
|
this.addTools(62, this.taskCount, this.toolIndex);
|
|
|
}
|
|
|
},
|
|
|
- //自动获取剪贴板
|
|
|
- pasteOption() {
|
|
|
- // let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
|
|
|
- // if (!iframe) {
|
|
|
- // this.$message.error("请使用AI共创生成题目");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // let copyData = iframe.contentWindow.copyData;
|
|
|
- // if (!copyData || !copyData.selectData.length) {
|
|
|
- // this.$message.error("请使用AI共创生成题目");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // let selectData = copyData.selectData;
|
|
|
- // for (var i = 0; i < selectData.length; i++) {
|
|
|
- // let answer = 0;
|
|
|
- // switch (selectData[i].answer[0]) {
|
|
|
- // case "A":
|
|
|
- // answer = 0;
|
|
|
- // break;
|
|
|
- // case "B":
|
|
|
- // answer = 1;
|
|
|
- // break;
|
|
|
- // case "C":
|
|
|
- // answer = 2;
|
|
|
- // break;
|
|
|
- // case "D":
|
|
|
- // answer = 3;
|
|
|
- // break;
|
|
|
- // case "E":
|
|
|
- // answer = 4;
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // this.testJson.testJson.push({
|
|
|
- // teststitle: selectData[i].subject,
|
|
|
- // testItem: selectData[i].options.length,
|
|
|
- // checkList: selectData[i].options,
|
|
|
- // timuList: [],
|
|
|
- // answer: answer,
|
|
|
- // type: "1"
|
|
|
- // });
|
|
|
- // this.testJson.testCount++;
|
|
|
- // }
|
|
|
- // var isTestJson = JSON.parse(JSON.stringify(this.testJson));
|
|
|
- // isTestJson.testJson = this.testJson.testJson.filter(el => {
|
|
|
- // var elc = el.checkList.filter(element => {
|
|
|
- // return element != "";
|
|
|
- // });
|
|
|
- // return el.teststitle != "" || el.timuList.length > 0 || elc.length != 0;
|
|
|
- // });
|
|
|
- // isTestJson.testCount = isTestJson.testJson.length;
|
|
|
- // if (!isTestJson.testCount) {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this.testJson = isTestJson;
|
|
|
- // this.$forceUpdate();
|
|
|
- },
|
|
|
- pasteTask() {
|
|
|
- // let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
|
|
|
- // if (!iframe) {
|
|
|
- // this.$message.error("请使用AI共创生成");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // let copyData = iframe.contentWindow.copyData;
|
|
|
- // if (!copyData || !copyData.tasksData || !copyData.tasksData.length) {
|
|
|
- // this.$message.error("请使用AI共创生成");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // let stageTasksData = copyData.tasksData;
|
|
|
- // let taskA = [];
|
|
|
- // let tasks = stageTasksData;
|
|
|
- // for (var j = 0; j < tasks.length; j++) {
|
|
|
- // taskA.push({
|
|
|
- // task: tasks[j].taskName,
|
|
|
- // taskDetail: tasks[j].taskDecs,
|
|
|
- // chapterData: [],
|
|
|
- // toolText: "",
|
|
|
- // toolChoose: [
|
|
|
- // {
|
|
|
- // tool: [],
|
|
|
- // toolDetail: "",
|
|
|
- // toolType: 0,
|
|
|
- // askCount: 1,
|
|
|
- // askTitle: "",
|
|
|
- // askJson: [{ askstitle: "", askItem: 1, checkList: [] }]
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // isShowTools: false,
|
|
|
- // askCount: 1,
|
|
|
- // isFold: 1,
|
|
|
- // askTitle: "",
|
|
|
- // askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
|
|
|
- // checkJson: [{ checkCount: [], checkPerent: [] }],
|
|
|
- // homeworkList: []
|
|
|
- // });
|
|
|
- // }
|
|
|
- // this.unitJson[this.unitIndex].chapterInfo[0].taskJson = taskA;
|
|
|
- // this.$forceUpdate();
|
|
|
- },
|
|
|
- pasteStage(stageJson) {
|
|
|
- // let stageData = [];
|
|
|
- // if (stageJson) {
|
|
|
- // stageData = stageJson;
|
|
|
- // } else {
|
|
|
- // let iframe = window.topU.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 stage = [];
|
|
|
- // for (var i = 0; i < stageData.length; i++) {
|
|
|
- // stage.push({
|
|
|
- // dyName: stageData[i], //单元标题
|
|
|
- // chapterInfo: [
|
|
|
- // {
|
|
|
- // isread: false,
|
|
|
- // chapterid: this.guid(),
|
|
|
- // title: "",
|
|
|
- // courseName: "",
|
|
|
- // taskJson: [
|
|
|
- // {
|
|
|
- // task: "",
|
|
|
- // taskDetail: "",
|
|
|
- // chapterData: [],
|
|
|
- // toolText: "",
|
|
|
- // toolChoose: [
|
|
|
- // {
|
|
|
- // tool: [],
|
|
|
- // toolDetail: "",
|
|
|
- // toolType: 0,
|
|
|
- // askCount: 1,
|
|
|
- // askTitle: "",
|
|
|
- // askJson: [{ askstitle: "", askItem: 1, checkList: [] }]
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // isShowTools: false,
|
|
|
- // askCount: 1,
|
|
|
- // isFold: 1,
|
|
|
- // askTitle: "",
|
|
|
- // askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
|
|
|
- // checkJson: [{ checkCount: [], checkPerent: [] }],
|
|
|
- // homeworkList: []
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // itemCount: 1,
|
|
|
- // fileList1: [],
|
|
|
- // video: [],
|
|
|
- // testData: [],
|
|
|
- // pData: [],
|
|
|
- // templateArray: []
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // });
|
|
|
- // }
|
|
|
- // let _this = this;
|
|
|
- // 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 == "") {
|
|
|
this.$message.error("请输入您想要问的问题");
|
|
@@ -8418,18 +8274,12 @@ export default {
|
|
|
}, 500);
|
|
|
},
|
|
|
mounted() {
|
|
|
- // this.$nextTick(() => {
|
|
|
- // //监听这个dom的scroll事件
|
|
|
- // $(".rightBox")[0].addEventListener("scroll", this.scrollChange);
|
|
|
- // this.heightPx = $(".rightBox")[0].offsetHeight + "px";
|
|
|
- // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[0].toolOpen = true;
|
|
|
- // this.$forceUpdate();
|
|
|
- // });
|
|
|
-
|
|
|
- // let _this = this;
|
|
|
- // window.pasteStage = function(json) {
|
|
|
- // _this.pasteStage(json);
|
|
|
- // };
|
|
|
+
|
|
|
+ // iframe页面加载完成
|
|
|
+ this.$refs.pptIframeRef.onload = () => {
|
|
|
+ console.log("iframe页面加载完成");
|
|
|
+ this.iframeIsLoad = true;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -12237,7 +12087,7 @@ ol {
|
|
|
}
|
|
|
|
|
|
.pptIframeArea > iframe {
|
|
|
- width: 100%;
|
|
|
+ width: 98%;
|
|
|
height: 100%;
|
|
|
border: 0;
|
|
|
}
|