|
|
@@ -1347,7 +1347,27 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 打开发布弹窗
|
|
|
- openPublishDialog() {
|
|
|
+ async openPublishDialog() {
|
|
|
+ if (this.$refs.pptIframeRef.contentWindow.window.pptLoading !== 2) return this.$message.info(this.lang.ssPptLoad)
|
|
|
+ let _pptData = await this.getPPtJson();
|
|
|
+ const _pptData2 = JSON.parse(JSON.stringify(_pptData))
|
|
|
+ let toolsArrayCont = []
|
|
|
+ let istoolsArray = false
|
|
|
+ if (_pptData2.slides) {
|
|
|
+ toolsArrayCont = _pptData2.slides.some(slide => slide.toolsArray && slide.toolsArray.length > 0)
|
|
|
+ if (toolsArrayCont) {
|
|
|
+ // 有内容就弹出弹窗
|
|
|
+ istoolsArray = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(istoolsArray){
|
|
|
+ const confirmed = await this.showToolsConfirmDialog();
|
|
|
+ if (!confirmed) {
|
|
|
+ this.uploadWorkLoading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.initCourseSettingsOptions();
|
|
|
this.loadClassOptions();
|
|
|
this.dialogVisiblePublish = true;
|
|
|
@@ -1387,15 +1407,15 @@ export default {
|
|
|
},
|
|
|
// 确认发布
|
|
|
confirmPublish() {
|
|
|
- if (!this.selectedSubject) {
|
|
|
+ if (!this.selectedSubject.length) {
|
|
|
this.$message.error('请选择学科');
|
|
|
return;
|
|
|
}
|
|
|
- if (!this.selectGrage) {
|
|
|
+ if (!this.selectedGrade.length) {
|
|
|
this.$message.error('请选择年级');
|
|
|
return;
|
|
|
}
|
|
|
- if (!this.checkboxList2) {
|
|
|
+ if (!this.checkboxList2.length) {
|
|
|
this.$message.error('请选择班级');
|
|
|
return;
|
|
|
}
|
|
|
@@ -1404,7 +1424,7 @@ export default {
|
|
|
// 模拟发布过程
|
|
|
console.log('发布课程:', {
|
|
|
subject: this.selectedSubject,
|
|
|
- grade: this.selectGrage,
|
|
|
+ grade: this.selectedGrade,
|
|
|
class: this.checkboxList2,
|
|
|
visibility: this.isTeacherSee,
|
|
|
aiAssistant: this.aiAssistant
|
|
|
@@ -1950,8 +1970,6 @@ export default {
|
|
|
}
|
|
|
const _pptData2 = JSON.parse(JSON.stringify(_pptData))
|
|
|
const pptContent = []
|
|
|
- let toolsArrayCont = []
|
|
|
- let istoolsArray = false
|
|
|
if (_pptData2.slides) {
|
|
|
_pptData2.slides.forEach((slide, index) => {
|
|
|
let slideContent = ''
|
|
|
@@ -1966,20 +1984,8 @@ export default {
|
|
|
}
|
|
|
pptContent.push(`第${index + 1}页: ${slideContent || '内容为空'}`)
|
|
|
})
|
|
|
- toolsArrayCont = _pptData2.slides.some(slide => slide.toolsArray && slide.toolsArray.length > 0)
|
|
|
- if (toolsArrayCont) {
|
|
|
- // 有内容就弹出弹窗
|
|
|
- istoolsArray = true
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- if(istoolsArray && type == 1){
|
|
|
- const confirmed = await this.showToolsConfirmDialog();
|
|
|
- if (!confirmed) {
|
|
|
- this.uploadWorkLoading = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
const contentDescription = pptContent.join('\n')
|
|
|
// 用_pptData生成json文件,并生成File对象
|
|
|
const pptJsonStr = JSON.stringify(_pptData, null, 2);
|
|
|
@@ -2085,8 +2091,6 @@ export default {
|
|
|
}
|
|
|
const _pptData2 = JSON.parse(JSON.stringify(_pptData))
|
|
|
const pptContent = []
|
|
|
- let toolsArrayCont = []
|
|
|
- let istoolsArray = false
|
|
|
if (_pptData2.slides) {
|
|
|
_pptData2.slides.forEach((slide, index) => {
|
|
|
let slideContent = ''
|
|
|
@@ -2101,19 +2105,8 @@ export default {
|
|
|
}
|
|
|
pptContent.push(`第${index + 1}页: ${slideContent || '内容为空'}`)
|
|
|
})
|
|
|
- toolsArrayCont = _pptData2.slides.some(slide => slide.toolsArray && slide.toolsArray.length > 0)
|
|
|
- if (toolsArrayCont) {
|
|
|
- // 有内容就弹出弹窗
|
|
|
- istoolsArray = true
|
|
|
- }
|
|
|
- }
|
|
|
- if(istoolsArray && type == 1){
|
|
|
- const confirmed = await this.showToolsConfirmDialog();
|
|
|
- if (!confirmed) {
|
|
|
- this.uploadWorkLoading = false;
|
|
|
- return;
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
const contentDescription = pptContent.join('\n')
|
|
|
// 用_pptData生成json文件,并生成File对象
|
|
|
const pptJsonStr = JSON.stringify(_pptData, null, 2);
|