提交调整

This commit is contained in:
daihh
2022-12-19 14:49:11 +08:00
parent 29f1ede7f3
commit 96f1630c00
7 changed files with 67 additions and 14 deletions

View File

@@ -35,3 +35,6 @@ VUE_APP_PUBLIC_PATH='/pc'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
# scorm课件的播放url地址
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'

View File

@@ -32,3 +32,6 @@ VUE_APP_PUBLIC_PATH='/pc-release'
# 登录地址 # 登录地址
VUE_APP_LOGIN_URL='https://u.boe.com/web-release/' VUE_APP_LOGIN_URL='https://u.boe.com/web-release/'
# scorm课件的播放url地址
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'

View File

@@ -32,3 +32,6 @@ VUE_APP_PUBLIC_PATH='/pc'
# 登录地址 # 登录地址
VUE_APP_LOGIN_URL='https://u.boe.com/web/' VUE_APP_LOGIN_URL='https://u.boe.com/web/'
# scorm课件的播放url地址
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'

View File

@@ -32,3 +32,6 @@ VUE_APP_PUBLIC_PATH='/pc'
# 登录地址 # 登录地址
VUE_APP_LOGIN_URL='https://u-pre.boe.com/web/' VUE_APP_LOGIN_URL='https://u-pre.boe.com/web/'
# scorm课件的播放url地址
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'

View File

@@ -19,7 +19,7 @@
<!--显示内容--> <!--显示内容-->
<div v-else style="margin: 0px 10px;"> <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 style="display: flex;justify-content:space-between">
<div> <div>
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input> <el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
@@ -95,6 +95,9 @@
</div> </div>
<pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview> <pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview>
</div> </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>
</div> </div>
<!--课件选择或上传的公用组件--> <!--课件选择或上传的公用组件-->
@@ -102,7 +105,7 @@
<choose-course-file ref="coursewarePanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file> <choose-course-file ref="coursewarePanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file>
</div> </div>
<div v-show="content.contentRefId=='' && content.contentType==50"> <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>
<!--图文--> <!--图文-->
<div v-show="content.contentType==41"> <div v-show="content.contentType==41">
@@ -326,7 +329,6 @@
</template> </template>
<script> <script>
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue' import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
import chooseCourseScorm from '@/components/Course/chooseCourseScorm.vue'
import courseHomework from '@/components/Course/courseHomework.vue' import courseHomework from '@/components/Course/courseHomework.vue'
import courseExam from '@/components/Course/courseExam.vue' import courseExam from '@/components/Course/courseExam.vue'
import simplePaper from "@/components/Course/simpleTestPaper.vue"; import simplePaper from "@/components/Course/simpleTestPaper.vue";
@@ -365,7 +367,7 @@
default:1 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" ], // inject: [ "informationDetails" ],
data(){ data(){
return { return {
@@ -373,6 +375,7 @@
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL, fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
curPdfPath:'', curPdfPath:'',
curCFile:{},//当前课件的内容 curCFile:{},//当前课件的内容
scormUrl:'',//scormUrl地址
comTypes:[ comTypes:[
//文件类型,10视频20音频30图片 40 文档41表图文50表scrom包,90表其它 //文件类型,10视频20音频30图片 40 文档41表图文50表scrom包,90表其它
//图文41连接52作业60考试61评估62 //图文41连接52作业60考试61评估62
@@ -452,6 +455,8 @@
this.loadPdfFile(); this.loadPdfFile();
}else if(newVal.contentType==41){ }else if(newVal.contentType==41){
this.htmlContent=newVal.content; this.htmlContent=newVal.content;
}else if(newVal.contentType==50){
this.loadScormFile();
}else if(newVal.contentType==52){ }else if(newVal.contentType==52){
//外部连接 //外部连接
if(newVal.content!=''){ if(newVal.content!=''){
@@ -491,6 +496,7 @@
this.linkInfo.url=''; this.linkInfo.url='';
this.htmlContent=''; this.htmlContent='';
this.curPdfPath=''; this.curPdfPath='';
this.scormUrl='';
this.curCFile={}; this.curCFile={};
this.exam.contentId=''; this.exam.contentId='';
this.exam.paperContent=''; 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(){ loadHomeworkInfo(){
apiCourse.getHomework(this.content.id).then(res=>{ apiCourse.getHomework(this.content.id).then(res=>{
if(res.status==200){ if(res.status==200){
@@ -686,6 +711,7 @@
//未初始化会调用失败所以这里要等vue变化后再调用 //未初始化会调用失败所以这里要等vue变化后再调用
this.$nextTick(function(){ this.$nextTick(function(){
this.$refs.coursewarePanel.findCourseFile(); this.$refs.coursewarePanel.findCourseFile();
this.$refs.coursewareScormPanel.findCourseFile();
}) })
} }
@@ -697,7 +723,9 @@
// this.content.content.url=cfile.filePath; // this.content.content.url=cfile.filePath;
if(this.content.contentType==10 || this.content.contentType==20){ if(this.content.contentType==10 || this.content.contentType==20){
this.curriculumData.url = cfile.filePath; this.curriculumData.url = cfile.filePath;
}else{ }else if(this.content.contentType==50){ //scorm课件内容
//this.chooseCourseScorm
} else{
if(cfile.previewFilePath){ if(cfile.previewFilePath){
this.content.content=cfile.previewFilePath; this.content.content=cfile.previewFilePath;
}else{ }else{
@@ -713,7 +741,10 @@
setTimeout(function(){ setTimeout(function(){
$this.loadPdfFile(); $this.loadPdfFile();
},2000); },2000);
}else if(this.content.contentType==50){
setTimeout(function(){
$this.loadScormFile();
},2000);
} }
} }
} }

View File

@@ -90,7 +90,8 @@
{id:'1',type:'video',name:'视频',img:'el-icon-video-camera',resType:10,maxSize:1024,maxSizeName:"1G",fileTypes:['mp4']}, {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:'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:'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:[]}, curComType:{id:'',type:'',name:'',maxSizeName:'',fileTypes:[]},
findState:1, findState:1,
@@ -133,6 +134,11 @@
return false; return false;
} }
} }
if(this.resType==50){
this.data.dir='scorm';
}else{
this.data.dir='course';
}
return true; return true;
}, },
// 上传失败 // 上传失败

View File

@@ -160,7 +160,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="duration" label="时长(分)" width="100"> <el-table-column prop="duration" label="时长(分)" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.duration"></el-input> <el-input type="number" size="small" v-model="scope.row.minute"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="可见性" width="100"> <el-table-column label="可见性" width="100">
@@ -190,7 +190,7 @@
</el-dialog> </el-dialog>
<el-dialog title="预览课件" :close-on-click-modal="false" width="800px" :visible.sync="coursewareShow" custom-class="g-dialog"> <el-dialog title="预览课件" :close-on-click-modal="false" width="800px" :visible.sync="coursewareShow" custom-class="g-dialog">
<div> <div>
<div class="courseware-title">{{ fileInfo.fileName }}</div> <div class="courseware-title">{{ fileInfo.name }}</div>
<div class="courseware-icon"> <div class="courseware-icon">
<div v-if="fileInfo.resType == 10" style="position: relative;"> <div v-if="fileInfo.resType == 10" style="position: relative;">
<videoPlayer <videoPlayer
@@ -236,7 +236,7 @@
<el-form-item label="课件类型">{{ getType(form.resType) }}</el-form-item> <el-form-item label="课件类型">{{ getType(form.resType) }}</el-form-item>
<el-form-item label="时长(分)"> <el-form-item label="时长(分)">
<!-- <el-input v-model="form.duration"></el-input> --> <!-- <el-input v-model="form.duration"></el-input> -->
<el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.duration"></el-input> <el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.minute"></el-input>
<!-- <el-input-number max="" v-model="form.duration" controls-position="right"></el-input-number> --> <!-- <el-input-number max="" v-model="form.duration" controls-position="right"></el-input-number> -->
</el-form-item> </el-form-item>
<el-form-item label="可见性"> <el-form-item label="可见性">
@@ -532,6 +532,7 @@ export default {
if (status === 200) { if (status === 200) {
result.device1 = true; result.device1 = true;
result.device2 = true; result.device2 = true;
this.fileList.push(result); this.fileList.push(result);
} else { } else {
this.$message.error(error); this.$message.error(error);
@@ -554,6 +555,7 @@ export default {
} else if (item.device2 === true) { } else if (item.device2 === true) {
item.device = 2; item.device = 2;
} }
}); });
this.loading = true; this.loading = true;
coueseFile.batchUpdate(this.fileList).then(rs => { coueseFile.batchUpdate(this.fileList).then(rs => {
@@ -575,6 +577,9 @@ export default {
this.params.pageIndex = this.page.pageIndex; this.params.pageIndex = this.page.pageIndex;
const { result, error, status } = await coueseFile.pageList(this.params, this.page); const { result, error, status } = await coueseFile.pageList(this.params, this.page);
if (status === 200) { if (status === 200) {
result.list.forEach(item=>{
item.minute=item.duration/60;
})
this.tableData = result.list; this.tableData = result.list;
this.page.count = result.count; this.page.count = result.count;
this.page.pageSize = result.pageSize; this.page.pageSize = result.pageSize;
@@ -685,12 +690,11 @@ export default {
//scorm课件的内容取第一个sco //scorm课件的内容取第一个sco
var scorm=JSON.parse(row.content); var scorm=JSON.parse(row.content);
//console.log(scorm,'scorm') //console.log(scorm,'scorm')
if(scorm.index){ if(scorm){
//这里需要提取的到配置文件中,实际中只需要传 rowId就可以了 //这里需要提取的到配置文件中,实际中只需要传 rowId就可以了
this.scormUrl='http://localhost:9083/scorm-player?mode=preview&courseId='+row.courseId+'scormId='+row.id+'&sco='+scorm.index;//播放的首页 this.scormUrl=process.env.VUE_APP_SCORM_URL+'?mode=preview&scormId='+row.id;//播放的首页
}else{ }else{
//这种情况代表无播放页 this.$message({type: 'error',message: 'SCORM包解析失败'});
//this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
} }
} }