提交修改

This commit is contained in:
daihh
2022-06-01 19:50:43 +08:00
parent 5c3ca81bec
commit 9ab5d6c21e
5 changed files with 122 additions and 91 deletions

View File

@@ -36,9 +36,8 @@
</div>
</div>
<div v-else>
<div style="text-align: center;">
<!--展示内容区域-->
<!--视频-->
<div v-if="cware.content.contentType==10">
@@ -101,15 +100,21 @@
<el-image :src="fileBaseUrl+cware.content.content" fit="fill"></el-image>
</div>
<div v-if="cware.content.contentType==40">
<div style="text-align: center;padding-top: 20px;" v-if="courseFileShow">
<div style="padding: 20px;">{{cware.content.contentName}}</div>
<el-button @click="loadPdfFile();" type="primary">保存</el-button>
</div>
<div v-else>
<div style="padding: 10px;color: #767676; " v-if="converStatus < 2">文档未转化完成 </div>
<div style="padding: 10px;color: #767676;color: #ff0000; " v-if="converStatus == 3">您上传的文档转化失败请联系管理员</div>
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
</div>
<div style="text-align: center;padding-top: 20px;" v-if="courseFileShow">
<div style="padding: 20px;line-height: 40px;">
{{cware.content.contentName}} <span style="color: green;">上传成功</span>
<br/> 系统正对文件进行转化您可以继续操作</div>
<el-button @click="loadPdfFile();" type="primary">确定</el-button>
</div>
<div v-else>
<div style="padding: 10px;color: #767676;line-height:40px; " v-if="converStatus < 2">
<div>文档文件转化中还未转化完成</div> <div >上传时间{{curCFile.sysCreateTime}}</div>
</div>
<div style="padding: 10px;color: #767676;color: #ff0000; " v-if="converStatus == 3">
<div>文件转化失败请重新上传不要上传加密的文件请联系管理员</div>
</div>
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
</div>
</div>
</div>
@@ -556,6 +561,7 @@
converStatus:4,
courseFileShow:false,
curContent:{id:'',contentType:0,contenRefId:''},
curCFile:{},//当前课件的内容
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
imageShowUrl: '',
activeName: 'courseware',
@@ -656,50 +662,13 @@
},
course(newVal,oldVal){
//
if(this.contents.length>0){
let $this=this;
this.contents.forEach(con=>{
if(con.sortIndex==1){
$this.cware.content=con;
$this.cware.show=2;
//对于pdf文件的问题处理
if(con.contentType==40 && con.content.indexOf('.pdf')==-1){
$this.loadPdfFile();
}
if(con.contentType==52){
if(con.content.startsWith('\{')){
$this.cware.linkInfo=JSON.parse(con.content);
}else{
$this.cware.linkInfo.url=con.content;
}
}
if(con.contentType==10 || con.contentType==20){
if(con.content.startsWith('\{')){
$this.cware.curriculumData=JSON.parse(con.content);
}else{
$this.cware.curriculumData.url=con.content;
}
}
}else if(con.sortIndex==2){
$this.homework.content=con;
//查询作业信息,并显示
$this.loadHomeworkInfo();
}else if(con.sortIndex==3){
$this.exam.content=con;
//查询考试信息并显示
$this.loadExamInfo();
}else if(con.sortIndex==4){
$this.assess.content=con;
//转化文本为json内容
$this.loadAssessInfo();
}
})
}
this.changeContents();
}
},
methods:{
init(){
this.activeName='courseware';
this.curCFile={},//当前课件的内容
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
this.cware.show=1;
this.homework.content={id:'',contentType:60,sortIndex:2};
@@ -715,6 +684,49 @@
this.assess.show=1;
this.hasCWare.keyword='';
this.hasCWare.list=[];
this.changeContents();
},
changeContents(){
if(this.contents.length>0){
let $this=this;
this.contents.forEach(con=>{
if(con.sortIndex==1){
$this.cware.content=con;
$this.cware.show=2;
//对于pdf文件的问题处理
if(con.contentType==40){
//console.log('加载pdf文件内容');
$this.loadPdfFile();
}
if(con.contentType==52){
if(con.content.startsWith('\{')){
$this.cware.linkInfo=JSON.parse(con.content);
}else{
$this.cware.linkInfo.url=con.content;
}
}
if(con.contentType==10 || con.contentType==20){
if(con.content.startsWith('\{')){
$this.cware.curriculumData=JSON.parse(con.content);
}else{
$this.cware.curriculumData.url=con.content;
}
}
}else if(con.sortIndex==2){
$this.homework.content=con;
//查询作业信息,并显示
$this.loadHomeworkInfo();
}else if(con.sortIndex==3){
$this.exam.content=con;
//查询考试信息并显示
$this.loadExamInfo();
}else if(con.sortIndex==4){
$this.assess.content=con;
//转化文本为json内容
$this.loadAssessInfo();
}
})
}
},
loadPdfFile(){
//检查当前是否是pdf如果是pdf那么就不需要再查询一次了
@@ -725,6 +737,7 @@
}else{
apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{
if(rs.status==200){
this.curCFile=rs.result;
this.converStatus = rs.result.converStatus;
this.courseFileShow = false;
this.cware.content.pdfPath=rs.result.previewFilePath;
@@ -947,10 +960,6 @@
}
})
},
// 调用pdf详情接口
getPPtDetail(){
this.loadPdfFile();
},
deleteContent(index){
let $this=this;
let postData={