课程审核部分的修改,替换到新开发的分支上来

This commit is contained in:
daihh
2022-09-25 10:58:16 +08:00
parent ba5ed90fc6
commit c31f9fdf62
7 changed files with 446 additions and 70 deletions

View File

@@ -529,6 +529,7 @@
import apiCourseFile from '../../api/modules/courseFile.js';
import audioPlayer from '@/components/AudioPlayer/index.vue';
import {getType} from '../../utils/tools.js';
import { deepClone } from "../../utils";
export default{
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer},
props: {
@@ -576,6 +577,23 @@
// {id:'5',type:'scorm',name:'SCORM(Q2)',img:'el-icon-suitcase',resType: 50},
{id:'6',type:'link',name:'外部连接',img:'el-icon-link', resType: 52}
],
cwareChange:{
show:1,//1表新添加2表选择
content:{id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''},
findShow:false,//是否显示查询
curType:{type:'jpg',name:''},//这一项要去掉的
linkInfo:{
openType:1,
url:''
},
curriculumData:{
url:'',
isDrag:true,
completeSetup:0,
second:5,
setupTage:0,
},
},
cware:{
show:1,//1表新添加2表选择
content:{id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''},
@@ -609,6 +627,48 @@
submitMode: 3,
}
},
homeworkChange:{
show:1,
content:{id:'',contentType:60,sortIndex:2},
dtime:'',
info:{
id:'',
courseId: '',
name:'',
content:'',
file:'',
deadTime: '',
submitMode: 3,
}
},
examChange:{
show:1,
content:{id:'',contentType:61,sortIndex:3},
paperJson:{items:[]},
paperShow:false,
customerShow:false,
onlyQuestion:true,
info:{
courseId:'',
contentId:'',
testName:this.course.name,
testDuration:30,
showAnalysis:false,
showAnswer:false,
times:1,
qnum:0,//试题数量,只是模式是随机生成试题时才会有
arrange:0,
scoringType:1,
passLine:60,
randomMode:false,
percentScore:true,
paperType:1,//自定义试卷
paperId:'',//试卷的id,只有paperType为2的时间才会有值
info:'',//考试说明
paperContent:'',//试题的json字符串
}
},
exam:{
show:1,
content:{id:'',contentType:61,sortIndex:3},
@@ -713,6 +773,7 @@
$this.cware.curriculumData.url=con.content;
}
}
$this.cwareChange = deepClone($this.cware);
}else if(con.sortIndex==2){
$this.homework.content=con;
//查询作业信息,并显示
@@ -758,6 +819,7 @@
if(res.status==200){
this.homework.info=res.result;
this.homework.show=3;//显示作业内容
this.homeworkChange = deepClone(this.homework);
}else if(res.status==404){
//没有找到作业信息
this.homework.info.id='';
@@ -773,6 +835,7 @@
this.exam.info=res.result;
this.exam.paperJson=JSON.parse(res.result.paperContent);
this.exam.show=9;
this.examChange = deepClone(this.exam);
}else if(res.status==404){
//没有找到作业信息
//this.exam.paperJson={items:[]};
@@ -890,22 +953,26 @@
}
if(index==1){
postData.content=this.cware.content;
this.cwareChange.content = deepClone(this.cware.content)
if(this.cware.content.contentType==52){
if(this.cware.linkInfo.url==''){
this.$message.error("请填写外连URL地址");
return;
}
postData.content.content=JSON.stringify(this.cware.linkInfo);
this.cwareChange.linkInfo = deepClone(this.cware.linkInfo)
}else if(this.cware.content.contentType==10 || this.cware.content.contentType==20){
if(this.cware.curriculumData.url==''){
this.$message.error("请选择课件");
return;
}
postData.content.content=JSON.stringify(this.cware.curriculumData);
this.cwareChange.curriculumData = deepClone(this.cware.curriculumData)
}
}else if(index==2){
postData.content=this.homework.content;
postData.homework=this.homework.info;
this.homeworkChange = deepClone(this.homework)
}else if(index==3){
postData.content=this.exam.content;
//检查是不是所有的试题都有了答案
@@ -932,6 +999,7 @@
}
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
postData.exam=this.exam.info;
this.examChange = deepClone(this.exam);
}else if(index==4){
this.assess.content.content=JSON.stringify(this.assess.json);
postData.content=this.assess.content;