mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 20:06:44 +08:00
提交修改
This commit is contained in:
@@ -372,7 +372,7 @@
|
|||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
converStatus:4,
|
converStatus:4,
|
||||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
||||||
curPdfPath:'',
|
curPdfPath:'',
|
||||||
curCFile:{},//当前课件的内容
|
curCFile:{},//当前课件的内容
|
||||||
scormUrl:'',//scormUrl地址
|
scormUrl:'',//scormUrl地址
|
||||||
@@ -441,7 +441,13 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
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:{
|
watch:{
|
||||||
reset(newVal){
|
reset(newVal){
|
||||||
|
|||||||
@@ -24,15 +24,26 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--内容区-->
|
<!--内容区-->
|
||||||
<div style="margin-top: 10px;">
|
<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 v-if="cware.content.contentRefId==''">
|
||||||
<div style="display: flex;justify-content: center;padding-top: 50px;">
|
<div style="padding-top: 0px;">
|
||||||
<div>
|
<!-- <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>
|
<choose-course-file ref="coursewarePanel" :resType="cware.content.contentType" @choose="chooseFile"></choose-course-file>
|
||||||
</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="margin-left: 10px;">
|
<div style="margin-left: 10px;">
|
||||||
<el-button type="primary" size="small" @click="toFindCWare()" >选择已有{{getType(cware.content.contentType)}}</el-button>
|
<el-button type="primary" size="small" @click="toFindCWare()" >选择已有{{getType(cware.content.contentType)}}</el-button>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
@@ -116,6 +127,9 @@
|
|||||||
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -520,6 +534,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
|
||||||
import WxEditor from "@/components/Editor/indexCourse.vue";
|
import WxEditor from "@/components/Editor/indexCourse.vue";
|
||||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||||
import FileUpload from '@/components/FileUpload/index.vue';
|
import FileUpload from '@/components/FileUpload/index.vue';
|
||||||
@@ -530,7 +545,7 @@
|
|||||||
import {getType} from '../../utils/tools.js';
|
import {getType} from '../../utils/tools.js';
|
||||||
import { deepClone } from "../../utils";
|
import { deepClone } from "../../utils";
|
||||||
export default{
|
export default{
|
||||||
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer},
|
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer,chooseCourseFile},
|
||||||
props: {
|
props: {
|
||||||
contents:{
|
contents:{
|
||||||
type:Array,
|
type:Array,
|
||||||
@@ -565,6 +580,7 @@
|
|||||||
curCFile:{},//当前课件的内容
|
curCFile:{},//当前课件的内容
|
||||||
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
||||||
imageShowUrl: '',
|
imageShowUrl: '',
|
||||||
|
scormUrl:'',//scorm课件对应的url地址
|
||||||
activeName: 'courseware',
|
activeName: 'courseware',
|
||||||
getType: getType,
|
getType: getType,
|
||||||
cwareTypes:[
|
cwareTypes:[
|
||||||
@@ -717,6 +733,9 @@
|
|||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
//this.init();
|
//this.init();
|
||||||
|
if(process.env.NODE_ENV=='development'){
|
||||||
|
this.fileBaseUrl=process.env.VUE_APP_FILE_BASE_URL;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
reset(newVal){
|
reset(newVal){
|
||||||
@@ -730,6 +749,7 @@
|
|||||||
methods:{
|
methods:{
|
||||||
init(){
|
init(){
|
||||||
this.activeName='courseware';
|
this.activeName='courseware';
|
||||||
|
this.scormUrl='';//scorm的路径
|
||||||
this.curCFile={},//当前课件的内容
|
this.curCFile={},//当前课件的内容
|
||||||
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
|
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
|
||||||
this.cware.show=1;
|
this.cware.show=1;
|
||||||
@@ -814,6 +834,19 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
loadScormFile(){
|
||||||
|
//对于scorm课件内容,需要再查一下
|
||||||
|
this.scormUrl='';
|
||||||
|
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(){
|
loadHomeworkInfo(){
|
||||||
apiCourse.getHomework(this.homework.content.id).then(res=>{
|
apiCourse.getHomework(this.homework.content.id).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
@@ -1083,6 +1116,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();
|
||||||
|
},2000);
|
||||||
|
}else if(this.cware.content.contentType==50){
|
||||||
|
setTimeout(function(){
|
||||||
|
$this.loadScormFile();
|
||||||
|
},2000);
|
||||||
|
}
|
||||||
|
},
|
||||||
getCoursewareList() {
|
getCoursewareList() {
|
||||||
// name:查询的名称的关键字
|
// name:查询的名称的关键字
|
||||||
// self:true/false,默认是true,是否只查询自己上传的课件
|
// self:true/false,默认是true,是否只查询自己上传的课件
|
||||||
|
|||||||
Reference in New Issue
Block a user