Merge branch 'scorm' into third

This commit is contained in:
daihh
2022-12-21 21:55:02 +08:00
12 changed files with 365 additions and 78 deletions

View File

@@ -35,3 +35,6 @@ VUE_APP_PUBLIC_PATH='/pc'
# 路由懒加载
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/'
# 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/'
# 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/'
# scorm课件的播放url地址
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'

View File

@@ -47,7 +47,7 @@ const formRequest=axios.create({
Promise.reject(error)
});
formRequest.interceptors.response.use(res => {
console.log(res);
//console.log(res);
const code = res.data.status || 200;
if(code===200){
return res.data

View File

@@ -32,8 +32,8 @@ const update = function(data) {
}
/* 编辑详情 */
const detail = function(id) {
return ajax.get('/xboe/m/exam/paper/query?id=' + id);
}
return ajax.get('/xboe/m/exam/paper/query?id=' + id);
}
/* 试卷批量导入计算
* num 数目

View File

@@ -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,14 +367,15 @@
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 {
converStatus:4,
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
curPdfPath:'',
curCFile:{},//当前课件的内容
scormUrl:'',//scormUrl地址
comTypes:[
//文件类型,10视频20音频30图片 40 文档41表图文50表scrom包,90表其它
//图文41连接52作业60考试61评估62
@@ -438,7 +441,13 @@
},
created() {
//console.log(this.ctype, this.course,'ctype');
//console.log(process.env, 'process.env');
},
mounted(){
//this.init();
if(process.env.NODE_ENV=='development'){
this.fileBaseUrl=process.env.VUE_APP_FILE_BASE_URL;
}
},
watch:{
reset(newVal){
@@ -452,6 +461,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 +502,7 @@
this.linkInfo.url='';
this.htmlContent='';
this.curPdfPath='';
this.scormUrl='';
this.curCFile={};
this.exam.contentId='';
this.exam.paperContent='';
@@ -524,6 +536,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 +717,7 @@
//未初始化会调用失败所以这里要等vue变化后再调用
this.$nextTick(function(){
this.$refs.coursewarePanel.findCourseFile();
this.$refs.coursewareScormPanel.findCourseFile();
})
}
@@ -697,7 +729,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 +747,10 @@
setTimeout(function(){
$this.loadPdfFile();
},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:'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;
},
// 上传失败

View File

@@ -24,15 +24,26 @@
</div>
<!--内容区-->
<div style="margin-top: 10px;">
<div v-if="cware.content.contentType<41 && !cware.findShow">
<div v-if="cware.content.contentType<51 && !cware.findShow">
<div v-if="cware.content.contentRefId==''">
<div style="display: flex;justify-content: center;padding-top: 50px;">
<div>
<file-upload :fileType="getFileTypes(cware.content.contentType)" dir="course" :isShowTip="false" :showList="true" size="small" :text="'上传新'+getType(cware.content.contentType)" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
</div>
<div style="padding-top: 0px;">
<!-- <div> -->
<choose-course-file ref="coursewarePanel" :resType="cware.content.contentType" @choose="chooseFile"></choose-course-file>
<!-- <file-upload
:fileType="getFileTypes(cware.content.contentType)"
dir="course"
:isShowTip="false"
:showList="true"
size="small"
:text="'上传新'+getType(cware.content.contentType)"
@success="handleUploadSuccess"
@remove="handleRemoveSuccess">
</file-upload> -->
<!-- </div>
<div style="margin-left: 10px;">
<el-button type="primary" size="small" @click="toFindCWare()" >选择已有{{getType(cware.content.contentType)}}</el-button>
</div>
</div> -->
</div>
</div>
<div v-else>
@@ -116,6 +127,9 @@
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
</div>
</div>
<div v-if="cware.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>
@@ -263,8 +277,8 @@
<el-tab-pane label="考试" name="exam">
<div v-if="exam.show==1">
<div style="padding: 10px; text-align: center;">
<el-button @click="changeExamShow(3)" type="primary" >自定义考试</el-button>
<!-- <el-button @click="changeExamShow(2)" type="primary" size="small">选择已有考试</el-button> -->
<el-button @click="openCusExam()" type="primary" >自定义考试</el-button>
<el-button @click="openChoosePaper()" type="primary">选择已有考试</el-button>
</div>
</div>
<div v-if="exam.show==2">
@@ -275,37 +289,39 @@
</el-select>
</div>
-->
<div><el-input maxlength="50" placeholder="名称"></el-input></div>
<div><el-input maxlength="50" placeholder="创建人"></el-input></div>
<div style="padding-left: 10px;"><el-button type="primary" >搜索已有考试</el-button></div>
<div><el-input v-model="usePaper.keyword" maxlength="50" placeholder="名称"></el-input></div>
<div style="padding-left: 10px;"><el-button @click="findExamPapers()" type="primary" >查询</el-button></div>
<div style="padding-left: 10px;"><el-button @click="changeExamShow(1)" type="danger" >返回</el-button></div>
</div>
<div>
<div style="text-align: center;padding-top: 10px;">
<el-table style="100%" :data="hasCWare.list" border stripe>
<el-table-column label="考试名称" prop="author"><template>考试名称</template></el-table-column>
<el-table-column label="创建时间" prop="author">
<div style="text-align: center;padding-top: 10px; overflow-y: auto;">
<el-table style="100%" height="480" :data="usePaper.list" border stripe>
<el-table-column prop="testName" label="考试名称"></el-table-column>
<el-table-column prop="sysCreateTime" label="创建时间"></el-table-column>
<el-table-column prop="sysCreateBy" label="创建人" width="80px" ></el-table-column>
<el-table-column label="选择" width="60px">
<template slot-scope="scope">
2022-02-03
</template>
</el-table-column>
<el-table-column label="创建人" prop="content">
<template>
XXX
</template>
</el-table-column>
<el-table-column label="选择" width="80px">
<template slot-scope="scope">
<el-button @click="changeExamShow(9)" type="primary" >选择</el-button>
<el-button size="mini" @click="chooseExamPaper(scope.row)" type="primary" >选择</el-button>
</template>
</el-table-column>
</el-table>
<!--分页功能-->
<div v-if="usePaper.total >10" style="text-align: center; margin-top:10px">
<el-pagination background
@current-change="changePaperPage"
:current-page="usePaper.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="usePaper.pageSize"
layout="total,pager"
:total="usePaper.total"
></el-pagination>
</div>
</div>
</div>
</div>
<div v-if="exam.show==3">
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border-bottom: 1px solid #e7e7e7;">
<div>自定义考试</div>
<div>{{exam.paperType==1? '自定义考试':'使用独立考试试卷'}} </div>
<div>
<el-checkbox v-model="exam.onlyQuestion">只显示试题</el-checkbox>
<el-button :loading="loading" style="margin-left: 10px;" @click="saveContent(3)" type="primary" > </el-button>
@@ -387,9 +403,12 @@
</el-form-item>
</el-form>
</div>
<div>
<div v-if="exam.info.paperType==1">
<simplePaper :data="exam.paperJson"></simplePaper>
</div>
<div v-if="exam.info.paperType==2">
<div style="font-size: 20px;padding: 10px;" >试卷 {{usePaper.paperName}}</div>
</div>
</div>
</div>
<div v-if="exam.show==9">
@@ -520,17 +539,19 @@
</div>
</template>
<script>
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
import WxEditor from "@/components/Editor/indexCourse.vue";
import simplePaper from "@/components/Course/simpleTestPaper.vue";
import FileUpload from '@/components/FileUpload/index.vue';
import pdfPreview from "@/components/PdfPreview/index.vue";
import apiCourse from '../../api/modules/course.js';
import apiCourseFile from '../../api/modules/courseFile.js';
import apiExamPaper from '../../api/modules/paper.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},
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer,chooseCourseFile},
props: {
contents:{
type:Array,
@@ -565,6 +586,7 @@
curCFile:{},//当前课件的内容
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
imageShowUrl: '',
scormUrl:'',//scorm课件对应的url地址
activeName: 'courseware',
getType: getType,
cwareTypes:[
@@ -669,6 +691,16 @@
}
},
usePaper:{ //使用考试试卷
pageIndex:1,
pageSize:10,
total:0,
list:[],
keyword:'',
paperId:'',//选择的试卷的id
paperName:'',//选择的试卷的名称
paperJson:{items:[]},
},
exam:{
show:1,
content:{id:'',contentType:61,sortIndex:3},
@@ -695,7 +727,6 @@
paperId:'',//试卷的id,只有paperType为2的时间才会有值
info:'',//考试说明
paperContent:'',//试题的json字符串
}
},
assess:{
@@ -717,6 +748,9 @@
},
mounted(){
//this.init();
if(process.env.NODE_ENV=='development'){
this.fileBaseUrl=process.env.VUE_APP_FILE_BASE_URL;
}
},
watch:{
reset(newVal){
@@ -730,6 +764,7 @@
methods:{
init(){
this.activeName='courseware';
this.scormUrl='';//scorm的路径
this.curCFile={},//当前课件的内容
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
this.cware.show=1;
@@ -758,6 +793,12 @@
if(con.contentType==40){
//console.log('加载pdf文件内容');
$this.loadPdfFile();
}else if(con.contentType==50){
//console.log('加载pdf文件内容');
if(!this.scormUrl){
$this.loadScormFile();
}
}
if(con.contentType==52){
if(con.content.startsWith('\{')){
@@ -814,6 +855,22 @@
});
}
},
loadScormFile(){
//对于scorm课件内容需要再查一下
//this.scormUrl='';
if(this.scormUrl){
return;
}
apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{
if(rs.status==200){
this.curCFile=rs.result;
//this.curPdfPath=rs.result.previewFilePath;
this.cware.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')
}
});
},
loadHomeworkInfo(){
apiCourse.getHomework(this.homework.content.id).then(res=>{
if(res.status==200){
@@ -919,6 +976,7 @@
resetContent(index){
if(index==1){
this.cware.content.id='';
this.scormUrl='';
this.cware.content.contentRefId='';
this.cware.content.contentName='';
this.cware.content.content='';
@@ -997,6 +1055,7 @@
});
if(!pass){
this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
this.loading=false;
return;
}
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
@@ -1083,6 +1142,36 @@
}
})
},
chooseFile(cfile){
this.cware.content.contentRefId=cfile.id;
//如果是非pdf文档 这里需要使用cfile.id再去获取
this.cware.content.contentName=cfile.name;
if(this.cware.content.resType === 10 || this.cware.content.resType ==20) {
this.cware.curriculumData.url = cfile.filePath;
}else if(this.cware.content.resType === 50){
}else{
if(cfile.previewFilePath){
this.cware.curriculumData.url = cfile.previewFilePath;
}else{
this.cware.curriculumData.url = cfile.filePath;
}
}
this.cware.content.duration=cfile.duration;//时长
this.saveContent(1);
let $this=this;
if(this.cware.content.contentType==40){
setTimeout(function(){
$this.loadPdfFile();
},1000);
}else if(this.cware.content.contentType==50){
setTimeout(function(){
$this.loadScormFile();
},500);
}
},
getCoursewareList() {
// name:查询的名称的关键字
// self:true/false,默认是true,是否只查询自己上传的课件
@@ -1168,15 +1257,74 @@
changeHomeworkShow(idx){
this.homework.show=idx;
},
changeExamShow(idx){
this.exam.show=idx;
},
assessmentHandle(){
this.assess.show=2;
},
changeExamShow(idx){
this.exam.show=idx;
},
openCusExam(){ //自定义考试
this.exam.show=3;
this.exam.paperType=1;
this.exam.paperId='';
this.usePaper.pageIndex=1;
this.usePaper.keyword="";
},
openChoosePaper(){
this.exam.show=2;
this.exam.paperType=3;
this.exam.paperId='';
},
findExamPapers(){ //查询已有的考试试卷
this.usePaper.pageIndex=1;
this.loadExamPapers();
},
loadExamPapers(){
let pars={
pageIndex:this.usePaper.pageIndex,
pageSize:this.usePaper.pageSize,
keyword:this.usePaper.keyword
}
apiExamPaper.querylist(pars).then(rs=>{
if(rs.status==200){
this.usePaper.list=rs.result.list;
this.usePaper.total=rs.result.count;
}else{
this.$message.error('查询可用试卷失败');
}
})
},
changePaperPage(pindex){
this.usePaper.pageIndex=pindex;
this.loadExamPapers();
},
chooseExamPaper(epaper){ //选择试卷后
if(epaper.counts==0){
this.$message.error('此试卷无试题内容,请重新选择');
return;
}
this.exam.info.paperType=2;// 选择已有试卷
this.exam.info.paperId=epaper.id;// 选择已有试卷
this.usePaper.paperId=epaper.id;
this.usePaper.paperName=epaper.testName;
//this.usePaper.paperJson= epaper.paperContent;
this.loadExamPaper();
this.changeExamShow(3);
},
loadExamPaper(){
if(this.exam.info.paperType!=2){
return;
}
apiExamPaper.detail(this.exam.info.paperId).then(rs=>{
if(rs.status==200){
this.usePaper.paperId=rs.result.id;
this.usePaper.paperName=rs.result.testName;
//this.usePaper.paperJson= rs.result.paperContent;
}
})
}
}
}
</script>
<style lang="scss" scoped>

View File

@@ -79,6 +79,10 @@ export default {
type: Number,
default: 1024,
},
scorm:{
type:String,
default:''
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
@@ -156,6 +160,13 @@ export default {
//this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
return false;
}
//console.log(this.scorm,fileExtension,'upload');
if(this.scorm && this.scorm==fileExtension){
this.data.dir="scorm";
}
//console.log(this.data,'this.data');
}
// 校检文件大小
if (this.fileSize) {
@@ -166,6 +177,7 @@ export default {
return false;
}
}
if(this.loading) {
this.isLoading = true;
}

View File

@@ -146,7 +146,7 @@
</div>
<!-- <div style="margin-top: 10px" v-if="isUpload"><el-button type="primary" size="mini" @click="isUploadHandle()">选择文件并上传</el-button></div> -->
<div style="margin-top: 10px">
<file-upload dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
<file-upload scorm="zip" dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
</div>
</div>
<div style="margin-top: 10px">
@@ -160,7 +160,7 @@
</el-table-column>
<el-table-column prop="duration" label="时长(秒)" width="100">
<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>
</el-table-column>
<el-table-column label="可见性" width="100">
@@ -190,7 +190,7 @@
</el-dialog>
<el-dialog title="预览课件" :close-on-click-modal="false" width="800px" :visible.sync="coursewareShow" custom-class="g-dialog">
<div>
<div class="courseware-title">{{ fileInfo.fileName }}</div>
<div class="courseware-title">{{ fileInfo.name }}</div>
<div class="courseware-icon">
<div v-if="fileInfo.resType == 10" style="position: relative;">
<videoPlayer
@@ -236,7 +236,7 @@
<el-form-item label="课件类型">{{ getType(form.resType) }}</el-form-item>
<el-form-item label="时长(分)">
<!-- <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-form-item>
<el-form-item label="可见性">
@@ -305,10 +305,8 @@ export default {
{ value: 10, label: '视频' },
{ value: 20, label: '音频' },
{ value: 30, label: '图片' },
{ value: 40, label: '文档' }
// { value: 41, label: "图文" },
// { value: 50, label: "scrom包" },
// { value: 90, label: "其他" }
{ value: 40, label: '文档' },
{ value: 50, label: "scrom" }
],
form: {
id:'',
@@ -532,6 +530,11 @@ export default {
if (status === 200) {
result.device1 = true;
result.device2 = true;
result.minute='';
if(result.duration){
result.minute=Math.round(result.duration/60); //四舍五入
}
this.fileList.push(result);
} else {
this.$message.error(error);
@@ -554,6 +557,11 @@ export default {
} else if (item.device2 === true) {
item.device = 2;
}
//转化为秒
if(item.minute){
result.duration=parseFloat(result.minute)*60;
}
});
this.loading = true;
coueseFile.batchUpdate(this.fileList).then(rs => {
@@ -575,6 +583,9 @@ export default {
this.params.pageIndex = this.page.pageIndex;
const { result, error, status } = await coueseFile.pageList(this.params, this.page);
if (status === 200) {
result.list.forEach(item=>{
item.minute=Math.round(item.duration/60);//转化为分钟
})
this.tableData = result.list;
this.page.count = result.count;
this.page.pageSize = result.pageSize;
@@ -588,22 +599,27 @@ export default {
editFile(row) {
coueseFile.detail(row.id).then(res=>{
if(res.status == 200) {
this.form = res.result;
if (res.result.resOwner3 == '') {
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
} else {
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
}
if (res.result.device === 1) {
this.form.device1 = true;
} else if (res.result.device === 2) {
this.form.device2 = true;
} else if (res.result.device === 3) {
this.form.device1 = true;
this.form.device2 = true;
}
this.form = res.result;
if(this.form.duration){
this.form.minute=Math.round(res.result.duration/60);//转化为分钟
}else{
this.form.minute=0;
}
})
if (res.result.resOwner3 == '') {
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
} else {
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
}
if (res.result.device === 1) {
this.form.device1 = true;
} else if (res.result.device === 2) {
this.form.device2 = true;
} else if (res.result.device === 3) {
this.form.device1 = true;
this.form.device2 = true;
}
}
})
this.editCoursewareShow = true;
},
handleSizeChange(val) {
@@ -685,11 +701,11 @@ export default {
//scorm课件的内容取第一个sco
var scorm=JSON.parse(row.content);
//console.log(scorm,'scorm')
if(scorm.index){
if(scorm){
//这里需要提取的到配置文件中,实际中只需要传 rowId就可以了
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
this.scormUrl=process.env.VUE_APP_SCORM_URL+'?mode=preview&scormId='+row.id;//播放的首页
}else{
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
this.$message({type: 'error',message: 'SCORM包解析失败'});
}
}

View File

@@ -85,6 +85,9 @@
<div v-if="resType == 41">
<div style="padding: 20px;" v-html="contentData.content"></div>
</div>
<div v-if="resType == 50" style="min-height: 500px;">
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" scrolling="no" border="0px" style="width:100%;height:500px;border:0px;overflow:hidden;"></iframe>
</div>
<div v-if="resType == 52">
<div v-if="contentData.content != ''">
<div class="hyper-link" v-if="conLink.openType == 2">
@@ -317,6 +320,7 @@
data() {
return {
cutOrgNamePath,
scormUrl:'',//当前播放的scormUrl
loading:false,
controlHeight:400,//左边控制区域的内容高度
timer: '',
@@ -436,9 +440,8 @@
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
},
noteChange(){
//视频点定位,直接到播放的视频位置
//视频点定位,直接到播放的视频位置
this.timer = new Date().getTime()
},
//非音视频课学习时长的增加,每一分钟保存一次
appendStudyOtherTime() {
@@ -592,7 +595,25 @@
}
});
// }
} else if (r.contentType == 52) {
}else if(r.contentType==50){ //scorm
this.scormUrl='';
apiCourseFile.detail(r.contentRefId).then(cfrs => {
if(cfrs.status==200){
this.curCFile = cfrs.result;
//this.scormUrl=cfrs
let pars='?mode=normal&r='+Math.random();
pars+='&scormId='+this.curCFile.id;
pars+='&courseId='+this.courseId;
pars+='&contentId='+r.id;
pars+='&studentId='+this.userInfo.aid;
pars+='&studentName='+encodeURIComponent(this.userInfo.name);
pars+='&lmsId='+this.studyId;
pars+='&scoId=';//不指定scorm模块自动根据学习记录定位
this.scormUrl=process.env.VUE_APP_SCORM_URL+pars;//播放的首页
}
});
}else if (r.contentType == 52) {
this.isAppendTime = false;
if (r.content.startsWith('\{')) {
this.conLink = JSON.parse(r.content);
@@ -617,6 +638,7 @@
if (this.contentData.status < 2) {
this.contentData.status = 2; //进行中
}
//以下是学习记录
if (this.contentData.contentType > 20) { //非视频类的
//用户的学习时长,非音视频课程学习,单独的处理
this.isAppendTime = false;
@@ -625,9 +647,15 @@
$this.appendStudyOtherTime();
}, 1000*60*2); //非音视频课程学习,2分钟后记录因为一次记录是60秒
//this.appendStudyTime();
this.handleTimeout = setTimeout(function() {
$this.saveStudyInfo();
}, 5000); //5秒后记录学习完成
if (this.contentData.contentType != 50) {
this.handleTimeout = setTimeout(function(){
$this.saveStudyInfo();
}, 5000); //5秒后记录学习完成
}else{
//scorm课件不记录完成情况由播放回调记录完成情况
//当前先保存学习记录,未学习状态
this.saveScormStudy();
}
}
@@ -1229,6 +1257,34 @@
}
}
},
saveScormStudy() {
//只记录SCORM课件的学习
if (this.contentData.contentType != 50) {
return;
}
if (this.contentData.status == 9) {
//已学习完的,不会再记录
return;
}
let params = {
studyId: this.studyId, //学习id,
courseId: this.courseId, //课程id,
contentId: this.contentData.id, //内容id,
contentType: this.contentData.contentType,
contentName: this.contentData.contentName, //内容名称
progress: 0,
status: 1,
contentTotal: this.totalContent
};
apiStudy.studyContent(params).then(res => {
if (res.status == 200) {
this.contentData.status = 2; //进行中
this.contentData.studyItemId = res.result; //学习记录id
} else {
console.log('记录学习失败:' + res.message + '' + res.error);
}
});
},
saveStudyInfo() {
//记录课件学习信息
if (this.contentData.contentType >= 60) {