mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 04:16:45 +08:00
Merge branch 'scorm' into third
This commit is contained in:
@@ -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包解析失败'});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user