|
|
@@ -1369,7 +1369,7 @@ export default {
|
|
|
generateFromAI() {
|
|
|
console.log('自AI生成');
|
|
|
if(!this.courseName){
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
}
|
|
|
if(this.avatar_loading){
|
|
|
@@ -1498,14 +1498,14 @@ export default {
|
|
|
// this.isTeacherSee = true
|
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.addWork();
|
|
|
}
|
|
|
} else {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
console.log("修改课程");
|
|
|
@@ -1542,14 +1542,14 @@ export default {
|
|
|
save(type = 1) {
|
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.addWork(2, type);
|
|
|
}
|
|
|
} else {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.updateWork(2, type);
|
|
|
@@ -1624,14 +1624,14 @@ export default {
|
|
|
console.log("保存已编辑内容");
|
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.addWork();
|
|
|
}
|
|
|
} else {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.updateWork();
|
|
|
@@ -1678,6 +1678,30 @@ export default {
|
|
|
checkLoaded(resolve);
|
|
|
});
|
|
|
},
|
|
|
+ //获取ppt的数据
|
|
|
+ async getPPtimgExporting() {
|
|
|
+ const checkLoaded = async (resolve) => {
|
|
|
+ console.log("获取ppt数据")
|
|
|
+ let _pptIframe = this.$refs.pptIframeRef;
|
|
|
+ if (
|
|
|
+ _pptIframe &&
|
|
|
+ _pptIframe.contentWindow &&
|
|
|
+ _pptIframe.contentWindow.window &&
|
|
|
+ typeof _pptIframe.contentWindow.window.exportJSON === "function"
|
|
|
+ ) {
|
|
|
+ let _data = _pptIframe.contentWindow.window.imgExporting();
|
|
|
+ resolve(_data);
|
|
|
+ } else {
|
|
|
+ // 递归等待1000ms后重试
|
|
|
+ setTimeout(() => {
|
|
|
+ checkLoaded(resolve);
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ checkLoaded(resolve);
|
|
|
+ });
|
|
|
+ },
|
|
|
//上传文件
|
|
|
uploadFile(file) {
|
|
|
return new Promise((resolve) => {
|
|
|
@@ -1786,6 +1810,11 @@ export default {
|
|
|
this.uploadWorkLoading = true;
|
|
|
}
|
|
|
let _pptData = await this.getPPtJson();
|
|
|
+ let imgExporting = await this.getPPTimgExporting()
|
|
|
+ if (type == 1 && imgExporting) {
|
|
|
+ this.$message.info(this.lang.ssPptLoad)
|
|
|
+ return
|
|
|
+ }
|
|
|
const _pptData2 = JSON.parse(JSON.stringify(_pptData))
|
|
|
const pptContent = []
|
|
|
if (_pptData2.slides) {
|
|
|
@@ -1899,6 +1928,11 @@ export default {
|
|
|
this.uploadWorkLoading = true;
|
|
|
}
|
|
|
let _pptData = await this.getPPtJson();
|
|
|
+ let imgExporting = await this.getPPTimgExporting()
|
|
|
+ if (type == 1 && imgExporting) {
|
|
|
+ this.$message.info(this.lang.ssPptLoad)
|
|
|
+ return
|
|
|
+ }
|
|
|
const _pptData2 = JSON.parse(JSON.stringify(_pptData))
|
|
|
const pptContent = []
|
|
|
if (_pptData2.slides) {
|
|
|
@@ -2673,6 +2707,19 @@ export default {
|
|
|
this.addContent(cocoroboItem)
|
|
|
this.setPPtToolList();
|
|
|
},
|
|
|
+ setUrl() {
|
|
|
+ let url = 'https://beta.pbl.cocorobo.cn'
|
|
|
+ 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 === 'en') {
|
|
|
+ url = 'https://pbl.cocorobo.com'
|
|
|
+ }
|
|
|
+ return url
|
|
|
+ },
|
|
|
addTest() {
|
|
|
// var aj = this.testJson.testJson;
|
|
|
// var b = 1;
|
|
|
@@ -2765,7 +2812,8 @@ export default {
|
|
|
|
|
|
this.dialogVisibleChoice = false;
|
|
|
this.getWorkPageId(_data.id, 45, testJson).then(res => {
|
|
|
- let url = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`
|
|
|
+ let baseUrl = setUrl()
|
|
|
+ let url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`
|
|
|
this.pptCourseJson.toolsList.find(i => i.id === _data.id).url = url;
|
|
|
this.setPPtToolList();
|
|
|
_data.url = url
|
|
|
@@ -3021,7 +3069,8 @@ export default {
|
|
|
|
|
|
this.dialogVisible8 = false;
|
|
|
this.getWorkPageId(_data.id, 15, { answerQ: this.answerQ }).then(res => {
|
|
|
- let url = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`;
|
|
|
+ let baseUrl = setUrl()
|
|
|
+ let url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`;
|
|
|
this.pptCourseJson.toolsList.find(i => i.id === _data.id).url = url;
|
|
|
this.setPPtToolList();
|
|
|
_data.url = url
|