mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-17 23:06:45 +08:00
提交调整
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<!--显示内容-->
|
||||
<div v-else style="margin: 0px 10px;">
|
||||
<!--视频-->
|
||||
<div v-show="content.contentType>0 && content.contentType<41">
|
||||
<div v-show="content.contentType>0 && content.contentType<51">
|
||||
<div style="display: flex;justify-content:space-between">
|
||||
<div>
|
||||
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
|
||||
@@ -95,6 +95,9 @@
|
||||
</div>
|
||||
<pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview>
|
||||
</div>
|
||||
<div v-if="content.contentType==50" style="text-align: center;">
|
||||
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" border="0px" style="width:100%;height:400px;border:0px"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--课件选择或上传的公用组件-->
|
||||
@@ -102,7 +105,7 @@
|
||||
<choose-course-file ref="coursewarePanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file>
|
||||
</div>
|
||||
<div v-show="content.contentRefId=='' && content.contentType==50">
|
||||
<choose-course-scorm ref="coursewarePanel" :resType="content.contentType" @choose="chooseFile"></choose-course-scorm>
|
||||
<choose-course-file ref="coursewareScormPanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file>
|
||||
</div>
|
||||
<!--图文-->
|
||||
<div v-show="content.contentType==41">
|
||||
@@ -326,7 +329,6 @@
|
||||
</template>
|
||||
<script>
|
||||
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
|
||||
import chooseCourseScorm from '@/components/Course/chooseCourseScorm.vue'
|
||||
import courseHomework from '@/components/Course/courseHomework.vue'
|
||||
import courseExam from '@/components/Course/courseExam.vue'
|
||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||
@@ -365,7 +367,7 @@
|
||||
default:1
|
||||
}
|
||||
},
|
||||
components:{chooseCourseFile,WxEditor,courseHomework,courseExam,simplePaper,fileUpload,pdfPreview,audioPlayer,videoPlayer,chooseCourseScorm},
|
||||
components:{chooseCourseFile,WxEditor,courseHomework,courseExam,simplePaper,fileUpload,pdfPreview,audioPlayer,videoPlayer},
|
||||
// inject: [ "informationDetails" ],
|
||||
data(){
|
||||
return {
|
||||
@@ -373,6 +375,7 @@
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
curPdfPath:'',
|
||||
curCFile:{},//当前课件的内容
|
||||
scormUrl:'',//scormUrl地址
|
||||
comTypes:[
|
||||
//文件类型,10视频,20音频,30图片, 40 文档,41表图文,50表scrom包,90表其它
|
||||
//图文41,连接52,作业60,考试61,评估62
|
||||
@@ -452,6 +455,8 @@
|
||||
this.loadPdfFile();
|
||||
}else if(newVal.contentType==41){
|
||||
this.htmlContent=newVal.content;
|
||||
}else if(newVal.contentType==50){
|
||||
this.loadScormFile();
|
||||
}else if(newVal.contentType==52){
|
||||
//外部连接
|
||||
if(newVal.content!=''){
|
||||
@@ -491,6 +496,7 @@
|
||||
this.linkInfo.url='';
|
||||
this.htmlContent='';
|
||||
this.curPdfPath='';
|
||||
this.scormUrl='';
|
||||
this.curCFile={};
|
||||
this.exam.contentId='';
|
||||
this.exam.paperContent='';
|
||||
@@ -524,6 +530,25 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
loadScormFile(){
|
||||
//对于scorm课件内容,需要再查一下
|
||||
this.scormUrl='';
|
||||
apiCourseFile.detail(this.content.contentRefId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.curCFile=rs.result;
|
||||
//this.curPdfPath=rs.result.previewFilePath;
|
||||
this.content.content='scorm';
|
||||
this.scormUrl=process.env.VUE_APP_SCORM_URL+'?r=1&mode=preview&scormId='+this.curCFile.id;//播放的首页
|
||||
console.log(this.scormUrl,'this.scormUrl')
|
||||
}
|
||||
});
|
||||
// let fname=this.content.content;
|
||||
// if(fname && fname.indexOf('.pdf')>-1){
|
||||
// this.curPdfPath=this.content.content;
|
||||
// }else{
|
||||
|
||||
// }
|
||||
},
|
||||
loadHomeworkInfo(){
|
||||
apiCourse.getHomework(this.content.id).then(res=>{
|
||||
if(res.status==200){
|
||||
@@ -686,6 +711,7 @@
|
||||
//未初始化会调用失败,所以这里要等vue变化后再调用
|
||||
this.$nextTick(function(){
|
||||
this.$refs.coursewarePanel.findCourseFile();
|
||||
this.$refs.coursewareScormPanel.findCourseFile();
|
||||
})
|
||||
|
||||
}
|
||||
@@ -697,7 +723,9 @@
|
||||
// this.content.content.url=cfile.filePath;
|
||||
if(this.content.contentType==10 || this.content.contentType==20){
|
||||
this.curriculumData.url = cfile.filePath;
|
||||
}else{
|
||||
}else if(this.content.contentType==50){ //scorm课件内容
|
||||
//this.chooseCourseScorm
|
||||
} else{
|
||||
if(cfile.previewFilePath){
|
||||
this.content.content=cfile.previewFilePath;
|
||||
}else{
|
||||
@@ -713,7 +741,10 @@
|
||||
setTimeout(function(){
|
||||
$this.loadPdfFile();
|
||||
},2000);
|
||||
|
||||
}else if(this.content.contentType==50){
|
||||
setTimeout(function(){
|
||||
$this.loadScormFile();
|
||||
},2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,8 @@
|
||||
{id:'1',type:'video',name:'视频',img:'el-icon-video-camera',resType:10,maxSize:1024,maxSizeName:"1G",fileTypes:['mp4']},
|
||||
{id:'2',type:'sound',name:'音频',img:'el-icon-service',resType:20,maxSize:1024,maxSizeName:"1G",fileTypes:['mp3']},
|
||||
{id:'3',type:'image',name:'图片',img:'el-icon-picture-outline',resType:30,maxSize:10,maxSizeName:"10M",fileTypes:["png","jpg","gif","bmp"]},
|
||||
{id:'4',type:'doc',name:'文档',img:'el-icon-document',resType:40,maxSize:1024,maxSizeName:"1G",fileTypes:["doc", "xls", "ppt","docx", "xlsx", "pptx","txt","pdf"]}
|
||||
{id:'4',type:'doc',name:'文档',img:'el-icon-document',resType:40,maxSize:1024,maxSizeName:"1G",fileTypes:["doc", "xls", "ppt","docx", "xlsx", "pptx","txt","pdf"]},
|
||||
{id:'5',type:'scorm',name:'SCORM课件',img:'el-icon-suitcase',resType:50,maxSize:1024,maxSizeName:"1G",fileTypes:["zip"]}
|
||||
],
|
||||
curComType:{id:'',type:'',name:'',maxSizeName:'',fileTypes:[]},
|
||||
findState:1,
|
||||
@@ -133,6 +134,11 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(this.resType==50){
|
||||
this.data.dir='scorm';
|
||||
}else{
|
||||
this.data.dir='course';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 上传失败
|
||||
|
||||
Reference in New Issue
Block a user